File tree 2 files changed +84
-0
lines changed
compiler-rt/lib/builtins/riscv
2 files changed +84
-0
lines changed Original file line number Diff line number Diff line change 22
22
23
23
#if __riscv_xlen == 32
24
24
25
+ #ifndef __riscv_32e
26
+
25
27
.globl __riscv_restore_12
26
28
.type __riscv_restore_12,@function
27
29
__riscv_restore_12:
@@ -86,8 +88,29 @@ __riscv_restore_0:
86
88
addi sp, sp, 16
87
89
ret
88
90
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
+
89
110
#elif __riscv_xlen == 64
90
111
112
+ #ifndef __riscv_64e
113
+
91
114
.globl __riscv_restore_12
92
115
.type __riscv_restore_12,@function
93
116
__riscv_restore_12:
@@ -161,6 +184,25 @@ __riscv_restore_0:
161
184
addi sp, sp, 16
162
185
ret
163
186
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
+
164
206
#else
165
207
# error "xlen must be 32 or 64 for save-restore implementation
166
208
#endif
Original file line number Diff line number Diff line change 18
18
19
19
#if __riscv_xlen == 32
20
20
21
+ #ifndef __riscv_32e
22
+
21
23
.globl __riscv_save_12
22
24
.type __riscv_save_12,@function
23
25
__riscv_save_12:
@@ -92,8 +94,29 @@ __riscv_save_0:
92
94
sw ra, 12 (sp)
93
95
jr t0
94
96
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
+
95
116
#elif __riscv_xlen == 64
96
117
118
+ #ifndef __riscv_64e
119
+
97
120
.globl __riscv_save_12
98
121
.type __riscv_save_12,@function
99
122
__riscv_save_12:
@@ -181,6 +204,25 @@ __riscv_save_0:
181
204
sd ra, 8 (sp)
182
205
jr t0
183
206
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
+
184
226
#else
185
227
# error "xlen must be 32 or 64 for save-restore implementation
186
228
#endif
You can’t perform that action at this time.
0 commit comments