| author | |
| committer | |
| log | 0d7bd9f3ced8140866eea0de4bee040e265b3afd |
| tree | f99c94f60b8ae4a9f81afa74c83b2f6b10ef05da |
| parent | 547ba8eb203fa84d207eb38d8d64c0f7f3162101 |
| parent | ddda50a38d63fddb87693b8331dc948d458a42a1 |
| signature |
Fix the weird-ass crash on AArch643 files changed, 6 insertions(+), 21 deletions(-)
ci/drone/linux_script-15| ... | ... | @@ -15,21 +15,6 @@ pip3 install s3cmd |
| 15 | 15 | # This will affect the cmake command below. |
| 16 | 16 | git config core.abbrev 9 |
| 17 | 17 | |
| 18 | # This patch is a workaround for | |
| 19 | # https://github.com/ziglang/zig/issues/4822 | |
| 20 | patch <<'END_PATCH' | |
| 21 | --- CMakeLists.txt | |
| 22 | +++ CMakeLists.txt | |
| 23 | @@ -430,7 +430,6 @@ set(BUILD_LIBSTAGE2_ARGS "build-lib" | |
| 24 | --cache on | |
| 25 | --output-dir "${CMAKE_BINARY_DIR}" | |
| 26 | ${LIBSTAGE2_RELEASE_ARG} | |
| 27 | - --bundle-compiler-rt | |
| 28 | -fPIC | |
| 29 | -lc | |
| 30 | ${LIBSTAGE2_WINDOWS_ARGS} | |
| 31 | END_PATCH | |
| 32 | ||
| 33 | 18 | mkdir build |
| 34 | 19 | cd build |
| 35 | 20 | cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$DISTDIR" -DZIG_STATIC=ON -DCMAKE_PREFIX_PATH=/deps/local |
lib/std/special/compiler_rt/floatunditf.zig+5-5| ... | ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); |
| 2 | 2 | const is_test = builtin.is_test; |
| 3 | 3 | const std = @import("std"); |
| 4 | 4 | |
| 5 | pub fn __floatunditf(a: u128) callconv(.C) f128 { | |
| 5 | pub fn __floatunditf(a: u64) callconv(.C) f128 { | |
| 6 | 6 | @setRuntimeSafety(is_test); |
| 7 | 7 | |
| 8 | 8 | if (a == 0) { |
| ... | ... | @@ -14,11 +14,11 @@ pub fn __floatunditf(a: u128) callconv(.C) f128 { |
| 14 | 14 | const exponent_bias = (1 << (exponent_bits - 1)) - 1; |
| 15 | 15 | const implicit_bit = 1 << mantissa_bits; |
| 16 | 16 | |
| 17 | const exp = (u128.bit_count - 1) - @clz(u128, a); | |
| 18 | const shift = mantissa_bits - @intCast(u7, exp); | |
| 17 | const exp: u128 = (u64.bit_count - 1) - @clz(u64, a); | |
| 18 | const shift: u7 = mantissa_bits - @intCast(u7, exp); | |
| 19 | 19 | |
| 20 | var result: u128 align(16) = (a << shift) ^ implicit_bit; | |
| 21 | result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits; | |
| 20 | var result: u128 = (@intCast(u128, a) << shift) ^ implicit_bit; | |
| 21 | result += (exp + exponent_bias) << mantissa_bits; | |
| 22 | 22 | |
| 23 | 23 | return @bitCast(f128, result); |
| 24 | 24 | } |
lib/std/special/compiler_rt/floatunditf_test.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | const __floatunditf = @import("floatunditf.zig").__floatunditf; |
| 2 | 2 | |
| 3 | fn test__floatunditf(a: u128, expected_hi: u64, expected_lo: u64) void { | |
| 3 | fn test__floatunditf(a: u64, expected_hi: u64, expected_lo: u64) void { | |
| 4 | 4 | const x = __floatunditf(a); |
| 5 | 5 | |
| 6 | 6 | const x_repr = @bitCast(u128, x); |