Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/pred_elim_2.c

raw
1 /* { dg-options "-O2 -ftree-vectorize" } */
2
3 #include <stdint.h>
4
5 #define TEST_OP(NAME, TYPE, OP) \
6 void \
7 NAME##_##TYPE (TYPE *restrict a, TYPE *restrict b, int n) \
8 { \
9 for (int i = 0; i < n; ++i) \
10 a[i] = b[i] OP; \
11 }
12
13 #define TEST_TYPE(TYPE) \
14 TEST_OP (shl, TYPE, << 6) \
15 TEST_OP (shr, TYPE, >> 6) \
16 TEST_OP (mult, TYPE, * 0x2b)
17
18 TEST_TYPE (int8_t)
19 TEST_TYPE (int16_t)
20 TEST_TYPE (int32_t)
21 TEST_TYPE (int64_t)
22 TEST_TYPE (uint8_t)
23 TEST_TYPE (uint16_t)
24 TEST_TYPE (uint32_t)
25 TEST_TYPE (uint64_t)
26
27 /* { dg-final { scan-assembler-times {\tlsl\t} 8 } } */
28 /* { dg-final { scan-assembler-times {\tlsr\t} 4 } } */
29 /* { dg-final { scan-assembler-times {\tasr\t} 4 } } */
30 /* { dg-final { scan-assembler-times {\tmul\t} 8 } } */
31 /* { dg-final { scan-assembler-not {\tptrue\t} } } */