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

Declare unsigned type-qualified builtins and use them for XTN[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 unsigned
	type-qualified builtins for XTN[2].
	* config/aarch64/arm_neon.h (vmovn_high_u16): Use type-
	qualified builtin and remove casts.
	(vmovn_high_u32): Likewise.
	(vmovn_high_u64): Likewise.
	(vmovn_u16): Likewise.
	(vmovn_u32): Likewise.
	(vmovn_u64): Likewise.
This commit is contained in:
Jonathan Wright 2021-11-08 17:48:56 +00:00
parent a2590b545e
commit 439906c61d
2 changed files with 9 additions and 10 deletions

View File

@ -235,6 +235,7 @@
/* Implemented by aarch64_xtn<mode>. */
BUILTIN_VQN (UNOP, xtn, 0, NONE)
BUILTIN_VQN (UNOPU, xtn, 0, NONE)
/* Implemented by aarch64_mla<mode>. */
BUILTIN_VDQ_BHSI (TERNOP, mla, 0, NONE)
@ -489,7 +490,8 @@
BUILTIN_VSDQ_I (USHIFTIMM, uqshl_n, 0, NONE)
/* Implemented by aarch64_xtn2<mode>. */
BUILTIN_VQN (UNOP, xtn2, 0, NONE)
BUILTIN_VQN (BINOP, xtn2, 0, NONE)
BUILTIN_VQN (BINOPU, xtn2, 0, NONE)
/* Implemented by vec_unpack<su>_hi_<mode>. */
BUILTIN_VQW (UNOP, vec_unpacks_hi_, 10, NONE)

View File

@ -7522,24 +7522,21 @@ __extension__ extern __inline uint8x16_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vmovn_high_u16 (uint8x8_t __a, uint16x8_t __b)
{
return (uint8x16_t)
__builtin_aarch64_xtn2v8hi ((int8x8_t) __a, (int16x8_t) __b);
return __builtin_aarch64_xtn2v8hi_uuu (__a, __b);
}
__extension__ extern __inline uint16x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vmovn_high_u32 (uint16x4_t __a, uint32x4_t __b)
{
return (uint16x8_t)
__builtin_aarch64_xtn2v4si ((int16x4_t) __a, (int32x4_t) __b);
return __builtin_aarch64_xtn2v4si_uuu (__a, __b);
}
__extension__ extern __inline uint32x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vmovn_high_u64 (uint32x2_t __a, uint64x2_t __b)
{
return (uint32x4_t)
__builtin_aarch64_xtn2v2di ((int32x2_t) __a, (int64x2_t) __b);
return __builtin_aarch64_xtn2v2di_uuu (__a, __b);
}
__extension__ extern __inline int8x8_t
@ -7567,21 +7564,21 @@ __extension__ extern __inline uint8x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vmovn_u16 (uint16x8_t __a)
{
return (uint8x8_t)__builtin_aarch64_xtnv8hi ((int16x8_t) __a);
return __builtin_aarch64_xtnv8hi_uu (__a);
}
__extension__ extern __inline uint16x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vmovn_u32 (uint32x4_t __a)
{
return (uint16x4_t) __builtin_aarch64_xtnv4si ((int32x4_t )__a);
return __builtin_aarch64_xtnv4si_uu (__a);
}
__extension__ extern __inline uint32x2_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vmovn_u64 (uint64x2_t __a)
{
return (uint32x2_t) __builtin_aarch64_xtnv2di ((int64x2_t) __a);
return __builtin_aarch64_xtnv2di_uu (__a);
}
__extension__ extern __inline int8x8_t