From a579f4c752e8c172551cc7b7a13ccf4caaec3126 Mon Sep 17 00:00:00 2001 From: Jiong Wang Date: Fri, 15 Jan 2016 17:50:01 +0000 Subject: [AArch64] Remove TODO (redundant type conversions) in arm_neon.h gcc/ * config/aarch64/aarch64-builtins.c (aarch64_types_unopus_qualifiers): New. (TYPES_UNOPUS): Likewise. * config/aarch64/aarch64-simd-builtins.def (lbtruncuv2sf): Correct builtin type, from UNOP to UNOPUS. (lbtruncuv4sf): Likewise. (lbtruncuv2df): Likewise. (lrounduv2sf): Likewise. (lrounduv4sf): Likewise. (lrounduv2df): Likewise. (lroundusf): Likewise. (lroundusf): Likewise. (lceiluv2sf): Likewise. (lceiluv4sf): Likewise. (lceiluv2df): Likewise. (lceilusf): Likewise. (lceiludf): Likewise. (lflooruv2sf): Likewise. (lflooruv4sf): Likewise. (lflooruv2df): Likewise. (lfloorusf): Likewise. (lfloorudf): Likewise. (lfrintnuv2sf): Likewise. (lfrintnuv4sf): Likewise. (lfrintnuv2df): Likewise. (lfrintnusf): Likewise. (lfrintnudf): Likewise. * config/aarch64/arm_neon.h (vcvt_u32_f32): Remove unncessary type conversion. (vcvtq_u32_f32): Likewise. (vcvtq_u64_f64): Likewise. (vcvta_u32_f32): Likewise. (vcvtaq_u32_f32): Likewise. (vcvtaq_u64_f64): Likewise. (vcvtm_u32_f32): Likewise. (vcvtmq_u32_f32): Likewise. (vcvtmq_u64_f64): Likewise. (vcvtn_u32_f32): Likwise. (vcvtnq_u32_f32): Likewise. (vcvtnq_u64_f64): Likewise. (vcvtp_u32_f32): Likewise. (vcvtpq_u32_f32): Likewise. (vcvtpq_u64_f64): Likewise. (vcvtmd_u64_f64): Likewise. (vcvtms_u32_f32): Likewise. (vcvtad_u64_f64): Likewise. (vcvtas_u32_f32): Likewise. (vcvtnd_u64_f64): Likewise. (vcvtns_u32_f32): Likewise. (vcvtpd_u64_f64): Likewise. (vcvtps_u32_f32): Likewise. From-SVN: r232444 --- gcc/ChangeLog | 54 ++++++++++++++++++++ gcc/config/aarch64/aarch64-builtins.c | 4 ++ gcc/config/aarch64/aarch64-simd-builtins.def | 46 ++++++++--------- gcc/config/aarch64/arm_neon.h | 76 +++++++++------------------- 4 files changed, 104 insertions(+), 76 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d3a6326..ba191dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,57 @@ +2016-01-15 Jiong Wang + + * config/aarch64/aarch64-builtins.c (aarch64_types_unopus_qualifiers): + New. + (TYPES_UNOPUS): Likewise. + * config/aarch64/aarch64-simd-builtins.def (lbtruncuv2sf): Correct + builtin type, from UNOP to UNOPUS. + (lbtruncuv4sf): Likewise. + (lbtruncuv2df): Likewise. + (lrounduv2sf): Likewise. + (lrounduv4sf): Likewise. + (lrounduv2df): Likewise. + (lroundusf): Likewise. + (lroundusf): Likewise. + (lceiluv2sf): Likewise. + (lceiluv4sf): Likewise. + (lceiluv2df): Likewise. + (lceilusf): Likewise. + (lceiludf): Likewise. + (lflooruv2sf): Likewise. + (lflooruv4sf): Likewise. + (lflooruv2df): Likewise. + (lfloorusf): Likewise. + (lfloorudf): Likewise. + (lfrintnuv2sf): Likewise. + (lfrintnuv4sf): Likewise. + (lfrintnuv2df): Likewise. + (lfrintnusf): Likewise. + (lfrintnudf): Likewise. + * config/aarch64/arm_neon.h (vcvt_u32_f32): Remove unncessary type + conversion. + (vcvtq_u32_f32): Likewise. + (vcvtq_u64_f64): Likewise. + (vcvta_u32_f32): Likewise. + (vcvtaq_u32_f32): Likewise. + (vcvtaq_u64_f64): Likewise. + (vcvtm_u32_f32): Likewise. + (vcvtmq_u32_f32): Likewise. + (vcvtmq_u64_f64): Likewise. + (vcvtn_u32_f32): Likwise. + (vcvtnq_u32_f32): Likewise. + (vcvtnq_u64_f64): Likewise. + (vcvtp_u32_f32): Likewise. + (vcvtpq_u32_f32): Likewise. + (vcvtpq_u64_f64): Likewise. + (vcvtmd_u64_f64): Likewise. + (vcvtms_u32_f32): Likewise. + (vcvtad_u64_f64): Likewise. + (vcvtas_u32_f32): Likewise. + (vcvtnd_u64_f64): Likewise. + (vcvtns_u32_f32): Likewise. + (vcvtpd_u64_f64): Likewise. + (vcvtps_u32_f32): Likewise. + 2016-01-15 Kyrylo Tkachov * config/aarch64/aarch64.c (aarch64_if_then_else_costs): Handle diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c index bd7a8dd..925034b 100644 --- a/gcc/config/aarch64/aarch64-builtins.c +++ b/gcc/config/aarch64/aarch64-builtins.c @@ -119,6 +119,10 @@ aarch64_types_unopu_qualifiers[SIMD_MAX_BUILTIN_ARGS] = { qualifier_unsigned, qualifier_unsigned }; #define TYPES_UNOPU (aarch64_types_unopu_qualifiers) static enum aarch64_type_qualifiers +aarch64_types_unopus_qualifiers[SIMD_MAX_BUILTIN_ARGS] + = { qualifier_unsigned, qualifier_none }; +#define TYPES_UNOPUS (aarch64_types_unopus_qualifiers) +static enum aarch64_type_qualifiers aarch64_types_binop_qualifiers[SIMD_MAX_BUILTIN_ARGS] = { qualifier_none, qualifier_none, qualifier_maybe_immediate }; #define TYPES_BINOP (aarch64_types_binop_qualifiers) diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def index c780ada..dd04579 100644 --- a/gcc/config/aarch64/aarch64-simd-builtins.def +++ b/gcc/config/aarch64/aarch64-simd-builtins.def @@ -275,9 +275,9 @@ VAR1 (UNOP, lbtruncv4sf, 2, v4si) VAR1 (UNOP, lbtruncv2df, 2, v2di) - VAR1 (UNOP, lbtruncuv2sf, 2, v2si) - VAR1 (UNOP, lbtruncuv4sf, 2, v4si) - VAR1 (UNOP, lbtruncuv2df, 2, v2di) + VAR1 (UNOPUS, lbtruncuv2sf, 2, v2si) + VAR1 (UNOPUS, lbtruncuv4sf, 2, v4si) + VAR1 (UNOPUS, lbtruncuv2df, 2, v2di) VAR1 (UNOP, lroundv2sf, 2, v2si) VAR1 (UNOP, lroundv4sf, 2, v4si) @@ -286,31 +286,31 @@ VAR1 (UNOP, lroundsf, 2, si) VAR1 (UNOP, lrounddf, 2, di) - VAR1 (UNOP, lrounduv2sf, 2, v2si) - VAR1 (UNOP, lrounduv4sf, 2, v4si) - VAR1 (UNOP, lrounduv2df, 2, v2di) - VAR1 (UNOP, lroundusf, 2, si) - VAR1 (UNOP, lroundudf, 2, di) + VAR1 (UNOPUS, lrounduv2sf, 2, v2si) + VAR1 (UNOPUS, lrounduv4sf, 2, v4si) + VAR1 (UNOPUS, lrounduv2df, 2, v2di) + VAR1 (UNOPUS, lroundusf, 2, si) + VAR1 (UNOPUS, lroundudf, 2, di) VAR1 (UNOP, lceilv2sf, 2, v2si) VAR1 (UNOP, lceilv4sf, 2, v4si) VAR1 (UNOP, lceilv2df, 2, v2di) - VAR1 (UNOP, lceiluv2sf, 2, v2si) - VAR1 (UNOP, lceiluv4sf, 2, v4si) - VAR1 (UNOP, lceiluv2df, 2, v2di) - VAR1 (UNOP, lceilusf, 2, si) - VAR1 (UNOP, lceiludf, 2, di) + VAR1 (UNOPUS, lceiluv2sf, 2, v2si) + VAR1 (UNOPUS, lceiluv4sf, 2, v4si) + VAR1 (UNOPUS, lceiluv2df, 2, v2di) + VAR1 (UNOPUS, lceilusf, 2, si) + VAR1 (UNOPUS, lceiludf, 2, di) VAR1 (UNOP, lfloorv2sf, 2, v2si) VAR1 (UNOP, lfloorv4sf, 2, v4si) VAR1 (UNOP, lfloorv2df, 2, v2di) - VAR1 (UNOP, lflooruv2sf, 2, v2si) - VAR1 (UNOP, lflooruv4sf, 2, v4si) - VAR1 (UNOP, lflooruv2df, 2, v2di) - VAR1 (UNOP, lfloorusf, 2, si) - VAR1 (UNOP, lfloorudf, 2, di) + VAR1 (UNOPUS, lflooruv2sf, 2, v2si) + VAR1 (UNOPUS, lflooruv4sf, 2, v4si) + VAR1 (UNOPUS, lflooruv2df, 2, v2di) + VAR1 (UNOPUS, lfloorusf, 2, si) + VAR1 (UNOPUS, lfloorudf, 2, di) VAR1 (UNOP, lfrintnv2sf, 2, v2si) VAR1 (UNOP, lfrintnv4sf, 2, v4si) @@ -318,11 +318,11 @@ VAR1 (UNOP, lfrintnsf, 2, si) VAR1 (UNOP, lfrintndf, 2, di) - VAR1 (UNOP, lfrintnuv2sf, 2, v2si) - VAR1 (UNOP, lfrintnuv4sf, 2, v4si) - VAR1 (UNOP, lfrintnuv2df, 2, v2di) - VAR1 (UNOP, lfrintnusf, 2, si) - VAR1 (UNOP, lfrintnudf, 2, di) + VAR1 (UNOPUS, lfrintnuv2sf, 2, v2si) + VAR1 (UNOPUS, lfrintnuv4sf, 2, v4si) + VAR1 (UNOPUS, lfrintnuv2df, 2, v2di) + VAR1 (UNOPUS, lfrintnusf, 2, si) + VAR1 (UNOPUS, lfrintnudf, 2, di) /* Implemented by 2. */ VAR1 (UNOP, floatv2si, 2, v2sf) diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 4f53f7d..1334d64 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -13203,9 +13203,7 @@ vcvt_s32_f32 (float32x2_t __a) __extension__ static __inline uint32x2_t __attribute__ ((__always_inline__)) vcvt_u32_f32 (float32x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x2_t) __builtin_aarch64_lbtruncuv2sfv2si (__a); + return __builtin_aarch64_lbtruncuv2sfv2si_us (__a); } __extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) @@ -13217,9 +13215,7 @@ vcvtq_s32_f32 (float32x4_t __a) __extension__ static __inline uint32x4_t __attribute__ ((__always_inline__)) vcvtq_u32_f32 (float32x4_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x4_t) __builtin_aarch64_lbtruncuv4sfv4si (__a); + return __builtin_aarch64_lbtruncuv4sfv4si_us (__a); } __extension__ static __inline int64x2_t __attribute__ ((__always_inline__)) @@ -13231,9 +13227,7 @@ vcvtq_s64_f64 (float64x2_t __a) __extension__ static __inline uint64x2_t __attribute__ ((__always_inline__)) vcvtq_u64_f64 (float64x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint64x2_t) __builtin_aarch64_lbtruncuv2dfv2di (__a); + return __builtin_aarch64_lbtruncuv2dfv2di_us (__a); } /* vcvta */ @@ -13247,7 +13241,7 @@ vcvtad_s64_f64 (float64_t __a) __extension__ static __inline uint64_t __attribute__ ((__always_inline__)) vcvtad_u64_f64 (float64_t __a) { - return __builtin_aarch64_lroundudfdi (__a); + return __builtin_aarch64_lroundudfdi_us (__a); } __extension__ static __inline int32_t __attribute__ ((__always_inline__)) @@ -13259,7 +13253,7 @@ vcvtas_s32_f32 (float32_t __a) __extension__ static __inline uint32_t __attribute__ ((__always_inline__)) vcvtas_u32_f32 (float32_t __a) { - return __builtin_aarch64_lroundusfsi (__a); + return __builtin_aarch64_lroundusfsi_us (__a); } __extension__ static __inline int32x2_t __attribute__ ((__always_inline__)) @@ -13271,9 +13265,7 @@ vcvta_s32_f32 (float32x2_t __a) __extension__ static __inline uint32x2_t __attribute__ ((__always_inline__)) vcvta_u32_f32 (float32x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x2_t) __builtin_aarch64_lrounduv2sfv2si (__a); + return __builtin_aarch64_lrounduv2sfv2si_us (__a); } __extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) @@ -13285,9 +13277,7 @@ vcvtaq_s32_f32 (float32x4_t __a) __extension__ static __inline uint32x4_t __attribute__ ((__always_inline__)) vcvtaq_u32_f32 (float32x4_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x4_t) __builtin_aarch64_lrounduv4sfv4si (__a); + return __builtin_aarch64_lrounduv4sfv4si_us (__a); } __extension__ static __inline int64x2_t __attribute__ ((__always_inline__)) @@ -13299,9 +13289,7 @@ vcvtaq_s64_f64 (float64x2_t __a) __extension__ static __inline uint64x2_t __attribute__ ((__always_inline__)) vcvtaq_u64_f64 (float64x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint64x2_t) __builtin_aarch64_lrounduv2dfv2di (__a); + return __builtin_aarch64_lrounduv2dfv2di_us (__a); } /* vcvtm */ @@ -13315,7 +13303,7 @@ vcvtmd_s64_f64 (float64_t __a) __extension__ static __inline uint64_t __attribute__ ((__always_inline__)) vcvtmd_u64_f64 (float64_t __a) { - return __builtin_aarch64_lfloorudfdi (__a); + return __builtin_aarch64_lfloorudfdi_us (__a); } __extension__ static __inline int32_t __attribute__ ((__always_inline__)) @@ -13327,7 +13315,7 @@ vcvtms_s32_f32 (float32_t __a) __extension__ static __inline uint32_t __attribute__ ((__always_inline__)) vcvtms_u32_f32 (float32_t __a) { - return __builtin_aarch64_lfloorusfsi (__a); + return __builtin_aarch64_lfloorusfsi_us (__a); } __extension__ static __inline int32x2_t __attribute__ ((__always_inline__)) @@ -13339,9 +13327,7 @@ vcvtm_s32_f32 (float32x2_t __a) __extension__ static __inline uint32x2_t __attribute__ ((__always_inline__)) vcvtm_u32_f32 (float32x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x2_t) __builtin_aarch64_lflooruv2sfv2si (__a); + return __builtin_aarch64_lflooruv2sfv2si_us (__a); } __extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) @@ -13353,9 +13339,7 @@ vcvtmq_s32_f32 (float32x4_t __a) __extension__ static __inline uint32x4_t __attribute__ ((__always_inline__)) vcvtmq_u32_f32 (float32x4_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x4_t) __builtin_aarch64_lflooruv4sfv4si (__a); + return __builtin_aarch64_lflooruv4sfv4si_us (__a); } __extension__ static __inline int64x2_t __attribute__ ((__always_inline__)) @@ -13367,9 +13351,7 @@ vcvtmq_s64_f64 (float64x2_t __a) __extension__ static __inline uint64x2_t __attribute__ ((__always_inline__)) vcvtmq_u64_f64 (float64x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint64x2_t) __builtin_aarch64_lflooruv2dfv2di (__a); + return __builtin_aarch64_lflooruv2dfv2di_us (__a); } /* vcvtn */ @@ -13383,7 +13365,7 @@ vcvtnd_s64_f64 (float64_t __a) __extension__ static __inline uint64_t __attribute__ ((__always_inline__)) vcvtnd_u64_f64 (float64_t __a) { - return __builtin_aarch64_lfrintnudfdi (__a); + return __builtin_aarch64_lfrintnudfdi_us (__a); } __extension__ static __inline int32_t __attribute__ ((__always_inline__)) @@ -13395,7 +13377,7 @@ vcvtns_s32_f32 (float32_t __a) __extension__ static __inline uint32_t __attribute__ ((__always_inline__)) vcvtns_u32_f32 (float32_t __a) { - return __builtin_aarch64_lfrintnusfsi (__a); + return __builtin_aarch64_lfrintnusfsi_us (__a); } __extension__ static __inline int32x2_t __attribute__ ((__always_inline__)) @@ -13407,9 +13389,7 @@ vcvtn_s32_f32 (float32x2_t __a) __extension__ static __inline uint32x2_t __attribute__ ((__always_inline__)) vcvtn_u32_f32 (float32x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x2_t) __builtin_aarch64_lfrintnuv2sfv2si (__a); + return __builtin_aarch64_lfrintnuv2sfv2si_us (__a); } __extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) @@ -13421,9 +13401,7 @@ vcvtnq_s32_f32 (float32x4_t __a) __extension__ static __inline uint32x4_t __attribute__ ((__always_inline__)) vcvtnq_u32_f32 (float32x4_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x4_t) __builtin_aarch64_lfrintnuv4sfv4si (__a); + return __builtin_aarch64_lfrintnuv4sfv4si_us (__a); } __extension__ static __inline int64x2_t __attribute__ ((__always_inline__)) @@ -13435,9 +13413,7 @@ vcvtnq_s64_f64 (float64x2_t __a) __extension__ static __inline uint64x2_t __attribute__ ((__always_inline__)) vcvtnq_u64_f64 (float64x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint64x2_t) __builtin_aarch64_lfrintnuv2dfv2di (__a); + return __builtin_aarch64_lfrintnuv2dfv2di_us (__a); } /* vcvtp */ @@ -13451,7 +13427,7 @@ vcvtpd_s64_f64 (float64_t __a) __extension__ static __inline uint64_t __attribute__ ((__always_inline__)) vcvtpd_u64_f64 (float64_t __a) { - return __builtin_aarch64_lceiludfdi (__a); + return __builtin_aarch64_lceiludfdi_us (__a); } __extension__ static __inline int32_t __attribute__ ((__always_inline__)) @@ -13463,7 +13439,7 @@ vcvtps_s32_f32 (float32_t __a) __extension__ static __inline uint32_t __attribute__ ((__always_inline__)) vcvtps_u32_f32 (float32_t __a) { - return __builtin_aarch64_lceilusfsi (__a); + return __builtin_aarch64_lceilusfsi_us (__a); } __extension__ static __inline int32x2_t __attribute__ ((__always_inline__)) @@ -13475,9 +13451,7 @@ vcvtp_s32_f32 (float32x2_t __a) __extension__ static __inline uint32x2_t __attribute__ ((__always_inline__)) vcvtp_u32_f32 (float32x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x2_t) __builtin_aarch64_lceiluv2sfv2si (__a); + return __builtin_aarch64_lceiluv2sfv2si_us (__a); } __extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) @@ -13489,9 +13463,7 @@ vcvtpq_s32_f32 (float32x4_t __a) __extension__ static __inline uint32x4_t __attribute__ ((__always_inline__)) vcvtpq_u32_f32 (float32x4_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint32x4_t) __builtin_aarch64_lceiluv4sfv4si (__a); + return __builtin_aarch64_lceiluv4sfv4si_us (__a); } __extension__ static __inline int64x2_t __attribute__ ((__always_inline__)) @@ -13503,9 +13475,7 @@ vcvtpq_s64_f64 (float64x2_t __a) __extension__ static __inline uint64x2_t __attribute__ ((__always_inline__)) vcvtpq_u64_f64 (float64x2_t __a) { - /* TODO: This cast should go away when builtins have - their correct types. */ - return (uint64x2_t) __builtin_aarch64_lceiluv2dfv2di (__a); + return __builtin_aarch64_lceiluv2dfv2di_us (__a); } /* vdup_n */ -- cgit v1.1