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 (TYPE *a, TYPE a1, TYPE a2, TYPE a3, TYPE a4, int n) \
10 for (int i = 0; i < n; i += 2) \
12 a[i] = a[i] >= 1 && a[i] != 3 ? a1 : a2; \
13 a[i + 1] = a[i + 1] >= 1 && a[i + 1] != 3 ? a3 : a4; \
17 #define FOR_EACH_TYPE(T) \
30 FOR_EACH_TYPE (DEF_LOOP
)
32 /* { dg-final { scan-assembler-times {\tld1b\t} 2 } } */
33 /* { dg-final { scan-assembler-times {\tld1h\t} 3 } } */
34 /* { dg-final { scan-assembler-times {\tld1w\t} 3 } } */
35 /* { dg-final { scan-assembler-times {\tld1d\t} 3 } } */
36 /* { dg-final { scan-assembler-times {\tsel\tz[0-9]} 11 } } */