authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-14 04:28:46+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-01-25 14:54:02+01:00
log673544b783fb81d5fd970e132e0d78f234498603
tree4a43c9659bd76e1302fe848d91852ace7739fd3f
parent35da1e1e8ffe5201bfe3ff1f5a9a40b73121916c
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler-rt: Pass called functions into inline asm so the compiler sees the usage.


1 files changed, 20 insertions(+), 8 deletions(-)

lib/compiler_rt/arm.zig+20-8
...@@ -136,11 +136,14 @@ pub fn __aeabi_uidivmod() callconv(.Naked) void {...@@ -136,11 +136,14 @@ pub fn __aeabi_uidivmod() callconv(.Naked) void {
136 \\ push {lr}136 \\ push {lr}
137 \\ sub sp, #4137 \\ sub sp, #4
138 \\ mov r2, sp138 \\ mov r2, sp
139 \\ bl __udivmodsi4139 \\ bl %[__udivmodsi4]
140 \\ ldr r1, [sp]140 \\ ldr r1, [sp]
141 \\ add sp, #4141 \\ add sp, #4
142 \\ pop {pc}142 \\ pop {pc}
143 ::: "memory");143 :
144 : [__udivmodsi4] "X" (&__udivmodsi4),
145 : "memory"
146 );
144 unreachable;147 unreachable;
145}148}
146149
...@@ -152,12 +155,15 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void {...@@ -152,12 +155,15 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void {
152 \\ sub sp, #16155 \\ sub sp, #16
153 \\ add r4, sp, #8156 \\ add r4, sp, #8
154 \\ str r4, [sp]157 \\ str r4, [sp]
155 \\ bl __udivmoddi4158 \\ bl %[__udivmoddi4]
156 \\ ldr r2, [sp, #8]159 \\ ldr r2, [sp, #8]
157 \\ ldr r3, [sp, #12]160 \\ ldr r3, [sp, #12]
158 \\ add sp, #16161 \\ add sp, #16
159 \\ pop {r4, pc}162 \\ pop {r4, pc}
160 ::: "memory");163 :
164 : [__udivmoddi4] "X" (&__udivmoddi4),
165 : "memory"
166 );
161 unreachable;167 unreachable;
162}168}
163169
...@@ -168,11 +174,14 @@ pub fn __aeabi_idivmod() callconv(.Naked) void {...@@ -168,11 +174,14 @@ pub fn __aeabi_idivmod() callconv(.Naked) void {
168 \\ push {lr}174 \\ push {lr}
169 \\ sub sp, #4175 \\ sub sp, #4
170 \\ mov r2, sp176 \\ mov r2, sp
171 \\ bl __divmodsi4177 \\ bl %[__divmodsi4]
172 \\ ldr r1, [sp]178 \\ ldr r1, [sp]
173 \\ add sp, #4179 \\ add sp, #4
174 \\ pop {pc}180 \\ pop {pc}
175 ::: "memory");181 :
182 : [__divmodsi4] "X" (&__divmodsi4),
183 : "memory"
184 );
176 unreachable;185 unreachable;
177}186}
178187
...@@ -184,12 +193,15 @@ pub fn __aeabi_ldivmod() callconv(.Naked) void {...@@ -184,12 +193,15 @@ pub fn __aeabi_ldivmod() callconv(.Naked) void {
184 \\ sub sp, #16193 \\ sub sp, #16
185 \\ add r4, sp, #8194 \\ add r4, sp, #8
186 \\ str r4, [sp]195 \\ str r4, [sp]
187 \\ bl __divmoddi4196 \\ bl %[__divmoddi4]
188 \\ ldr r2, [sp, #8]197 \\ ldr r2, [sp, #8]
189 \\ ldr r3, [sp, #12]198 \\ ldr r3, [sp, #12]
190 \\ add sp, #16199 \\ add sp, #16
191 \\ pop {r4, pc}200 \\ pop {r4, pc}
192 ::: "memory");201 :
202 : [__divmoddi4] "X" (&__divmoddi4),
203 : "memory"
204 );
193 unreachable;205 unreachable;
194}206}
195207