File tree Expand file tree Collapse file tree 3 files changed +6
-21
lines changed
lib/std/special/compiler_rt Expand file tree Collapse file tree 3 files changed +6
-21
lines changed Original file line number Diff line number Diff line change @@ -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
Original file line number Diff line number Diff line change @@ -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
}
Original file line number Diff line number Diff line change 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 );
You can’t perform that action at this time.
0 commit comments