From d4805472c3c98c488c17bce0ee28b6c44e93793c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 6 Feb 2022 20:06:00 -0700 Subject: [PATCH] compiler_rt: addXf3: add coercion to `@clz` We're going to remove the first parameter from this function in the future. Stage2 already ignores the first parameter. So we put an `@as` in here to make it work for both. --- lib/std/special/compiler_rt/addXf3.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/special/compiler_rt/addXf3.zig b/lib/std/special/compiler_rt/addXf3.zig index 41ff00e95d..1339cc340d 100644 --- a/lib/std/special/compiler_rt/addXf3.zig +++ b/lib/std/special/compiler_rt/addXf3.zig @@ -339,7 +339,7 @@ pub fn __addxf3(a: f80, b: f80) callconv(.C) f80 { // If partial cancellation occurred, we need to left-shift the result // and adjust the exponent: if (a_int < int_bit << 3) { - const shift = @intCast(i32, @clz(u80, a_int)) - @intCast(i32, @clz(u80, int_bit << 3)); + const shift = @intCast(i32, @clz(u80, a_int)) - @intCast(i32, @clz(u80, @as(u80, int_bit) << 3)); a_int <<= @intCast(u7, shift); a_exp -= shift; }