From 6f2c6623295765a721f515a0e4fcc718b61b16e0 Mon Sep 17 00:00:00 2001 From: Jiong Wang Date: Tue, 17 May 2016 16:41:18 +0000 Subject: [PATCH] [AArch64, 4/4] Reimplement vmvn* intrinscis, remove inline assembly gcc/ * config/aarch64/arm_neon.h (vmvn_s8): Reimplement using C operator. Remove inline assembly. (vmvn_s16): Likewise. (vmvn_s32): Likewise. (vmvn_u8): Likewise. (vmvn_u16): Likewise. (vmvn_u32): Likewise. (vmvnq_s8): Likewise. (vmvnq_s16): Likewise. (vmvnq_s32): Likewise. (vmvnq_u8): Likewise. (vmvnq_u16): Likewise. (vmvnq_u32): Likewise. (vmvn_p8): Likewise. (vmvnq_p16): Likewise. From-SVN: r236334 --- gcc/ChangeLog | 18 +++ gcc/config/aarch64/arm_neon.h | 241 ++++++++++++---------------------- 2 files changed, 104 insertions(+), 155 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2030c85be73..b1d1bc022bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2016-05-17 Jiong Wang + + * config/aarch64/arm_neon.h (vmvn_s8): Reimplement using C operator. + Remove inline assembly. + (vmvn_s16): Likewise. + (vmvn_s32): Likewise. + (vmvn_u8): Likewise. + (vmvn_u16): Likewise. + (vmvn_u32): Likewise. + (vmvnq_s8): Likewise. + (vmvnq_s16): Likewise. + (vmvnq_s32): Likewise. + (vmvnq_u8): Likewise. + (vmvnq_u16): Likewise. + (vmvnq_u32): Likewise. + (vmvn_p8): Likewise. + (vmvnq_p16): Likewise. + 2016-05-17 Jiong Wang * config/aarch64/aarch64-simd.md (vmul_n_f32): Remove inline assembly. diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 84931aeec2d..e563e3d2f77 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -8388,161 +8388,6 @@ vmull_u32 (uint32x2_t a, uint32x2_t b) return result; } -__extension__ static __inline poly8x8_t __attribute__ ((__always_inline__)) -vmvn_p8 (poly8x8_t a) -{ - poly8x8_t result; - __asm__ ("mvn %0.8b,%1.8b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline int8x8_t __attribute__ ((__always_inline__)) -vmvn_s8 (int8x8_t a) -{ - int8x8_t result; - __asm__ ("mvn %0.8b,%1.8b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline int16x4_t __attribute__ ((__always_inline__)) -vmvn_s16 (int16x4_t a) -{ - int16x4_t result; - __asm__ ("mvn %0.8b,%1.8b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline int32x2_t __attribute__ ((__always_inline__)) -vmvn_s32 (int32x2_t a) -{ - int32x2_t result; - __asm__ ("mvn %0.8b,%1.8b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__)) -vmvn_u8 (uint8x8_t a) -{ - uint8x8_t result; - __asm__ ("mvn %0.8b,%1.8b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__)) -vmvn_u16 (uint16x4_t a) -{ - uint16x4_t result; - __asm__ ("mvn %0.8b,%1.8b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__)) -vmvn_u32 (uint32x2_t a) -{ - uint32x2_t result; - __asm__ ("mvn %0.8b,%1.8b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline poly8x16_t __attribute__ ((__always_inline__)) -vmvnq_p8 (poly8x16_t a) -{ - poly8x16_t result; - __asm__ ("mvn %0.16b,%1.16b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline int8x16_t __attribute__ ((__always_inline__)) -vmvnq_s8 (int8x16_t a) -{ - int8x16_t result; - __asm__ ("mvn %0.16b,%1.16b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline int16x8_t __attribute__ ((__always_inline__)) -vmvnq_s16 (int16x8_t a) -{ - int16x8_t result; - __asm__ ("mvn %0.16b,%1.16b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) -vmvnq_s32 (int32x4_t a) -{ - int32x4_t result; - __asm__ ("mvn %0.16b,%1.16b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__)) -vmvnq_u8 (uint8x16_t a) -{ - uint8x16_t result; - __asm__ ("mvn %0.16b,%1.16b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline uint16x8_t __attribute__ ((__always_inline__)) -vmvnq_u16 (uint16x8_t a) -{ - uint16x8_t result; - __asm__ ("mvn %0.16b,%1.16b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - -__extension__ static __inline uint32x4_t __attribute__ ((__always_inline__)) -vmvnq_u32 (uint32x4_t a) -{ - uint32x4_t result; - __asm__ ("mvn %0.16b,%1.16b" - : "=w"(result) - : "w"(a) - : /* No clobbers */); - return result; -} - - __extension__ static __inline int16x4_t __attribute__ ((__always_inline__)) vpadal_s8 (int16x4_t a, int8x8_t b) { @@ -18871,6 +18716,92 @@ vmulq_n_u32 (uint32x4_t __a, uint32_t __b) return __a * __b; } +/* vmvn */ + +__extension__ static __inline poly8x8_t __attribute__ ((__always_inline__)) +vmvn_p8 (poly8x8_t __a) +{ + return (poly8x8_t) ~((int8x8_t) __a); +} + +__extension__ static __inline int8x8_t __attribute__ ((__always_inline__)) +vmvn_s8 (int8x8_t __a) +{ + return ~__a; +} + +__extension__ static __inline int16x4_t __attribute__ ((__always_inline__)) +vmvn_s16 (int16x4_t __a) +{ + return ~__a; +} + +__extension__ static __inline int32x2_t __attribute__ ((__always_inline__)) +vmvn_s32 (int32x2_t __a) +{ + return ~__a; +} + +__extension__ static __inline uint8x8_t __attribute__ ((__always_inline__)) +vmvn_u8 (uint8x8_t __a) +{ + return ~__a; +} + +__extension__ static __inline uint16x4_t __attribute__ ((__always_inline__)) +vmvn_u16 (uint16x4_t __a) +{ + return ~__a; +} + +__extension__ static __inline uint32x2_t __attribute__ ((__always_inline__)) +vmvn_u32 (uint32x2_t __a) +{ + return ~__a; +} + +__extension__ static __inline poly8x16_t __attribute__ ((__always_inline__)) +vmvnq_p8 (poly8x16_t __a) +{ + return (poly8x16_t) ~((int8x16_t) __a); +} + +__extension__ static __inline int8x16_t __attribute__ ((__always_inline__)) +vmvnq_s8 (int8x16_t __a) +{ + return ~__a; +} + +__extension__ static __inline int16x8_t __attribute__ ((__always_inline__)) +vmvnq_s16 (int16x8_t __a) +{ + return ~__a; +} + +__extension__ static __inline int32x4_t __attribute__ ((__always_inline__)) +vmvnq_s32 (int32x4_t __a) +{ + return ~__a; +} + +__extension__ static __inline uint8x16_t __attribute__ ((__always_inline__)) +vmvnq_u8 (uint8x16_t __a) +{ + return ~__a; +} + +__extension__ static __inline uint16x8_t __attribute__ ((__always_inline__)) +vmvnq_u16 (uint16x8_t __a) +{ + return ~__a; +} + +__extension__ static __inline uint32x4_t __attribute__ ((__always_inline__)) +vmvnq_u32 (uint32x4_t __a) +{ + return ~__a; +} + /* vneg */ __extension__ static __inline float32x2_t __attribute__ ((__always_inline__)) -- 2.30.2