| 1 |
/* Test the vbsl_f64 AArch64 SIMD intrinsic. */ |
| 2 |
|
| 3 |
/* { dg-do run } */ |
| 4 |
/* { dg-options "-O3" } */ |
| 5 |
|
| 6 |
#include "arm_neon.h" |
| 7 |
|
| 8 |
extern void abort (void); |
| 9 |
|
| 10 |
int |
| 11 |
main (void) |
| 12 |
{ |
| 13 |
float64x1_t expected, actual; |
| 14 |
float64_t expected_scalar, actual_scalar; |
| 15 |
float64x1_t arg1, arg2; |
| 16 |
uint64_t mask = 0xf0fc00fbf000fa0fULL; |
| 17 |
uint64_t arg1_uint = 0xdeadbeefbada9832ULL; |
| 18 |
uint64_t arg2_uint = 0xcafe3254deed7111ULL; |
| 19 |
|
| 20 |
arg1 = vcreate_f64 (arg1_uint); |
| 21 |
arg2 = vcreate_f64 (arg2_uint); |
| 22 |
expected = vcreate_f64 ((arg1_uint & mask) | (arg2_uint & ~mask)); |
| 23 |
actual = vbsl_f64 (vcreate_u64 (mask), arg1, arg2); |
| 24 |
|
| 25 |
expected_scalar = vget_lane_f64 (expected, 0); |
| 26 |
actual_scalar = vget_lane_f64 (actual, 0); |
| 27 |
|
| 28 |
if (expected_scalar != actual_scalar) |
| 29 |
abort (); |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |