| author | |
| committer | |
| log | 07852a4bc8b5785d4b68c217099f7aef13620a97 |
| tree | b39340ca2860dfc6206841c375c2ba767c934882 |
| parent | ae1871a028d39cb96bd63833045293f4f5c9c249 |
The function transforms an unsigned integer into a f128.
Closes #89962 files changed, 3 insertions(+), 3 deletions(-)
lib/std/special/compiler_rt/floatunsitf.zig+2-2| ... | ... | @@ -7,7 +7,7 @@ const builtin = @import("builtin"); |
| 7 | 7 | const is_test = builtin.is_test; |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | |
| 10 | pub fn __floatunsitf(a: u64) callconv(.C) f128 { | |
| 10 | pub fn __floatunsitf(a: u32) callconv(.C) f128 { | |
| 11 | 11 | @setRuntimeSafety(is_test); |
| 12 | 12 | |
| 13 | 13 | if (a == 0) { |
| ... | ... | @@ -19,7 +19,7 @@ pub fn __floatunsitf(a: u64) callconv(.C) f128 { |
| 19 | 19 | const exponent_bias = (1 << (exponent_bits - 1)) - 1; |
| 20 | 20 | const implicit_bit = 1 << mantissa_bits; |
| 21 | 21 | |
| 22 | const exp = (64 - 1) - @clz(u64, a); | |
| 22 | const exp = (32 - 1) - @clz(u32, a); | |
| 23 | 23 | const shift = mantissa_bits - @intCast(u7, exp); |
| 24 | 24 | |
| 25 | 25 | // TODO(#1148): @bitCast alignment error |
lib/std/special/compiler_rt/floatunsitf_test.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | // and substantial portions of the software. |
| 6 | 6 | const __floatunsitf = @import("floatunsitf.zig").__floatunsitf; |
| 7 | 7 | |
| 8 | fn test__floatunsitf(a: u64, expected_hi: u64, expected_lo: u64) !void { | |
| 8 | fn test__floatunsitf(a: u32, expected_hi: u64, expected_lo: u64) !void { | |
| 9 | 9 | const x = __floatunsitf(a); |
| 10 | 10 | |
| 11 | 11 | const x_repr = @bitCast(u128, x); |