aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-03-27 21:28:16 -0400
committerGitHub <noreply@github.com>2020-03-27 21:28:16 -0400
commit0d7bd9f3ced8140866eea0de4bee040e265b3afd (patch)
treef99c94f60b8ae4a9f81afa74c83b2f6b10ef05da
parent547ba8eb203fa84d207eb38d8d64c0f7f3162101 (diff)
parentddda50a38d63fddb87693b8331dc948d458a42a1 (diff)
downloadzig-0d7bd9f3ced8140866eea0de4bee040e265b3afd.tar.gz
zig-0d7bd9f3ced8140866eea0de4bee040e265b3afd.zip
Merge pull request #4832 from LemonBoy/watwatwat
Fix the weird-ass crash on AArch64
-rwxr-xr-xci/drone/linux_script15
-rw-r--r--lib/std/special/compiler_rt/floatunditf.zig10
-rw-r--r--lib/std/special/compiler_rt/floatunditf_test.zig2
3 files changed, 6 insertions, 21 deletions
diff --git a/ci/drone/linux_script b/ci/drone/linux_script
index da20068480..ca587eed8f 100755
--- a/ci/drone/linux_script
+++ b/ci/drone/linux_script
@@ -15,21 +15,6 @@ pip3 install s3cmd
# This will affect the cmake command below.
git config core.abbrev 9
-# This patch is a workaround for
-# https://github.com/ziglang/zig/issues/4822
-patch <<'END_PATCH'
---- CMakeLists.txt
-+++ CMakeLists.txt
-@@ -430,7 +430,6 @@ set(BUILD_LIBSTAGE2_ARGS "build-lib"
- --cache on
- --output-dir "${CMAKE_BINARY_DIR}"
- ${LIBSTAGE2_RELEASE_ARG}
-- --bundle-compiler-rt
- -fPIC
- -lc
- ${LIBSTAGE2_WINDOWS_ARGS}
-END_PATCH
-
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$DISTDIR" -DZIG_STATIC=ON -DCMAKE_PREFIX_PATH=/deps/local
diff --git a/lib/std/special/compiler_rt/floatunditf.zig b/lib/std/special/compiler_rt/floatunditf.zig
index b574d21bd8..209f66fc2e 100644
--- a/lib/std/special/compiler_rt/floatunditf.zig
+++ b/lib/std/special/compiler_rt/floatunditf.zig
@@ -2,7 +2,7 @@ const builtin = @import("builtin");
const is_test = builtin.is_test;
const std = @import("std");
-pub fn __floatunditf(a: u128) callconv(.C) f128 {
+pub fn __floatunditf(a: u64) callconv(.C) f128 {
@setRuntimeSafety(is_test);
if (a == 0) {
@@ -14,11 +14,11 @@ pub fn __floatunditf(a: u128) callconv(.C) f128 {
const exponent_bias = (1 << (exponent_bits - 1)) - 1;
const implicit_bit = 1 << mantissa_bits;
- const exp = (u128.bit_count - 1) - @clz(u128, a);
- const shift = mantissa_bits - @intCast(u7, exp);
+ const exp: u128 = (u64.bit_count - 1) - @clz(u64, a);
+ const shift: u7 = mantissa_bits - @intCast(u7, exp);
- var result: u128 align(16) = (a << shift) ^ implicit_bit;
- result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits;
+ var result: u128 = (@intCast(u128, a) << shift) ^ implicit_bit;
+ result += (exp + exponent_bias) << mantissa_bits;
return @bitCast(f128, result);
}
diff --git a/lib/std/special/compiler_rt/floatunditf_test.zig b/lib/std/special/compiler_rt/floatunditf_test.zig
index 5b4e195870..7bb3333693 100644
--- a/lib/std/special/compiler_rt/floatunditf_test.zig
+++ b/lib/std/special/compiler_rt/floatunditf_test.zig
@@ -1,6 +1,6 @@
const __floatunditf = @import("floatunditf.zig").__floatunditf;
-fn test__floatunditf(a: u128, expected_hi: u64, expected_lo: u64) void {
+fn test__floatunditf(a: u64, expected_hi: u64, expected_lo: u64) void {
const x = __floatunditf(a);
const x_repr = @bitCast(u128, x);