Skip to content

Commit 0d7bd9f

Browse files
authored
Merge pull request #4832 from LemonBoy/watwatwat
Fix the weird-ass crash on AArch64
2 parents 547ba8e + ddda50a commit 0d7bd9f

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

ci/drone/linux_script

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@ pip3 install s3cmd
1515
# This will affect the cmake command below.
1616
git config core.abbrev 9
1717

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-
3318
mkdir build
3419
cd build
3520
cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$DISTDIR" -DZIG_STATIC=ON -DCMAKE_PREFIX_PATH=/deps/local

lib/std/special/compiler_rt/floatunditf.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const builtin = @import("builtin");
22
const is_test = builtin.is_test;
33
const std = @import("std");
44

5-
pub fn __floatunditf(a: u128) callconv(.C) f128 {
5+
pub fn __floatunditf(a: u64) callconv(.C) f128 {
66
@setRuntimeSafety(is_test);
77

88
if (a == 0) {
@@ -14,11 +14,11 @@ pub fn __floatunditf(a: u128) callconv(.C) f128 {
1414
const exponent_bias = (1 << (exponent_bits - 1)) - 1;
1515
const implicit_bit = 1 << mantissa_bits;
1616

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);
1919

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;
2222

2323
return @bitCast(f128, result);
2424
}

lib/std/special/compiler_rt/floatunditf_test.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const __floatunditf = @import("floatunditf.zig").__floatunditf;
22

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 {
44
const x = __floatunditf(a);
55

66
const x_repr = @bitCast(u128, x);

0 commit comments

Comments
 (0)