aarch64: Use type-qualified builtins for [R]SHRN[2] Neon intrinsics

Declare unsigned type-qualified builtins and use them for [R]SHRN[2]
Neon intrinsics. This removes the need for casts in arm_neon.h.

gcc/ChangeLog:

2021-11-08  Jonathan Wright  <jonathan.wright@arm.com>

	* config/aarch64/aarch64-simd-builtins.def: Declare type-
	qualified builtins for [R]SHRN[2].
	* config/aarch64/arm_neon.h (vshrn_n_u16): Use type-qualified
	builtin and remove casts.
	(vshrn_n_u32): Likewise.
	(vshrn_n_u64): Likewise.
	(vrshrn_high_n_u16): Likewise.
	(vrshrn_high_n_u32): Likewise.
	(vrshrn_high_n_u64): Likewise.
	(vrshrn_n_u16): Likewise.
	(vrshrn_n_u32): Likewise.
	(vrshrn_n_u64): Likewise.
	(vshrn_high_n_u16): Likewise.
	(vshrn_high_n_u32): Likewise.
	(vshrn_high_n_u64): Likewise.
This commit is contained in:
Jonathan Wright 2021-11-08 18:35:59 +00:00
parent 439906c61d
commit a22c03d439
2 changed files with 18 additions and 20 deletions

View file

@ -253,15 +253,19 @@
/* Implemented by aarch64_shrn<mode>". */
BUILTIN_VQN (SHIFTIMM, shrn, 0, NONE)
BUILTIN_VQN (USHIFTIMM, shrn, 0, NONE)
/* Implemented by aarch64_shrn2<mode>. */
BUILTIN_VQN (SHIFTACC, shrn2, 0, NONE)
BUILTIN_VQN (SHIFT2IMM, shrn2, 0, NONE)
BUILTIN_VQN (USHIFT2IMM, shrn2, 0, NONE)
/* Implemented by aarch64_rshrn<mode>". */
BUILTIN_VQN (SHIFTIMM, rshrn, 0, NONE)
BUILTIN_VQN (USHIFTIMM, rshrn, 0, NONE)
/* Implemented by aarch64_rshrn2<mode>. */
BUILTIN_VQN (SHIFTACC, rshrn2, 0, NONE)
BUILTIN_VQN (SHIFT2IMM, rshrn2, 0, NONE)
BUILTIN_VQN (USHIFT2IMM, rshrn2, 0, NONE)
/* Implemented by aarch64_<su>mlsl<mode>. */
BUILTIN_VD_BHSI (TERNOP, smlsl, 0, NONE)

View file

@ -7606,21 +7606,21 @@ __extension__ extern __inline uint8x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_n_u16 (uint16x8_t __a, const int __b)
{
return (uint8x8_t)__builtin_aarch64_shrnv8hi ((int16x8_t)__a, __b);
return __builtin_aarch64_shrnv8hi_uus (__a, __b);
}
__extension__ extern __inline uint16x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_n_u32 (uint32x4_t __a, const int __b)
{
return (uint16x4_t)__builtin_aarch64_shrnv4si ((int32x4_t)__a, __b);
return __builtin_aarch64_shrnv4si_uus (__a, __b);
}
__extension__ extern __inline uint32x2_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_n_u64 (uint64x2_t __a, const int __b)
{
return (uint32x2_t)__builtin_aarch64_shrnv2di ((int64x2_t)__a, __b);
return __builtin_aarch64_shrnv2di_uus (__a, __b);
}
__extension__ extern __inline int32x4_t
@ -8387,24 +8387,21 @@ __extension__ extern __inline uint8x16_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_high_n_u16 (uint8x8_t __a, uint16x8_t __b, const int __c)
{
return (uint8x16_t) __builtin_aarch64_rshrn2v8hi ((int8x8_t) __a,
(int16x8_t) __b, __c);
return __builtin_aarch64_rshrn2v8hi_uuus (__a, __b, __c);
}
__extension__ extern __inline uint16x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_high_n_u32 (uint16x4_t __a, uint32x4_t __b, const int __c)
{
return (uint16x8_t) __builtin_aarch64_rshrn2v4si ((int16x4_t) __a,
(int32x4_t) __b, __c);
return __builtin_aarch64_rshrn2v4si_uuus (__a, __b, __c);
}
__extension__ extern __inline uint32x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_high_n_u64 (uint32x2_t __a, uint64x2_t __b, const int __c)
{
return (uint32x4_t) __builtin_aarch64_rshrn2v2di ((int32x2_t)__a,
(int64x2_t)__b, __c);
return __builtin_aarch64_rshrn2v2di_uuus (__a, __b, __c);
}
__extension__ extern __inline int8x8_t
@ -8432,21 +8429,21 @@ __extension__ extern __inline uint8x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_n_u16 (uint16x8_t __a, const int __b)
{
return (uint8x8_t) __builtin_aarch64_rshrnv8hi ((int16x8_t) __a, __b);
return __builtin_aarch64_rshrnv8hi_uus (__a, __b);
}
__extension__ extern __inline uint16x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_n_u32 (uint32x4_t __a, const int __b)
{
return (uint16x4_t) __builtin_aarch64_rshrnv4si ((int32x4_t) __a, __b);
return __builtin_aarch64_rshrnv4si_uus (__a, __b);
}
__extension__ extern __inline uint32x2_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_n_u64 (uint64x2_t __a, const int __b)
{
return (uint32x2_t) __builtin_aarch64_rshrnv2di ((int64x2_t) __a, __b);
return __builtin_aarch64_rshrnv2di_uus (__a, __b);
}
__extension__ extern __inline uint32x2_t
@ -8488,24 +8485,21 @@ __extension__ extern __inline uint8x16_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_high_n_u16 (uint8x8_t __a, uint16x8_t __b, const int __c)
{
return (uint8x16_t)
__builtin_aarch64_shrn2v8hi ((int8x8_t) __a, (int16x8_t) __b, __c);
return __builtin_aarch64_shrn2v8hi_uuus (__a, __b, __c);
}
__extension__ extern __inline uint16x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_high_n_u32 (uint16x4_t __a, uint32x4_t __b, const int __c)
{
return (uint16x8_t)
__builtin_aarch64_shrn2v4si ((int16x4_t) __a, (int32x4_t) __b, __c);
return __builtin_aarch64_shrn2v4si_uuus (__a, __b, __c);
}
__extension__ extern __inline uint32x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_high_n_u64 (uint32x2_t __a, uint64x2_t __b, const int __c)
{
return (uint32x4_t)
__builtin_aarch64_shrn2v2di ((int32x2_t) __a, (int64x2_t) __b, __c);
return __builtin_aarch64_shrn2v2di_uuus (__a, __b, __c);
}
__extension__ extern __inline poly8x8_t