Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/pr114352-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gc -mabi=lp64 -O3 -fno-schedule-insns -fno-schedule-insns2" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4
5 /*
6 ** test_1:
7 ** beq\s+a3,\s*zero,\s*\.L[0-9]+
8 ** ...
9 ** bne\s+[atx][0-9]+,\s*[atx][0-9]+,\s*\.L[0-9]+
10 ** ...
11 ** ret
12 */
13 void
14 test_1 (int *a, int *b, int *out, unsigned count)
15 {
16 unsigned i;
17
18 for (i = 0; i < count; i++)
19 out[i] = a[i] + b[i];
20 }
21
22 /*
23 ** test_2:
24 ** ...
25 ** vsetvli\s+[atx][0-9]+,\s*[atx][0-9]+,\s*e32,\s*m1,\s*ta,\s*ma
26 ** ...
27 ** vadd\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+
28 ** ...
29 */
30 void
31 __attribute__((target("arch=+v")))
32 test_2 (int *a, int *b, int *out, unsigned count)
33 {
34 unsigned i;
35
36 for (i = 0; i < count; i++)
37 out[i] = a[i] + b[i];
38 }
39
40 /*
41 ** test_3:
42 ** beq\s+a3,\s*zero,\s*\.L[0-9]+
43 ** ...
44 ** bne\s+[atx][0-9]+,\s*[atx][0-9]+,\s*\.L[0-9]+
45 ** ...
46 ** ret
47 */
48 void
49 test_3 (int *a, int *b, int *out, unsigned count)
50 {
51 unsigned i;
52
53 for (i = 0; i < count; i++)
54 out[i] = a[i] + b[i];
55 }
56
57 /* { dg-final { scan-assembler ".attribute arch, \"rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0\"" } } */
58 /* { dg-final { scan-assembler ".option arch, rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_v1p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_zca1p0_zcd1p0_zve32f1p0_zve32x1p0_zve64d1p0_zve64f1p0_zve64x1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0" } } */