authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-02-06 20:06:00-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-02-06 20:06:00-07:00
logd4805472c3c98c488c17bce0ee28b6c44e93793c
treef09453071614e8ce1f4950026aa0bd19edc9e9f5
parent495fd4ee3e81bd9d26768cdb8fc639afac79d9dc

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.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/special/compiler_rt/addXf3.zig+1-1
......@@ -339,7 +339,7 @@ pub fn __addxf3(a: f80, b: f80) callconv(.C) f80 {
339339 // If partial cancellation occurred, we need to left-shift the result
340340 // and adjust the exponent:
341341 if (a_int < int_bit << 3) {
342 const shift = @intCast(i32, @clz(u80, a_int)) - @intCast(i32, @clz(u80, int_bit << 3));
342 const shift = @intCast(i32, @clz(u80, a_int)) - @intCast(i32, @clz(u80, @as(u80, int_bit) << 3));
343343 a_int <<= @intCast(u7, shift);
344344 a_exp -= shift;
345345 }