commit 0d7bd9f3ced8140866eea0de4bee040e265b3afd (tree)
parent 547ba8eb203fa84d207eb38d8d64c0f7f3162101
Author: Andrew Kelley <andrew@ziglang.org>
Date: Fri, 27 Mar 2020 21:28:16 -0400
Merge pull request #4832 from LemonBoy/watwatwat
Fix the weird-ass crash on AArch64
Diffstat:
3 files changed, 6 insertions(+), 21 deletions(-)
diff --git 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
@@ -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
@@ -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);