1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
3
4 #include "vcond_6.c"
5
6 #define N 401
7
8 #define RUN_LOOP(TYPE, BINOP) \
9 { \
10 TYPE dest[N], src[N], a[N], b[N], c[N], d[N]; \
11 for (int i = 0; i < N; ++i) \
12 { \
13 src[i] = i * i; \
14 a[i] = i % 5 < 3 ? __builtin_nan("") : i; \
15 b[i] = i % 7 < 4 ? __builtin_nan("") : i; \
16 c[i] = i % 9 < 5 ? __builtin_nan("") : i; \
17 d[i] = i % 11 < 6 ? __builtin_nan("") : i; \
18 asm volatile ("" ::: "memory"); \
19 } \
20 test_##TYPE##_##BINOP (dest, src, a, b, c, d, 100, N); \
21 for (int i = 0; i < N; ++i) \
22 { \
23 int res = BINOP (__builtin_isunordered (a[i], b[i]), \
24 __builtin_isunordered (c[i], d[i])); \
25 if (dest[i] != (res ? src[i] : 100.0)) \
26 __builtin_abort (); \
27 } \
28 }
29
30 int __attribute__ ((optimize (1)))
main(void)31 main (void)
32 {
33 TEST_ALL (RUN_LOOP)
34 return 0;
35 }
36