Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/abi-callee-saved-2-save-restore.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -march=rv64gcv_zfh -mabi=lp64d -msave-restore" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4
5 #include "riscv_vector.h"
6
7 void bar1 (vint8m1_t a);
8 void bar2 ();
9
10 /*
11 ** foo1:
12 ** tail\tbar1
13 */
14 void
15 foo1 (vint8m1_t a)
16 {
17 bar1 (a);
18 }
19
20 /*
21 ** foo2:
22 ** call\tt0,__riscv_save_0
23 ** csrr\tt0,vlenb
24 ** sub\tsp,sp,t0
25 ** vs1r\.v\tv1,0\(sp\)
26 ** sub\tsp,sp,t0
27 ** vs1r\.v\tv2,0\(sp\)
28 ** sub\tsp,sp,t0
29 ** vs1r\.v\tv3,0\(sp\)
30 ** sub\tsp,sp,t0
31 ** vs1r\.v\tv4,0\(sp\)
32 ** sub\tsp,sp,t0
33 ** vs1r\.v\tv5,0\(sp\)
34 ** sub\tsp,sp,t0
35 ** vs1r\.v\tv6,0\(sp\)
36 ** sub\tsp,sp,t0
37 ** vs1r\.v\tv7,0\(sp\)
38 ** sub\tsp,sp,t0
39 ** vs1r\.v\tv24,0\(sp\)
40 ** sub\tsp,sp,t0
41 ** vs1r\.v\tv25,0\(sp\)
42 ** sub\tsp,sp,t0
43 ** vs1r\.v\tv26,0\(sp\)
44 ** sub\tsp,sp,t0
45 ** vs1r\.v\tv27,0\(sp\)
46 ** sub\tsp,sp,t0
47 ** vs1r\.v\tv28,0\(sp\)
48 ** sub\tsp,sp,t0
49 ** vs1r\.v\tv29,0\(sp\)
50 ** sub\tsp,sp,t0
51 ** vs1r\.v\tv30,0\(sp\)
52 ** sub\tsp,sp,t0
53 ** vs1r\.v\tv31,0\(sp\)
54 ** call\tbar2(?:@plt)?
55 ** csrr\tt0,vlenb
56 ** vl1re64\.v\tv31,0\(sp\)
57 ** add\tsp,sp,t0
58 ** vl1re64\.v\tv30,0\(sp\)
59 ** add\tsp,sp,t0
60 ** vl1re64\.v\tv29,0\(sp\)
61 ** add\tsp,sp,t0
62 ** vl1re64\.v\tv28,0\(sp\)
63 ** add\tsp,sp,t0
64 ** vl1re64\.v\tv27,0\(sp\)
65 ** add\tsp,sp,t0
66 ** vl1re64\.v\tv26,0\(sp\)
67 ** add\tsp,sp,t0
68 ** vl1re64\.v\tv25,0\(sp\)
69 ** add\tsp,sp,t0
70 ** vl1re64\.v\tv24,0\(sp\)
71 ** add\tsp,sp,t0
72 ** vl1re64\.v\tv7,0\(sp\)
73 ** add\tsp,sp,t0
74 ** vl1re64\.v\tv6,0\(sp\)
75 ** add\tsp,sp,t0
76 ** vl1re64\.v\tv5,0\(sp\)
77 ** add\tsp,sp,t0
78 ** vl1re64\.v\tv4,0\(sp\)
79 ** add\tsp,sp,t0
80 ** vl1re64\.v\tv3,0\(sp\)
81 ** add\tsp,sp,t0
82 ** vl1re64\.v\tv2,0\(sp\)
83 ** add\tsp,sp,t0
84 ** vl1re64\.v\tv1,0\(sp\)
85 ** add\tsp,sp,t0
86 ** tail\t__riscv_restore_0
87
88 */
89 void
90 foo2 (vint8m1_t a)
91 {
92 bar2 ();
93 }
94
95 /*
96 ** foo3:
97 ** call\tt0,__riscv_save_0
98 ** vl1re8\.v\tv8,0\(a0\)
99 ** call\tbar1(?:@plt)?
100 ** call\tbar2(?:@plt)?
101 ** tail\t__riscv_restore_0
102 */
103 void
104 foo3 (vint8m1_t *a)
105 {
106 bar1 (*a);
107 bar2 ();
108 }