Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/pr110449.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -mcpu=neoverse-n2 --param aarch64-vect-unroll-limit=2" } */
3 /* { dg-final { scan-assembler {, #?8.0e\+0} } } */
4 /* { dg-final { scan-assembler-not {\tmov\tv} } } */
5
6 /* Insert the induction IV updates before the exit condition, rather than
7 at the start of the loop body.
8
9 before (suggested_unroll_factor=2):
10 fmov s30, 8.0e+0
11 fmov s31, 4.0e+0
12 dup v27.4s, v30.s[0]
13 dup v28.4s, v31.s[0]
14 .L6:
15 mov v30.16b, v31.16b
16 fadd v31.4s, v31.4s, v27.4s
17 fadd v29.4s, v30.4s, v28.4s
18 stp q30, q29, [x0]
19 add x0, x0, 32
20 cmp x1, x0
21 bne .L6
22
23 after:
24 fmov s31, 8.0e+0
25 fmov s29, 4.0e+0
26 dup v31.4s, v31.s[0]
27 dup v29.4s, v29.s[0]
28 .L2:
29 fadd v30.4s, v0.4s, v29.4s
30 stp q0, q30, [x0], 32
31 fadd v0.4s, v0.4s, v31.4s
32 cmp x1, x0
33 bne .L2 */
34
35 void
36 foo2 (float *arr, float freq, float step)
37 {
38 for (int i = 0; i < 1024; i++)
39 {
40 arr[i] = freq;
41 freq += step;
42 }
43 }