[AArch64] SVE tests
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / abs_2.c
blob3b75369c8ad7565c02fc1e7c8f9d66a6086ecabe
1 /* { dg-do run } */
2 /* { dg-options "-O2 --save-temps" } */
4 #include "arm_neon.h"
6 extern void abort (void);
8 int
9 main (int argc, char **argv)
11 uint64_t got;
12 uint64_t exp = UINT64_C (0x0001000100003b9b);
13 int16x4_t val1 = vcreate_s16 (0x7fff800080007ffful);
14 int16x4_t val2 = vcreate_s16 (0x80007fff80004464ul);
15 int16x4_t result;
16 /* Avoid folding away the sub early. */
17 asm volatile ("mov %d0, %0.d[0]":"+w"(val1));
19 /* Expect "result" = 0001000100003b9b. */
20 result = vabs_s16 (vsub_s16 (val1, val2));
22 got = vget_lane_u64 (vreinterpret_u64_s16 (result), 0);
23 if (exp != got)
24 abort ();
26 return 0;
30 /* { dg-final { scan-assembler-not "sabd" } } */