| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | // ARM specific builtins |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | | const is_test = builtin.is_test; |
| 4 | 3 | |
| 5 | 4 | const __divmodsi4 = @import("int.zig").__divmodsi4; |
| 6 | 5 | const __udivmodsi4 = @import("int.zig").__udivmodsi4; |
| ... | ... | @@ -33,18 +32,14 @@ pub fn __aeabi_memclr(dest: [*]u8, n: usize) callconv(.AAPCS) void { |
| 33 | 32 | _ = memset(dest, 0, n); |
| 34 | 33 | } |
| 35 | 34 | |
| 36 | | pub fn __aeabi_unwind_cpp_pr0() callconv(.C) void { |
| 37 | | unreachable; |
| 38 | | } |
| 39 | | pub fn __aeabi_unwind_cpp_pr1() callconv(.C) void { |
| 40 | | unreachable; |
| 41 | | } |
| 42 | | pub fn __aeabi_unwind_cpp_pr2() callconv(.C) void { |
| 43 | | unreachable; |
| 44 | | } |
| 35 | // Dummy functions to avoid errors during the linking phase |
| 36 | pub fn __aeabi_unwind_cpp_pr0() callconv(.C) void {} |
| 37 | pub fn __aeabi_unwind_cpp_pr1() callconv(.C) void {} |
| 38 | pub fn __aeabi_unwind_cpp_pr2() callconv(.C) void {} |
| 45 | 39 | |
| 46 | 40 | // This function can only clobber r0 according to the ABI |
| 47 | 41 | pub fn __aeabi_read_tp() callconv(.Naked) void { |
| 42 | @setRuntimeSafety(false); |
| 48 | 43 | asm volatile ( |
| 49 | 44 | \\ mrc p15, 0, r0, c13, c0, 3 |
| 50 | 45 | \\ bx lr |
| ... | ... | @@ -56,6 +51,7 @@ pub fn __aeabi_read_tp() callconv(.Naked) void { |
| 56 | 51 | // calling convention is always respected |
| 57 | 52 | |
| 58 | 53 | pub fn __aeabi_uidivmod() callconv(.Naked) void { |
| 54 | @setRuntimeSafety(false); |
| 59 | 55 | // Divide r0 by r1; the quotient goes in r0, the remainder in r1 |
| 60 | 56 | asm volatile ( |
| 61 | 57 | \\ push {lr} |
| ... | ... | @@ -73,6 +69,7 @@ pub fn __aeabi_uidivmod() callconv(.Naked) void { |
| 73 | 69 | } |
| 74 | 70 | |
| 75 | 71 | pub fn __aeabi_uldivmod() callconv(.Naked) void { |
| 72 | @setRuntimeSafety(false); |
| 76 | 73 | // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r2 |
| 77 | 74 | asm volatile ( |
| 78 | 75 | \\ push {r4, lr} |
| ... | ... | @@ -92,6 +89,7 @@ pub fn __aeabi_uldivmod() callconv(.Naked) void { |
| 92 | 89 | } |
| 93 | 90 | |
| 94 | 91 | pub fn __aeabi_idivmod() callconv(.Naked) void { |
| 92 | @setRuntimeSafety(false); |
| 95 | 93 | // Divide r0 by r1; the quotient goes in r0, the remainder in r1 |
| 96 | 94 | asm volatile ( |
| 97 | 95 | \\ push {lr} |
| ... | ... | @@ -109,6 +107,7 @@ pub fn __aeabi_idivmod() callconv(.Naked) void { |
| 109 | 107 | } |
| 110 | 108 | |
| 111 | 109 | pub fn __aeabi_ldivmod() callconv(.Naked) void { |
| 110 | @setRuntimeSafety(false); |
| 112 | 111 | // Divide r1:r0 by r3:r2; the quotient goes in r1:r0, the remainder in r3:r2 |
| 113 | 112 | asm volatile ( |
| 114 | 113 | \\ push {r4, lr} |