[AArch64][SVE] Remove unnecessary PTRUEs from integer arithmetic
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / pred_elim_2.c
blobed9c7007d2ed2779d5f97e18facf8482dc62b8cf
1 /* { dg-options "-O2 -ftree-vectorize" } */
3 #include <stdint.h>
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; \
13 #define TEST_TYPE(TYPE) \
14 TEST_OP (shl, TYPE, << 6) \
15 TEST_OP (shr, TYPE, >> 6) \
16 TEST_OP (mult, TYPE, * 0x2b)
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)
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} } } */