]> gcc.gnu.org Git - gcc.git/commit
arm: further fix overloading of MVE vaddq[_m]_n intrinsic
authorStam Markianos-Wright <stam.markianos-wright@arm.com>
Thu, 10 Nov 2022 15:02:47 +0000 (15:02 +0000)
committerAndrea Corallo <andrea.corallo@arm.com>
Mon, 28 Nov 2022 09:06:15 +0000 (10:06 +0100)
commite0dd75fe90ef4cda94f431747d239d6cfcf5656f
tree1a2b7984bd6e90daea0503bec727c79d3837a42b
parentff2bf3dc61f453c2fe206cd8e9489300a1ca2763
arm: further fix overloading of MVE vaddq[_m]_n intrinsic

It was observed that in tests `vaddq_m_n_[s/u][8/16/32].c`, the _Generic
resolution would fall back to the `__ARM_undef` failure state.

This is a regression since `dc39db873670bea8d8e655444387ceaa53a01a79` and
`6bd4ce64eb48a72eca300cb52773e6101d646004`, but it previously wasn't
identified, because the tests were not checking for this kind of failure.

The above commits changed the definitions of the intrinsics from using
`[u]int[8/16/32]_t` types for the scalar argument to using `int`. This
allowed `int` to be supported in user code through the overloaded
`#defines`, but seems to have broken the `[u]int[8/16/32]_t` types

The solution implemented by this patch is to explicitly use a new
_Generic mapping from all the `[u]int[8/16/32]_t` types for int. With this
change, both `int` and `[u]int[8/16/32]_t` parameters are supported from
user code and are handled by the overloading mechanism correctly.

Note that in these scalar cases it is safe to pass the raw p<n>, rather
than the typeof-ed __p<n>, because we are not at risk of the _Generics
being exponentially expanded on the `n` scalar argument to an `_n`
intrinsic. Using p<n> instead will give a more accurate error message
to the user, should something be wrong with that argument.

gcc/ChangeLog:
PR target/96795
* config/arm/arm_mve.h (__arm_vaddq_m_n_s8): Change types.
(__arm_vaddq_m_n_s32): Likewise.
(__arm_vaddq_m_n_s16): Likewise.
(__arm_vaddq_m_n_u8): Likewise.
(__arm_vaddq_m_n_u32): Likewise.
(__arm_vaddq_m_n_u16): Likewise.
(__arm_vaddq_m): Fix Overloading.
(__ARM_mve_coerce3): New.
gcc/config/arm/arm_mve.h
This page took 0.056916 seconds and 5 git commands to generate.