Handle vector boolean types when calculating the SLP unroll factor
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / vcond_10.c
blob76babbd554b920f0118a8fa50428658c31db49ec
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -march=armv8-a+sve" } */
4 #include <stdint.h>
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) \
9 { \
10 for (int i = 0; i < n; i += 2) \
11 { \
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; \
14 } \
17 #define FOR_EACH_TYPE(T) \
18 T (int8_t) \
19 T (uint8_t) \
20 T (int16_t) \
21 T (uint16_t) \
22 T (int32_t) \
23 T (uint32_t) \
24 T (int64_t) \
25 T (uint64_t) \
26 T (_Float16) \
27 T (float) \
28 T (double)
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 } } */