Implement vaddlvaq using the new MVE builtins framework. 2022-10-25 Christophe Lyon <christophe.l...@arm.com>
gcc/ * config/arm/arm-mve-builtins-base.cc (vaddlvaq): New. * config/arm/arm-mve-builtins-base.def (vaddlvaq): New. * config/arm/arm-mve-builtins-base.h (vaddlvaq): New. * config/arm/arm_mve.h (vaddlvaq): Remove. (vaddlvaq_p): Remove. (vaddlvaq_u32): Remove. (vaddlvaq_s32): Remove. (vaddlvaq_p_s32): Remove. (vaddlvaq_p_u32): Remove. (__arm_vaddlvaq_u32): Remove. (__arm_vaddlvaq_s32): Remove. (__arm_vaddlvaq_p_s32): Remove. (__arm_vaddlvaq_p_u32): Remove. (__arm_vaddlvaq): Remove. (__arm_vaddlvaq_p): Remove. --- gcc/config/arm/arm-mve-builtins-base.cc | 1 + gcc/config/arm/arm-mve-builtins-base.def | 1 + gcc/config/arm/arm-mve-builtins-base.h | 1 + gcc/config/arm/arm_mve.h | 74 ------------------------ 4 files changed, 3 insertions(+), 74 deletions(-) diff --git a/gcc/config/arm/arm-mve-builtins-base.cc b/gcc/config/arm/arm-mve-builtins-base.cc index 2dec15ac0b1..070a41c2d89 100644 --- a/gcc/config/arm/arm-mve-builtins-base.cc +++ b/gcc/config/arm/arm-mve-builtins-base.cc @@ -244,6 +244,7 @@ namespace arm_mve { FUNCTION_WITHOUT_N (vabdq, VABDQ) FUNCTION (vabsq, unspec_based_mve_function_exact_insn, (ABS, ABS, ABS, -1, -1, -1, VABSQ_M_S, -1, VABSQ_M_F, -1, -1, -1)) FUNCTION_WITH_RTX_M_N (vaddq, PLUS, VADDQ) +FUNCTION_PRED_P_S_U (vaddlvaq, VADDLVAQ) FUNCTION_PRED_P_S_U (vaddlvq, VADDLVQ) FUNCTION_PRED_P_S_U (vaddvq, VADDVQ) FUNCTION_PRED_P_S_U (vaddvaq, VADDVAQ) diff --git a/gcc/config/arm/arm-mve-builtins-base.def b/gcc/config/arm/arm-mve-builtins-base.def index b0de5af1013..62d2050b86d 100644 --- a/gcc/config/arm/arm-mve-builtins-base.def +++ b/gcc/config/arm/arm-mve-builtins-base.def @@ -20,6 +20,7 @@ #define REQUIRES_FLOAT false DEF_MVE_FUNCTION (vabdq, binary, all_integer, mx_or_none) DEF_MVE_FUNCTION (vabsq, unary, all_signed, mx_or_none) +DEF_MVE_FUNCTION (vaddlvaq, unary_widen_acc, integer_32, p_or_none) DEF_MVE_FUNCTION (vaddlvq, unary_acc, integer_32, p_or_none) DEF_MVE_FUNCTION (vaddq, binary_opt_n, all_integer, mx_or_none) DEF_MVE_FUNCTION (vaddvaq, unary_int32_acc, all_integer, p_or_none) diff --git a/gcc/config/arm/arm-mve-builtins-base.h b/gcc/config/arm/arm-mve-builtins-base.h index fa2e97fd461..59754a03977 100644 --- a/gcc/config/arm/arm-mve-builtins-base.h +++ b/gcc/config/arm/arm-mve-builtins-base.h @@ -25,6 +25,7 @@ namespace functions { extern const function_base *const vabdq; extern const function_base *const vabsq; +extern const function_base *const vaddlvaq; extern const function_base *const vaddlvq; extern const function_base *const vaddq; extern const function_base *const vaddvaq; diff --git a/gcc/config/arm/arm_mve.h b/gcc/config/arm/arm_mve.h index c0891b7592a..8b61593c6b0 100644 --- a/gcc/config/arm/arm_mve.h +++ b/gcc/config/arm/arm_mve.h @@ -66,7 +66,6 @@ #define vmlsldavq(__a, __b) __arm_vmlsldavq(__a, __b) #define vmlaldavxq(__a, __b) __arm_vmlaldavxq(__a, __b) #define vrmlaldavhq(__a, __b) __arm_vrmlaldavhq(__a, __b) -#define vaddlvaq(__a, __b) __arm_vaddlvaq(__a, __b) #define vrmlsldavhxq(__a, __b) __arm_vrmlsldavhxq(__a, __b) #define vrmlsldavhq(__a, __b) __arm_vrmlsldavhq(__a, __b) #define vrmlaldavhxq(__a, __b) __arm_vrmlaldavhxq(__a, __b) @@ -103,7 +102,6 @@ #define vrmlaldavhaxq(__a, __b, __c) __arm_vrmlaldavhaxq(__a, __b, __c) #define vrmlsldavhaq(__a, __b, __c) __arm_vrmlsldavhaq(__a, __b, __c) #define vrmlsldavhaxq(__a, __b, __c) __arm_vrmlsldavhaxq(__a, __b, __c) -#define vaddlvaq_p(__a, __b, __p) __arm_vaddlvaq_p(__a, __b, __p) #define vrmlaldavhq_p(__a, __b, __p) __arm_vrmlaldavhq_p(__a, __b, __p) #define vrmlaldavhxq_p(__a, __b, __p) __arm_vrmlaldavhxq_p(__a, __b, __p) #define vrmlsldavhq_p(__a, __b, __p) __arm_vrmlsldavhq_p(__a, __b, __p) @@ -474,14 +472,12 @@ #define vctp64q_m(__a, __p) __arm_vctp64q_m(__a, __p) #define vctp32q_m(__a, __p) __arm_vctp32q_m(__a, __p) #define vctp16q_m(__a, __p) __arm_vctp16q_m(__a, __p) -#define vaddlvaq_u32(__a, __b) __arm_vaddlvaq_u32(__a, __b) #define vrmlsldavhxq_s32(__a, __b) __arm_vrmlsldavhxq_s32(__a, __b) #define vrmlsldavhq_s32(__a, __b) __arm_vrmlsldavhq_s32(__a, __b) #define vrmlaldavhxq_s32(__a, __b) __arm_vrmlaldavhxq_s32(__a, __b) #define vrmlaldavhq_s32(__a, __b) __arm_vrmlaldavhq_s32(__a, __b) #define vcvttq_f16_f32(__a, __b) __arm_vcvttq_f16_f32(__a, __b) #define vcvtbq_f16_f32(__a, __b) __arm_vcvtbq_f16_f32(__a, __b) -#define vaddlvaq_s32(__a, __b) __arm_vaddlvaq_s32(__a, __b) #define vabavq_s8(__a, __b, __c) __arm_vabavq_s8(__a, __b, __c) #define vabavq_s16(__a, __b, __c) __arm_vabavq_s16(__a, __b, __c) #define vabavq_s32(__a, __b, __c) __arm_vabavq_s32(__a, __b, __c) @@ -615,7 +611,6 @@ #define vrmlaldavhaxq_s32(__a, __b, __c) __arm_vrmlaldavhaxq_s32(__a, __b, __c) #define vrmlsldavhaq_s32(__a, __b, __c) __arm_vrmlsldavhaq_s32(__a, __b, __c) #define vrmlsldavhaxq_s32(__a, __b, __c) __arm_vrmlsldavhaxq_s32(__a, __b, __c) -#define vaddlvaq_p_s32(__a, __b, __p) __arm_vaddlvaq_p_s32(__a, __b, __p) #define vcvtbq_m_f16_f32(__a, __b, __p) __arm_vcvtbq_m_f16_f32(__a, __b, __p) #define vcvtbq_m_f32_f16(__inactive, __a, __p) __arm_vcvtbq_m_f32_f16(__inactive, __a, __p) #define vcvttq_m_f16_f32(__a, __b, __p) __arm_vcvttq_m_f16_f32(__a, __b, __p) @@ -624,7 +619,6 @@ #define vrmlaldavhxq_p_s32(__a, __b, __p) __arm_vrmlaldavhxq_p_s32(__a, __b, __p) #define vrmlsldavhq_p_s32(__a, __b, __p) __arm_vrmlsldavhq_p_s32(__a, __b, __p) #define vrmlsldavhxq_p_s32(__a, __b, __p) __arm_vrmlsldavhxq_p_s32(__a, __b, __p) -#define vaddlvaq_p_u32(__a, __b, __p) __arm_vaddlvaq_p_u32(__a, __b, __p) #define vrmlaldavhq_p_u32(__a, __b, __p) __arm_vrmlaldavhq_p_u32(__a, __b, __p) #define vmvnq_m_n_s16(__inactive, __imm, __p) __arm_vmvnq_m_n_s16(__inactive, __imm, __p) #define vcmlaq_f16(__a, __b, __c) __arm_vcmlaq_f16(__a, __b, __c) @@ -2253,13 +2247,6 @@ __arm_vctp16q_m (uint32_t __a, mve_pred16_t __p) return __builtin_mve_vctp16q_mv8bi (__a, __p); } -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq_u32 (uint64_t __a, uint32x4_t __b) -{ - return __builtin_mve_vaddlvaq_uv4si (__a, __b); -} - __extension__ extern __inline int64_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vrmlsldavhxq_s32 (int32x4_t __a, int32x4_t __b) @@ -2288,13 +2275,6 @@ __arm_vrmlaldavhq_s32 (int32x4_t __a, int32x4_t __b) return __builtin_mve_vrmlaldavhq_sv4si (__a, __b); } -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq_s32 (int64_t __a, int32x4_t __b) -{ - return __builtin_mve_vaddlvaq_sv4si (__a, __b); -} - __extension__ extern __inline uint32_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vabavq_s8 (uint32_t __a, int8x16_t __b, int8x16_t __c) @@ -3182,13 +3162,6 @@ __arm_vrmlsldavhaxq_s32 (int64_t __a, int32x4_t __b, int32x4_t __c) return __builtin_mve_vrmlsldavhaxq_sv4si (__a, __b, __c); } -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq_p_s32 (int64_t __a, int32x4_t __b, mve_pred16_t __p) -{ - return __builtin_mve_vaddlvaq_p_sv4si (__a, __b, __p); -} - __extension__ extern __inline int64_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vrmlaldavhq_p_s32 (int32x4_t __a, int32x4_t __b, mve_pred16_t __p) @@ -3217,13 +3190,6 @@ __arm_vrmlsldavhxq_p_s32 (int32x4_t __a, int32x4_t __b, mve_pred16_t __p) return __builtin_mve_vrmlsldavhxq_p_sv4si (__a, __b, __p); } -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq_p_u32 (uint64_t __a, uint32x4_t __b, mve_pred16_t __p) -{ - return __builtin_mve_vaddlvaq_p_uv4si (__a, __b, __p); -} - __extension__ extern __inline uint64_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vrmlaldavhq_p_u32 (uint32x4_t __a, uint32x4_t __b, mve_pred16_t __p) @@ -10047,13 +10013,6 @@ __arm_vrmlaldavhq (uint32x4_t __a, uint32x4_t __b) return __arm_vrmlaldavhq_u32 (__a, __b); } -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq (uint64_t __a, uint32x4_t __b) -{ - return __arm_vaddlvaq_u32 (__a, __b); -} - __extension__ extern __inline int64_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vrmlsldavhxq (int32x4_t __a, int32x4_t __b) @@ -10082,13 +10041,6 @@ __arm_vrmlaldavhq (int32x4_t __a, int32x4_t __b) return __arm_vrmlaldavhq_s32 (__a, __b); } -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq (int64_t __a, int32x4_t __b) -{ - return __arm_vaddlvaq_s32 (__a, __b); -} - __extension__ extern __inline uint32_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vabavq (uint32_t __a, int8x16_t __b, int8x16_t __c) @@ -10964,13 +10916,6 @@ __arm_vrmlsldavhaxq (int64_t __a, int32x4_t __b, int32x4_t __c) return __arm_vrmlsldavhaxq_s32 (__a, __b, __c); } -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq_p (int64_t __a, int32x4_t __b, mve_pred16_t __p) -{ - return __arm_vaddlvaq_p_s32 (__a, __b, __p); -} - __extension__ extern __inline int64_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vrmlaldavhq_p (int32x4_t __a, int32x4_t __b, mve_pred16_t __p) @@ -10999,13 +10944,6 @@ __arm_vrmlsldavhxq_p (int32x4_t __a, int32x4_t __b, mve_pred16_t __p) return __arm_vrmlsldavhxq_p_s32 (__a, __b, __p); } -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvaq_p (uint64_t __a, uint32x4_t __b, mve_pred16_t __p) -{ - return __arm_vaddlvaq_p_u32 (__a, __b, __p); -} - __extension__ extern __inline uint64_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vrmlaldavhq_p (uint32x4_t __a, uint32x4_t __b, mve_pred16_t __p) @@ -18698,18 +18636,6 @@ extern void *__ARM_undef; int (*)[__ARM_mve_type_uint16x8_t][__ARM_mve_type_uint16x8_t]: __arm_vabavq_p_u16(__p0, __ARM_mve_coerce(__p1, uint16x8_t), __ARM_mve_coerce(__p2, uint16x8_t), p3), \ int (*)[__ARM_mve_type_uint32x4_t][__ARM_mve_type_uint32x4_t]: __arm_vabavq_p_u32(__p0, __ARM_mve_coerce(__p1, uint32x4_t), __ARM_mve_coerce(__p2, uint32x4_t), p3));}) -#define __arm_vaddlvaq(p0,p1) ({ __typeof(p0) __p0 = (p0); \ - __typeof(p1) __p1 = (p1); \ - _Generic( (int (*)[__ARM_mve_typeid(__p0)][__ARM_mve_typeid(__p1)])0, \ - int (*)[__ARM_mve_type_int_n][__ARM_mve_type_int32x4_t]: __arm_vaddlvaq_s32 (__ARM_mve_coerce3(p0, int), __ARM_mve_coerce(__p1, int32x4_t)), \ - int (*)[__ARM_mve_type_int_n][__ARM_mve_type_uint32x4_t]: __arm_vaddlvaq_u32 (__ARM_mve_coerce3(p0, int), __ARM_mve_coerce(__p1, uint32x4_t)));}) - -#define __arm_vaddlvaq_p(p0,p1,p2) ({ __typeof(p0) __p0 = (p0); \ - __typeof(p1) __p1 = (p1); \ - _Generic( (int (*)[__ARM_mve_typeid(__p0)][__ARM_mve_typeid(__p1)])0, \ - int (*)[__ARM_mve_type_int_n][__ARM_mve_type_int32x4_t]: __arm_vaddlvaq_p_s32 (__ARM_mve_coerce3(p0, int), __ARM_mve_coerce(__p1, int32x4_t), p2), \ - int (*)[__ARM_mve_type_int_n][__ARM_mve_type_uint32x4_t]: __arm_vaddlvaq_p_u32 (__ARM_mve_coerce3(p0, int), __ARM_mve_coerce(__p1, uint32x4_t), p2));}) - #define __arm_vmladavaq(p0,p1,p2) ({ __typeof(p0) __p0 = (p0); \ __typeof(p1) __p1 = (p1); \ __typeof(p2) __p2 = (p2); \ -- 2.34.1