| author | |
| committer | |
| log | d8fc8d0118a6ae99c0298d584faf1d8b5c6712c4 |
| tree | ff9a621f147afc17a29b8b0d0f3cd32e0dc7d05b |
| parent | 558ad1909573abfe2c9387391917c110ef95310e |
This is a workaround for
https://github.com/llvm/llvm-project/issues/564032 files changed, 9 insertions(+), 8 deletions(-)
lib/compiler_rt/mulo.zig+9| ... | ... | @@ -65,6 +65,15 @@ pub fn __mulodi4(a: i64, b: i64, overflow: *c_int) callconv(.C) i64 { |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 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 | } | |
| 68 | 77 | if (2 * @bitSizeOf(i128) <= @bitSizeOf(usize)) { |
| 69 | 78 | return muloXi4_genericFast(i128, a, b, overflow); |
| 70 | 79 | } else { |
test/behavior/math.zig-8| ... | ... | @@ -609,14 +609,6 @@ test "128-bit multiplication" { |
| 609 | 609 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 610 | 610 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 611 | 611 | |
| 612 | if ((builtin.zig_backend == .stage1 or builtin.zig_backend == .stage2_llvm) and | |
| 613 | builtin.cpu.arch == .wasm32) | |
| 614 | { | |
| 615 | // TODO This regressed with LLVM 14 due to the __muloti4 compiler-rt symbol | |
| 616 | // being lowered to call itself despite having the "nobuiltin" attribute. | |
| 617 | return error.SkipZigTest; | |
| 618 | } | |
| 619 | ||
| 620 | 612 | var a: i128 = 3; |
| 621 | 613 | var b: i128 = 2; |
| 622 | 614 | var c = a * b; |