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 {...@@ -147,7 +147,7 @@ comptime {
147 @export(@import("compiler_rt/negXf2.zig").__negdf2, .{ .name = "__negdf2", .linkage = linkage });147 @export(@import("compiler_rt/negXf2.zig").__negdf2, .{ .name = "__negdf2", .linkage = linkage });
148148
149 if (is_arm_arch and !is_arm_64 and !is_test) {149 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 });
151 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = linkage });151 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = linkage });
152 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr2, .{ .name = "__aeabi_unwind_cpp_pr2", .linkage = linkage });152 @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 @@...@@ -1,6 +1,5 @@
1// ARM specific builtins1// ARM specific builtins
2const builtin = @import("builtin");2const builtin = @import("builtin");
3const is_test = builtin.is_test;
43
5const __divmodsi4 = @import("int.zig").__divmodsi4;4const __divmodsi4 = @import("int.zig").__divmodsi4;
6const __udivmodsi4 = @import("int.zig").__udivmodsi4;5const __udivmodsi4 = @import("int.zig").__udivmodsi4;
...@@ -33,18 +32,14 @@ pub fn __aeabi_memclr(dest: [*]u8, n: usize) callconv(.AAPCS) void {...@@ -33,18 +32,14 @@ pub fn __aeabi_memclr(dest: [*]u8, n: usize) callconv(.AAPCS) void {
33 _ = memset(dest, 0, n);32 _ = memset(dest, 0, n);
34}33}
3534
36pub fn __aeabi_unwind_cpp_pr0() callconv(.C) void {35// Dummy functions to avoid errors during the linking phase
37 unreachable;36pub fn __aeabi_unwind_cpp_pr0() callconv(.C) void {}
38}37pub fn __aeabi_unwind_cpp_pr1() callconv(.C) void {}
39pub fn __aeabi_unwind_cpp_pr1() callconv(.C) void {38pub fn __aeabi_unwind_cpp_pr2() callconv(.C) void {}
40 unreachable;
41}
42pub fn __aeabi_unwind_cpp_pr2() callconv(.C) void {
43 unreachable;
44}
4539
46// This function can only clobber r0 according to the ABI40// This function can only clobber r0 according to the ABI
47pub fn __aeabi_read_tp() callconv(.Naked) void {41pub fn __aeabi_read_tp() callconv(.Naked) void {
42 @setRuntimeSafety(false);
48 asm volatile (43 asm volatile (
49 \\ mrc p15, 0, r0, c13, c0, 344 \\ mrc p15, 0, r0, c13, c0, 3
50 \\ bx lr45 \\ bx lr
...@@ -56,6 +51,7 @@ pub fn __aeabi_read_tp() callconv(.Naked) void {...@@ -56,6 +51,7 @@ pub fn __aeabi_read_tp() callconv(.Naked) void {
56// calling convention is always respected51// calling convention is always respected
5752
58pub fn __aeabi_uidivmod() callconv(.Naked) void {53pub fn __aeabi_uidivmod() callconv(.Naked) void {
54 @setRuntimeSafety(false);
59 // Divide r0 by r1; the quotient goes in r0, the remainder in r155 // Divide r0 by r1; the quotient goes in r0, the remainder in r1
60 asm volatile (56 asm volatile (
61 \\ push {lr}57 \\ push {lr}
...@@ -73,6 +69,7 @@ pub fn __aeabi_uidivmod() callconv(.Naked) void {...@@ -73,6 +69,7 @@ pub fn __aeabi_uidivmod() callconv(.Naked) void {
73}69}
7470
75pub fn __aeabi_uldivmod() callconv(.Naked) void {71pub fn __aeabi_uldivmod() callconv(.Naked) void {
72 @setRuntimeSafety(false);
76 // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r273 // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r2
77 asm volatile (74 asm volatile (
78 \\ push {r4, lr}75 \\ push {r4, lr}
...@@ -92,6 +89,7 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void {...@@ -92,6 +89,7 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void {
92}89}
9390
94pub fn __aeabi_idivmod() callconv(.Naked) void {91pub fn __aeabi_idivmod() callconv(.Naked) void {
92 @setRuntimeSafety(false);
95 // Divide r0 by r1; the quotient goes in r0, the remainder in r193 // Divide r0 by r1; the quotient goes in r0, the remainder in r1
96 asm volatile (94 asm volatile (
97 \\ push {lr}95 \\ push {lr}
...@@ -109,6 +107,7 @@ pub fn __aeabi_idivmod() callconv(.Naked) void {...@@ -109,6 +107,7 @@ pub fn __aeabi_idivmod() callconv(.Naked) void {
109}107}
110108
111pub fn __aeabi_ldivmod() callconv(.Naked) void {109pub fn __aeabi_ldivmod() callconv(.Naked) void {
110 @setRuntimeSafety(false);
112 // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r2111 // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r2
113 asm volatile (112 asm volatile (
114 \\ push {r4, lr}113 \\ push {r4, lr}