Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/spill-11.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-msave-restore -march=rv32gc_zve64d -mabi=ilp32 -msave-restore -fno-schedule-insns -fno-schedule-insns2 -O3" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4 #include "riscv_vector.h"
5
6 void fn2 (float a1, float a2, float a3, float a4,
7 float a5, float a6, float a7, float a8);
8 void fn3 (char*);
9
10 /*
11 ** stack_save_restore_2:
12 ** call\tt0,__riscv_save_0
13 ** csrr\tt0,vlenb
14 ** sub\tsp,sp,t0
15 ** vs1r.v\tv1,0\(sp\)
16 ** ...
17 ** csrr\tt0,vlenb
18 ** slli\tt1,t0,2
19 ** sub\tt1,t1,t0
20 ** add\tsp,sp,t1
21 ** li\tt0,8192
22 ** addi\tt0,t0,-192
23 ** add\tsp,sp,t0
24 ** ...
25 ** vl1re64.v\tv1,0\(sp\)
26 ** add\tsp,sp,t0
27 ** tail\t__riscv_restore_0
28 */
29 int stack_save_restore_2 (float a1, float a2, float a3, float a4,
30 float a5, float a6, float a7, float a8,
31 vuint8m1_t data, uint8_t *base)
32 {
33 char d[8000];
34 float f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13;
35 asm volatile ("nop"
36 : "=f" (f1), "=f" (f2), "=f" (f3), "=f" (f4), "=f" (f5), "=f" (f6),
37 "=f" (f7), "=f" (f8), "=f" (f9), "=f" (f10), "=f" (f11),
38 "=f" (f12), "=f" (f13)
39 :
40 :);
41 asm volatile ("nop"
42 :
43 : "f" (f1), "f" (f2), "f" (f3), "f" (f4), "f" (f5), "f" (f6),
44 "f" (f7), "f" (f8), "f" (f9), "f" (f10), "f" (f11),
45 "f" (f12), "f" (f13)
46 :);
47 vuint8m8_t v0, v8, v16, v24;
48 asm volatile ("nop"
49 : "=vr" (v0), "=vr" (v8), "=vr" (v16), "=vr" (v24)
50 :
51 :);
52 asm volatile ("nop"
53 :
54 : "vr" (v0), "vr" (v8), "vr" (v16), "vr" (v24)
55 :);
56 *(vuint8m1_t *)base = data;
57 fn2 (a1, a2, a3, a4, a5, a6, a7, a8);
58 fn3(d);
59 return 0;
60 }