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 {
136136 \\ push {lr}
137137 \\ sub sp, #4
138138 \\ mov r2, sp
139 \\ bl __udivmodsi4
139 \\ bl %[__udivmodsi4]
140140 \\ ldr r1, [sp]
141141 \\ add sp, #4
142142 \\ pop {pc}
143 ::: "memory");
143 :
144 : [__udivmodsi4] "X" (&__udivmodsi4),
145 : "memory"
146 );
144147 unreachable;
145148}
146149
......@@ -152,12 +155,15 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void {
152155 \\ sub sp, #16
153156 \\ add r4, sp, #8
154157 \\ str r4, [sp]
155 \\ bl __udivmoddi4
158 \\ bl %[__udivmoddi4]
156159 \\ ldr r2, [sp, #8]
157160 \\ ldr r3, [sp, #12]
158161 \\ add sp, #16
159162 \\ pop {r4, pc}
160 ::: "memory");
163 :
164 : [__udivmoddi4] "X" (&__udivmoddi4),
165 : "memory"
166 );
161167 unreachable;
162168}
163169
......@@ -168,11 +174,14 @@ pub fn __aeabi_idivmod() callconv(.Naked) void {
168174 \\ push {lr}
169175 \\ sub sp, #4
170176 \\ mov r2, sp
171 \\ bl __divmodsi4
177 \\ bl %[__divmodsi4]
172178 \\ ldr r1, [sp]
173179 \\ add sp, #4
174180 \\ pop {pc}
175 ::: "memory");
181 :
182 : [__divmodsi4] "X" (&__divmodsi4),
183 : "memory"
184 );
176185 unreachable;
177186}
178187
......@@ -184,12 +193,15 @@ pub fn __aeabi_ldivmod() callconv(.Naked) void {
184193 \\ sub sp, #16
185194 \\ add r4, sp, #8
186195 \\ str r4, [sp]
187 \\ bl __divmoddi4
196 \\ bl %[__divmoddi4]
188197 \\ ldr r2, [sp, #8]
189198 \\ ldr r3, [sp, #12]
190199 \\ add sp, #16
191200 \\ pop {r4, pc}
192 ::: "memory");
201 :
202 : [__divmoddi4] "X" (&__divmoddi4),
203 : "memory"
204 );
193205 unreachable;
194206}
195207