Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / strided_store_4.c
blob48d83a3e6c3cadc543aa298f744dea7881721ab5
1 /* { dg-do assemble { target aarch64_asm_sve_ok } } */
2 /* { dg-options "-O2 -ftree-vectorize --save-temps" } */
4 #include <stdint.h>
6 #define TEST_LOOP(DATA_TYPE, NAME, SCALE) \
7 void __attribute__ ((noinline, noclone)) \
8 f_##DATA_TYPE##_##NAME (DATA_TYPE *restrict dest, \
9 DATA_TYPE *restrict src, int n) \
10 { \
11 for (int i = 0; i < n; ++i) \
12 dest[i * SCALE] = src[i] + 1; \
15 #define TEST_TYPE(T, DATA_TYPE) \
16 T (DATA_TYPE, 5, 5) \
17 T (DATA_TYPE, 7, 7) \
18 T (DATA_TYPE, 11, 11) \
19 T (DATA_TYPE, 200, 200) \
20 T (DATA_TYPE, m100, -100)
22 #define TEST_ALL(T) \
23 TEST_TYPE (T, int32_t) \
24 TEST_TYPE (T, uint32_t) \
25 TEST_TYPE (T, float) \
26 TEST_TYPE (T, int64_t) \
27 TEST_TYPE (T, uint64_t) \
28 TEST_TYPE (T, double)
30 TEST_ALL (TEST_LOOP)
32 /* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s, p[0-7], \[x[0-9]+, z[0-9]+.s, sxtw 2\]\n} 15 } } */
33 /* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d, p[0-7], \[x[0-9]+, z[0-9]+.d, lsl 3\]\n} 15 } } */