authorgravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2018-07-03 13:22:12+12:00
committergravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2018-07-03 13:22:12+12:00
log1eda86e1ad46493a996521b7a0c6bd59133960ae
tree8e08f487baf83401265da59a7e5147686726454a
parent06e8c2e5194439ce5b66f18fcf60108604449957

Clean up outstanding compiler_rt todos


5 files changed, 15 insertions(+), 22 deletions(-)

std/special/compiler_rt/comparetf2.zig+2-2
...@@ -1,4 +1,4 @@...@@ -1,4 +1,4 @@
1// TODO https://github.com/ziglang/zig/issues/3051// TODO https://github.com/ziglang/zig/issues/641
2// and then make the return types of some of these functions the enum instead of c_int2// and then make the return types of some of these functions the enum instead of c_int
3const LE_LESS = c_int(-1);3const LE_LESS = c_int(-1);
4const LE_EQUAL = c_int(0);4const LE_EQUAL = c_int(0);
...@@ -56,7 +56,7 @@ pub extern fn __letf2(a: f128, b: f128) c_int {...@@ -56,7 +56,7 @@ pub extern fn __letf2(a: f128, b: f128) c_int {
56 LE_GREATER;56 LE_GREATER;
57}57}
5858
59// TODO https://github.com/ziglang/zig/issues/30559// TODO https://github.com/ziglang/zig/issues/641
60// and then make the return types of some of these functions the enum instead of c_int60// and then make the return types of some of these functions the enum instead of c_int
61const GE_LESS = c_int(-1);61const GE_LESS = c_int(-1);
62const GE_EQUAL = c_int(0);62const GE_EQUAL = c_int(0);
std/special/compiler_rt/fixuint.zig-6
...@@ -44,14 +44,8 @@ pub fn fixuint(comptime fp_t: type, comptime fixuint_t: type, a: fp_t) fixuint_t...@@ -44,14 +44,8 @@ pub fn fixuint(comptime fp_t: type, comptime fixuint_t: type, a: fp_t) fixuint_t
44 // If 0 <= exponent < significandBits, right shift to get the result.44 // If 0 <= exponent < significandBits, right shift to get the result.
45 // Otherwise, shift left.45 // Otherwise, shift left.
46 if (exponent < significandBits) {46 if (exponent < significandBits) {
47 // TODO this is a workaround for the mysterious "integer cast truncated bits"
48 // happening on the next line
49 @setRuntimeSafety(false);
50 return @intCast(fixuint_t, significand >> @intCast(Log2Int(rep_t), significandBits - exponent));47 return @intCast(fixuint_t, significand >> @intCast(Log2Int(rep_t), significandBits - exponent));
51 } else {48 } else {
52 // TODO this is a workaround for the mysterious "integer cast truncated bits"
53 // happening on the next line
54 @setRuntimeSafety(false);
55 return @intCast(fixuint_t, significand) << @intCast(Log2Int(fixuint_t), exponent - significandBits);49 return @intCast(fixuint_t, significand) << @intCast(Log2Int(fixuint_t), exponent - significandBits);
56 }50 }
57}51}
std/special/compiler_rt/fixunstfdi_test.zig+10-11
...@@ -36,15 +36,14 @@ test "fixunstfdi" {...@@ -36,15 +36,14 @@ test "fixunstfdi" {
36 test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0);36 test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0);
37 test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0);37 test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0);
3838
39 // TODO enable these tests when we can parse f128 float literals39 test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63, 0xFFFFFFFFFFFFFFFF);
40 //test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63, 0xFFFFFFFFFFFFFFFF);40 test__fixunstfdi(0x1.0000000000000002p+63, 0x8000000000000001);
41 //test__fixunstfdi(0x1.0000000000000002p+63, 0x8000000000000001);41 test__fixunstfdi(0x1.0000000000000000p+63, 0x8000000000000000);
42 //test__fixunstfdi(0x1.0000000000000000p+63, 0x8000000000000000);42 test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62, 0x7FFFFFFFFFFFFFFF);
43 //test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62, 0x7FFFFFFFFFFFFFFF);43 test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62, 0x7FFFFFFFFFFFFFFE);
44 //test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62, 0x7FFFFFFFFFFFFFFE);44 test__fixunstfdi(0x1.p+64, 0xFFFFFFFFFFFFFFFF);
45 //test__fixunstfdi(0x1.p+64, 0xFFFFFFFFFFFFFFFF);45
4646 test__fixunstfdi(-0x1.0000000000000000p+63, 0);
47 //test__fixunstfdi(-0x1.0000000000000000p+63, 0);47 test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62, 0);
48 //test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62, 0);48 test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62, 0);
49 //test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62, 0);
50}49}
std/special/compiler_rt/fixunstfsi_test.zig+2-2
...@@ -11,9 +11,9 @@ const inf128 = @bitCast(f128, u128(0x7fff0000000000000000000000000000));...@@ -11,9 +11,9 @@ const inf128 = @bitCast(f128, u128(0x7fff0000000000000000000000000000));
11test "fixunstfsi" {11test "fixunstfsi" {
12 test__fixunstfsi(inf128, 0xffffffff);12 test__fixunstfsi(inf128, 0xffffffff);
13 test__fixunstfsi(0, 0x0);13 test__fixunstfsi(0, 0x0);
14 //TODO test__fixunstfsi(0x1.23456789abcdefp+5, 0x24);14 test__fixunstfsi(0x1.23456789abcdefp+5, 0x24);
15 test__fixunstfsi(0x1.23456789abcdefp-3, 0x0);15 test__fixunstfsi(0x1.23456789abcdefp-3, 0x0);
16 //TODO test__fixunstfsi(0x1.23456789abcdefp+20, 0x123456);16 test__fixunstfsi(0x1.23456789abcdefp+20, 0x123456);
17 test__fixunstfsi(0x1.23456789abcdefp+40, 0xffffffff);17 test__fixunstfsi(0x1.23456789abcdefp+40, 0xffffffff);
18 test__fixunstfsi(0x1.23456789abcdefp+256, 0xffffffff);18 test__fixunstfsi(0x1.23456789abcdefp+256, 0xffffffff);
19 test__fixunstfsi(-0x1.23456789abcdefp+3, 0x0);19 test__fixunstfsi(-0x1.23456789abcdefp+3, 0x0);
std/special/compiler_rt/floatunsitf.zig+1-1
...@@ -17,7 +17,7 @@ pub extern fn __floatunsitf(a: u64) f128 {...@@ -17,7 +17,7 @@ pub extern fn __floatunsitf(a: u64) f128 {
17 const exp = (u64.bit_count - 1) - @clz(a);17 const exp = (u64.bit_count - 1) - @clz(a);
18 const shift = mantissa_bits - @intCast(u7, exp);18 const shift = mantissa_bits - @intCast(u7, exp);
1919
20 // TODO: @bitCast alignment error20 // TODO(#1148): @bitCast alignment error
21 var result align(16) = (@intCast(u128, a) << shift) ^ implicit_bit;21 var result align(16) = (@intCast(u128, a) << shift) ^ implicit_bit;
22 result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits;22 result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits;
2323