Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/cond_arith_1_run.c

raw
1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize --param aarch64-vect-compare-costs=0" } */
3
4 #include "cond_arith_1.c"
5
6 #define N 99
7
8 #undef TEST
9 #define TEST(TYPE, NAME, OP) \
10 { \
11 TYPE x[N], y[N], z[N], pred[N]; \
12 for (int i = 0; i < N; ++i) \
13 { \
14 y[i] = i * i; \
15 z[i] = ((i + 2) % 3) * (i + 1); \
16 pred[i] = i % 3; \
17 } \
18 test_##TYPE##_##NAME (x, y, z, pred, N); \
19 for (int i = 0; i < N; ++i) \
20 { \
21 TYPE expected = i % 3 != 1 ? y[i] OP z[i] : y[i]; \
22 if (x[i] != expected) \
23 __builtin_abort (); \
24 asm volatile ("" ::: "memory"); \
25 } \
26 }
27
28 int
29 main (void)
30 {
31 TEST_ALL
32 return 0;
33 }