1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -march=armv8-a+sve" } */
6 #define DEF_LOOP(TYPE) \
7 void __attribute__ ((noinline, noclone)) \
8 test_##TYPE (int *restrict a, TYPE *restrict b, int a1, int a2, \
9 int a3, int a4, int n) \
11 for (int i = 0; i < n; i += 2) \
13 a[i] = a[i] >= 1 & b[i] != 3 ? a1 : a2; \
14 a[i + 1] = a[i + 1] >= 1 & b[i + 1] != 3 ? a3 : a4; \
18 #define FOR_EACH_TYPE(T) \
27 FOR_EACH_TYPE (DEF_LOOP
)
29 /* { dg-final { scan-assembler-times {\tld1b\t} 2 } } */
30 /* { dg-final { scan-assembler-times {\tld1h\t} 2 } } */
31 /* 4 for each 8-bit function, 2 for each 16-bit function, 1 for
32 each 64-bit function. */
33 /* { dg-final { scan-assembler-times {\tld1w\t} 15 } } */
34 /* 3 64-bit functions * 2 64-bit vectors per 32-bit vector. */
35 /* { dg-final { scan-assembler-times {\tld1d\t} 6 } } */
36 /* { dg-final { scan-assembler-times {\tsel\tz[0-9]} 15 } } */