1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O" } */
3 /* { dg-options "-O -msve-vector-bits=256" { target aarch64_sve256_hw } } */
7 #define NUM_ELEMS(X) (sizeof (X) / sizeof (X[0]))
9 #define TEST_VCOND_VAR(TYPE, COND, SUFFIX) \
12 for (int i = 0; i < NUM_ELEMS (x); ++i) \
15 b[i] = NUM_ELEMS (x) - 2 - i; \
19 TYPE r = vcond_##TYPE##_##SUFFIX (x, y, a, b); \
20 for (int i = 0; i < NUM_ELEMS (x); ++i) \
21 if (r[i] != (a[i] COND b[i] ? x[i] : y[i])) \
25 #define TEST_VCOND_IMM(TYPE, COND, IMM, SUFFIX) \
28 for (int i = 0; i < NUM_ELEMS (x); ++i) \
34 TYPE r = vcond_imm_##TYPE##_##SUFFIX (x, y, a); \
35 for (int i = 0; i < NUM_ELEMS (x); ++i) \
36 if (r[i] != (a[i] COND IMM ? x[i] : y[i])) \
41 int main (int argc, char **argv)
43 TEST_VAR_ALL (TEST_VCOND_VAR)
44 TEST_IMM_ALL (TEST_VCOND_IMM)