File tree Expand file tree Collapse file tree 2 files changed +84
-0
lines changed
compiler-rt/lib/builtins/riscv Expand file tree Collapse file tree 2 files changed +84
-0
lines changed Original file line number Diff line number Diff line change 2222
2323#if __riscv_xlen == 32
2424
25+ #ifndef __riscv_32e
26+
2527 .globl __riscv_restore_12
2628 .type __riscv_restore_12,@function
2729__riscv_restore_12:
@@ -86,8 +88,29 @@ __riscv_restore_0:
8688 addi sp, sp, 16
8789 ret
8890
91+ #else
92+
93+ .globl __riscv_restore_2
94+ .type __riscv_restore_2,@function
95+ .globl __riscv_restore_1
96+ .type __riscv_restore_1,@function
97+ .globl __riscv_restore_0
98+ .type __riscv_restore_0,@function
99+ __riscv_restore_2:
100+ __riscv_restore_1:
101+ __riscv_restore_0:
102+ lw s1, 0 (sp)
103+ lw s0, 4 (sp)
104+ lw ra, 8 (sp)
105+ addi sp, sp, 12
106+ ret
107+
108+ #endif
109+
89110#elif __riscv_xlen == 64
90111
112+ #ifndef __riscv_64e
113+
91114 .globl __riscv_restore_12
92115 .type __riscv_restore_12,@function
93116__riscv_restore_12:
@@ -161,6 +184,25 @@ __riscv_restore_0:
161184 addi sp, sp, 16
162185 ret
163186
187+ #else
188+
189+ .globl __riscv_restore_2
190+ .type __riscv_restore_2,@function
191+ .globl __riscv_restore_1
192+ .type __riscv_restore_1,@function
193+ .globl __riscv_restore_0
194+ .type __riscv_restore_0,@function
195+ __riscv_restore_2:
196+ __riscv_restore_1:
197+ __riscv_restore_0:
198+ ld s1, 0 (sp)
199+ ld s0, 8 (sp)
200+ ld ra, 16 (sp)
201+ addi sp, sp, 24
202+ ret
203+
204+ #endif
205+
164206#else
165207# error "xlen must be 32 or 64 for save-restore implementation
166208#endif
Original file line number Diff line number Diff line change 1818
1919#if __riscv_xlen == 32
2020
21+ #ifndef __riscv_32e
22+
2123 .globl __riscv_save_12
2224 .type __riscv_save_12,@function
2325__riscv_save_12:
@@ -92,8 +94,29 @@ __riscv_save_0:
9294 sw ra, 12 (sp)
9395 jr t0
9496
97+ #else
98+
99+ .globl __riscv_save_2
100+ .type __riscv_save_2,@function
101+ .globl __riscv_save_1
102+ .type __riscv_save_1,@function
103+ .globl __riscv_save_0
104+ .type __riscv_save_0,@function
105+ __riscv_save_2:
106+ __riscv_save_1:
107+ __riscv_save_0:
108+ addi sp, sp, -12
109+ sw s1, 0 (sp)
110+ sw s0, 4 (sp)
111+ sw ra, 8 (sp)
112+ jr t0
113+
114+ #endif
115+
95116#elif __riscv_xlen == 64
96117
118+ #ifndef __riscv_64e
119+
97120 .globl __riscv_save_12
98121 .type __riscv_save_12,@function
99122__riscv_save_12:
@@ -181,6 +204,25 @@ __riscv_save_0:
181204 sd ra, 8 (sp)
182205 jr t0
183206
207+ #else
208+
209+ .globl __riscv_save_2
210+ .type __riscv_save_2,@function
211+ .globl __riscv_save_1
212+ .type __riscv_save_1,@function
213+ .globl __riscv_save_0
214+ .type __riscv_save_0,@function
215+ __riscv_save_2:
216+ __riscv_save_1:
217+ __riscv_save_0:
218+ addi sp, sp, -24
219+ sd s1, 0 (sp)
220+ sd s0, 8 (sp)
221+ sd ra, 16 (sp)
222+ jr t0
223+
224+ #endif
225+
184226#else
185227# error "xlen must be 32 or 64 for save-restore implementation
186228#endif
You can’t perform that action at this time.
0 commit comments