authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-01-16 11:37:23+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-16 12:50:53-05:00
logf609ce4f6551d772dcb6480c573ccad7645056cb
treebe34979631061aae06c675d8a2d9db7e4fc922fa
parent7e5e767ba0fdde91dd66690168eff96b75c28e33

Minor changes to the ARM builtin fns


2 files changed, 10 insertions(+), 11 deletions(-)

lib/std/special/compiler_rt.zig+1-1
......@@ -147,7 +147,7 @@ comptime {
147147 @export(@import("compiler_rt/negXf2.zig").__negdf2, .{ .name = "__negdf2", .linkage = linkage });
148148
149149 if (is_arm_arch and !is_arm_64 and !is_test) {
150 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr0, .{ .name = "__aeabi_unwind_cpp_pr0", .linkage = strong_linkage });
150 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr0, .{ .name = "__aeabi_unwind_cpp_pr0", .linkage = linkage });
151151 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = linkage });
152152 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr2, .{ .name = "__aeabi_unwind_cpp_pr2", .linkage = linkage });
153153
lib/std/special/compiler_rt/arm.zig+9-10
......@@ -1,6 +1,5 @@
11// ARM specific builtins
22const builtin = @import("builtin");
3const is_test = builtin.is_test;
43
54const __divmodsi4 = @import("int.zig").__divmodsi4;
65const __udivmodsi4 = @import("int.zig").__udivmodsi4;
......@@ -33,18 +32,14 @@ pub fn __aeabi_memclr(dest: [*]u8, n: usize) callconv(.AAPCS) void {
3332 _ = memset(dest, 0, n);
3433}
3534
36pub fn __aeabi_unwind_cpp_pr0() callconv(.C) void {
37 unreachable;
38}
39pub fn __aeabi_unwind_cpp_pr1() callconv(.C) void {
40 unreachable;
41}
42pub fn __aeabi_unwind_cpp_pr2() callconv(.C) void {
43 unreachable;
44}
35// Dummy functions to avoid errors during the linking phase
36pub fn __aeabi_unwind_cpp_pr0() callconv(.C) void {}
37pub fn __aeabi_unwind_cpp_pr1() callconv(.C) void {}
38pub fn __aeabi_unwind_cpp_pr2() callconv(.C) void {}
4539
4640// This function can only clobber r0 according to the ABI
4741pub fn __aeabi_read_tp() callconv(.Naked) void {
42 @setRuntimeSafety(false);
4843 asm volatile (
4944 \\ mrc p15, 0, r0, c13, c0, 3
5045 \\ bx lr
......@@ -56,6 +51,7 @@ pub fn __aeabi_read_tp() callconv(.Naked) void {
5651// calling convention is always respected
5752
5853pub fn __aeabi_uidivmod() callconv(.Naked) void {
54 @setRuntimeSafety(false);
5955 // Divide r0 by r1; the quotient goes in r0, the remainder in r1
6056 asm volatile (
6157 \\ push {lr}
......@@ -73,6 +69,7 @@ pub fn __aeabi_uidivmod() callconv(.Naked) void {
7369}
7470
7571pub fn __aeabi_uldivmod() callconv(.Naked) void {
72 @setRuntimeSafety(false);
7673 // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r2
7774 asm volatile (
7875 \\ push {r4, lr}
......@@ -92,6 +89,7 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void {
9289}
9390
9491pub fn __aeabi_idivmod() callconv(.Naked) void {
92 @setRuntimeSafety(false);
9593 // Divide r0 by r1; the quotient goes in r0, the remainder in r1
9694 asm volatile (
9795 \\ push {lr}
......@@ -109,6 +107,7 @@ pub fn __aeabi_idivmod() callconv(.Naked) void {
109107}
110108
111109pub fn __aeabi_ldivmod() callconv(.Naked) void {
110 @setRuntimeSafety(false);
112111 // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r2
113112 asm volatile (
114113 \\ push {r4, lr}