Hi all,This patch implements the vbsl_f64 intrinsic and adds an execution test for it.
Not much else to say about it.
Tested aarch64-none-elf. Ok for trunk? 2014-07-16 Kyrylo Tkachov <kyrylo.tkac...@arm.com> * config/aarch64/arm_neon.h (vbsl_f64): New intrinsic. 2014-07-16 Kyrylo Tkachov <kyrylo.tkac...@arm.com> * gcc.target/aarch64/simd/vbsl_f64.c: New test.
commit 6dcaf395c1e2b3a8a67e846edb2376225c93e1bf Author: Kyrylo Tkachov <kyrylo.tkac...@arm.com> Date: Tue Jun 24 14:55:19 2014 +0100 [AArch64] Implement vbsl_f64 intrinsic diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index f413d37..2aaf227 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -13657,6 +13657,13 @@ vbsl_f32 (uint32x2_t __a, float32x2_t __b, float32x2_t __c) return __builtin_aarch64_simd_bslv2sf_suss (__a, __b, __c); } +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__)) +vbsl_f64 (uint64x1_t __a, float64x1_t __b, float64x1_t __c) +{ + return (float64x1_t) + { __builtin_aarch64_simd_bsldf_suss (__a[0], __b[0], __c[0]) }; +} + __extension__ static __inline poly8x8_t __attribute__ ((__always_inline__)) vbsl_p8 (uint8x8_t __a, poly8x8_t __b, poly8x8_t __c) { diff --git a/gcc/testsuite/gcc.target/aarch64/simd/vbsl_f64.c b/gcc/testsuite/gcc.target/aarch64/simd/vbsl_f64.c new file mode 100644 index 0000000..537c5bd --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/vbsl_f64.c @@ -0,0 +1,32 @@ +/* Test the vbsl_f64 AArch64 SIMD intrinsic. */ + +/* { dg-do run } */ +/* { dg-options "-O3" } */ + +#include "arm_neon.h" + +extern void abort (void); + +int +main (void) +{ + float64x1_t expected, actual; + float64_t expected_scalar, actual_scalar; + float64x1_t arg1, arg2; + uint64_t mask = 0xf0fc00fbf000fa0fULL; + uint64_t arg1_uint = 0xdeadbeefbada9832ULL; + uint64_t arg2_uint = 0xcafe3254deed7111ULL; + + arg1 = vcreate_f64 (arg1_uint); + arg2 = vcreate_f64 (arg2_uint); + expected = vcreate_f64 ((arg1_uint & mask) | (arg2_uint & ~mask)); + actual = vbsl_f64 (vcreate_u64 (mask), arg1, arg2); + + expected_scalar = vget_lane_f64 (expected, 0); + actual_scalar = vget_lane_f64 (actual, 0); + + if (expected_scalar != actual_scalar) + abort (); + + return 0; +}