Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / mask_struct_store_4.c
blob59e9ee49c4a214b731ed1975da0dcfa46c059f8b
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -ffast-math" } */
4 #include <stdint.h>
6 #define TEST_LOOP(NAME, OUTTYPE, INTYPE, MASKTYPE) \
7 void __attribute__ ((noinline, noclone)) \
8 NAME##_2 (OUTTYPE *__restrict dest, INTYPE *__restrict src, \
9 MASKTYPE *__restrict cond, int n) \
10 { \
11 for (int i = 0; i < n; ++i) \
12 { \
13 if (cond[i] < 8) \
14 dest[i * 2] = src[i]; \
15 if (cond[i] > 2) \
16 dest[i * 2 + 1] = src[i]; \
17 } \
20 #define TEST2(NAME, OUTTYPE, INTYPE) \
21 TEST_LOOP (NAME##_i8, OUTTYPE, INTYPE, int8_t) \
22 TEST_LOOP (NAME##_i16, OUTTYPE, INTYPE, uint16_t) \
23 TEST_LOOP (NAME##_f32, OUTTYPE, INTYPE, float) \
24 TEST_LOOP (NAME##_f64, OUTTYPE, INTYPE, double)
26 #define TEST1(NAME, OUTTYPE) \
27 TEST2 (NAME##_i8, OUTTYPE, int8_t) \
28 TEST2 (NAME##_i16, OUTTYPE, uint16_t) \
29 TEST2 (NAME##_i32, OUTTYPE, int32_t) \
30 TEST2 (NAME##_i64, OUTTYPE, uint64_t)
32 #define TEST(NAME) \
33 TEST1 (NAME##_i8, int8_t) \
34 TEST1 (NAME##_i16, uint16_t) \
35 TEST1 (NAME##_i32, int32_t) \
36 TEST1 (NAME##_i64, uint64_t) \
37 TEST2 (NAME##_f16_f16, _Float16, _Float16) \
38 TEST2 (NAME##_f32_f32, float, float) \
39 TEST2 (NAME##_f64_f64, double, double)
41 TEST (test)
43 /* { dg-final { scan-assembler-not {\tst2b\t.z[0-9]} } } */
44 /* { dg-final { scan-assembler-not {\tst2h\t.z[0-9]} } } */
45 /* { dg-final { scan-assembler-not {\tst2w\t.z[0-9]} } } */
46 /* { dg-final { scan-assembler-not {\tst2d\t.z[0-9]} } } */