| author | |
| committer | |
| log | cf85462a78aa767ce7cfd1ebdb06d7405e1b0e5e |
| tree | 6ec39337b013279da7ff200f3d2060abf1ac16a9 |
| parent | 1ebb7612445c1b0b0d76c73d17f18254e0d9efab |
| parent | 171e6c7aa7783efbd680f9d8ab9a28a115abff5d |
| signature |
compiler_rt: re-enable tests and remove old workarounds3 files changed, 5 insertions(+), 30 deletions(-)
lib/compiler_rt/clzsi2_test.zig+5-18| ... | @@ -3,24 +3,11 @@ const clz = @import("count0bits.zig"); | ... | @@ -3,24 +3,11 @@ const clz = @import("count0bits.zig"); |
| 3 | const testing = @import("std").testing; | 3 | const testing = @import("std").testing; |
| 4 | 4 | ||
| 5 | fn test__clzsi2(a: u32, expected: i32) !void { | 5 | fn test__clzsi2(a: u32, expected: i32) !void { |
| 6 | // stage1 and stage2 diverge on function pointer semantics | 6 | const nakedClzsi2 = clz.__clzsi2; |
| 7 | switch (builtin.zig_backend) { | 7 | const actualClzsi2 = @ptrCast(*const fn (a: i32) callconv(.C) i32, &nakedClzsi2); |
| 8 | .stage1 => { | 8 | const x = @bitCast(i32, a); |
| 9 | // Use of `var` here is working around a stage1 bug. | 9 | const result = actualClzsi2(x); |
| 10 | var nakedClzsi2 = clz.__clzsi2; | 10 | try testing.expectEqual(expected, result); |
| 11 | var actualClzsi2 = @ptrCast(fn (a: i32) callconv(.C) i32, nakedClzsi2); | ||
| 12 | var x = @bitCast(i32, a); | ||
| 13 | var result = actualClzsi2(x); | ||
| 14 | try testing.expectEqual(expected, result); | ||
| 15 | }, | ||
| 16 | else => { | ||
| 17 | const nakedClzsi2 = clz.__clzsi2; | ||
| 18 | const actualClzsi2 = @ptrCast(*const fn (a: i32) callconv(.C) i32, &nakedClzsi2); | ||
| 19 | const x = @bitCast(i32, a); | ||
| 20 | const result = actualClzsi2(x); | ||
| 21 | try testing.expectEqual(expected, result); | ||
| 22 | }, | ||
| 23 | } | ||
| 24 | } | 11 | } |
| 25 | 12 | ||
| 26 | test "clzsi2" { | 13 | test "clzsi2" { |
lib/compiler_rt/int_to_float_test.zig-3| ... | @@ -1,5 +1,4 @@ | ... | @@ -1,5 +1,4 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | ||
| 3 | const testing = std.testing; | 2 | const testing = std.testing; |
| 4 | const math = std.math; | 3 | const math = std.math; |
| 5 | 4 | ||
| ... | @@ -811,8 +810,6 @@ test "conversion to f32" { | ... | @@ -811,8 +810,6 @@ test "conversion to f32" { |
| 811 | } | 810 | } |
| 812 | 811 | ||
| 813 | test "conversion to f80" { | 812 | test "conversion to f80" { |
| 814 | if (builtin.zig_backend == .stage1 and builtin.cpu.arch != .x86_64) | ||
| 815 | return error.SkipZigTest; // https://github.com/ziglang/zig/issues/11408 | ||
| 816 | if (std.debug.runtime_safety) return error.SkipZigTest; | 813 | if (std.debug.runtime_safety) return error.SkipZigTest; |
| 817 | 814 | ||
| 818 | const intToFloat = @import("./int_to_float.zig").intToFloat; | 815 | const intToFloat = @import("./int_to_float.zig").intToFloat; |
lib/compiler_rt/mulo.zig-9| ... | @@ -65,15 +65,6 @@ pub fn __mulodi4(a: i64, b: i64, overflow: *c_int) callconv(.C) i64 { | ... | @@ -65,15 +65,6 @@ pub fn __mulodi4(a: i64, b: i64, overflow: *c_int) callconv(.C) i64 { |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | pub fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 { | 67 | pub fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 { |
| 68 | switch (builtin.zig_backend) { | ||
| 69 | .stage1, .stage2_llvm => { | ||
| 70 | // Workaround for https://github.com/llvm/llvm-project/issues/56403 | ||
| 71 | // When we call the genericSmall implementation instead, LLVM optimizer | ||
| 72 | // optimizes __muloti4 to a call to itself. | ||
| 73 | return muloXi4_genericFast(i128, a, b, overflow); | ||
| 74 | }, | ||
| 75 | else => {}, | ||
| 76 | } | ||
| 77 | if (2 * @bitSizeOf(i128) <= @bitSizeOf(usize)) { | 68 | if (2 * @bitSizeOf(i128) <= @bitSizeOf(usize)) { |
| 78 | return muloXi4_genericFast(i128, a, b, overflow); | 69 | return muloXi4_genericFast(i128, a, b, overflow); |
| 79 | } else { | 70 | } else { |