| ... | @@ -114,17 +114,17 @@ fn divmod(q: ?[]u32, r: ?[]u32, u: []const u32, v: []const u32) !void { | ... | @@ -114,17 +114,17 @@ fn divmod(q: ?[]u32, r: ?[]u32, u: []const u32, v: []const u32) !void { |
| 114 | | 114 | |
| 115 | pub fn __udivei4(r_q: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) callconv(.C) void { | 115 | pub fn __udivei4(r_q: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) callconv(.C) void { |
| 116 | @setRuntimeSafety(builtin.is_test); | 116 | @setRuntimeSafety(builtin.is_test); |
| 117 | const u = u_p[0 .. bits / 32]; | 117 | const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; |
| 118 | const v = v_p[0 .. bits / 32]; | 118 | const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; |
| 119 | const q = r_q[0 .. bits / 32]; | 119 | const q = r_q[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; |
| 120 | @call(.always_inline, divmod, .{ q, null, u, v }) catch unreachable; | 120 | @call(.always_inline, divmod, .{ q, null, u, v }) catch unreachable; |
| 121 | } | 121 | } |
| 122 | | 122 | |
| 123 | pub fn __umodei4(r_p: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) callconv(.C) void { | 123 | pub fn __umodei4(r_p: [*]u32, u_p: [*]const u32, v_p: [*]const u32, bits: usize) callconv(.C) void { |
| 124 | @setRuntimeSafety(builtin.is_test); | 124 | @setRuntimeSafety(builtin.is_test); |
| 125 | const u = u_p[0 .. bits / 32]; | 125 | const u = u_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; |
| 126 | const v = v_p[0 .. bits / 32]; | 126 | const v = v_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; |
| 127 | const r = r_p[0 .. bits / 32]; | 127 | const r = r_p[0 .. std.math.divCeil(usize, bits, 32) catch unreachable]; |
| 128 | @call(.always_inline, divmod, .{ null, r, u, v }) catch unreachable; | 128 | @call(.always_inline, divmod, .{ null, r, u, v }) catch unreachable; |
| 129 | } | 129 | } |
| 130 | | 130 | |