Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve2/whilewr_2.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -fno-tree-loop-distribute-patterns" } */
3 /* { dg-require-effective-target lp64 } */
4
5 #include <stdint.h>
6
7 #define TEST_LOOP(TYPE) \
8 void \
9 test_##TYPE (TYPE *dst1, TYPE *dst2, TYPE *dst3, int n) \
10 { \
11 for (int i = 0; i < n; ++i) \
12 { \
13 dst1[i] = 1; \
14 dst2[i] = 2; \
15 dst3[i] = 3; \
16 } \
17 }
18
19 TEST_LOOP (int8_t);
20 TEST_LOOP (int16_t);
21 TEST_LOOP (int32_t);
22 TEST_LOOP (int64_t);
23
24 /* { dg-final { scan-assembler-times {\twhilewr\t} 12 } } */
25 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.b, x0, x1\n} 1 } } */
26 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.b, x0, x2\n} 1 } } */
27 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.b, x1, x2\n} 1 } } */
28 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.h, x0, x1\n} 1 } } */
29 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.h, x0, x2\n} 1 } } */
30 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.h, x1, x2\n} 1 } } */
31 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.s, x0, x1\n} 1 } } */
32 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.s, x0, x2\n} 1 } } */
33 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.s, x1, x2\n} 1 } } */
34 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.d, x0, x1\n} 1 } } */
35 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.d, x0, x2\n} 1 } } */
36 /* { dg-final { scan-assembler-times {\twhilewr\tp[0-9]+\.d, x1, x2\n} 1 } } */
37 /* { dg-final { scan-assembler-not {\twhilerw\t} } } */