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// TODO https://github.com/ziglang/zig/issues/305
1// TODO https://github.com/ziglang/zig/issues/641
22// and then make the return types of some of these functions the enum instead of c_int
33const LE_LESS = c_int(-1);
44const LE_EQUAL = c_int(0);
......@@ -56,7 +56,7 @@ pub extern fn __letf2(a: f128, b: f128) c_int {
5656 LE_GREATER;
5757}
5858
59// TODO https://github.com/ziglang/zig/issues/305
59// TODO https://github.com/ziglang/zig/issues/641
6060// and then make the return types of some of these functions the enum instead of c_int
6161const GE_LESS = c_int(-1);
6262const 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
4444 // If 0 <= exponent < significandBits, right shift to get the result.
4545 // Otherwise, shift left.
4646 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);
5047 return @intCast(fixuint_t, significand >> @intCast(Log2Int(rep_t), significandBits - exponent));
5148 } else {
52 // TODO this is a workaround for the mysterious "integer cast truncated bits"
53 // happening on the next line
54 @setRuntimeSafety(false);
5549 return @intCast(fixuint_t, significand) << @intCast(Log2Int(fixuint_t), exponent - significandBits);
5650 }
5751}
std/special/compiler_rt/fixunstfdi_test.zig+10-11
......@@ -36,15 +36,14 @@ test "fixunstfdi" {
3636 test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0);
3737 test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0);
3838
39 // TODO enable these tests when we can parse f128 float literals
40 //test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63, 0xFFFFFFFFFFFFFFFF);
41 //test__fixunstfdi(0x1.0000000000000002p+63, 0x8000000000000001);
42 //test__fixunstfdi(0x1.0000000000000000p+63, 0x8000000000000000);
43 //test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62, 0x7FFFFFFFFFFFFFFF);
44 //test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62, 0x7FFFFFFFFFFFFFFE);
45 //test__fixunstfdi(0x1.p+64, 0xFFFFFFFFFFFFFFFF);
46
47 //test__fixunstfdi(-0x1.0000000000000000p+63, 0);
48 //test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62, 0);
49 //test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62, 0);
39 test__fixunstfdi(0x1.FFFFFFFFFFFFFFFEp+63, 0xFFFFFFFFFFFFFFFF);
40 test__fixunstfdi(0x1.0000000000000002p+63, 0x8000000000000001);
41 test__fixunstfdi(0x1.0000000000000000p+63, 0x8000000000000000);
42 test__fixunstfdi(0x1.FFFFFFFFFFFFFFFCp+62, 0x7FFFFFFFFFFFFFFF);
43 test__fixunstfdi(0x1.FFFFFFFFFFFFFFF8p+62, 0x7FFFFFFFFFFFFFFE);
44 test__fixunstfdi(0x1.p+64, 0xFFFFFFFFFFFFFFFF);
45
46 test__fixunstfdi(-0x1.0000000000000000p+63, 0);
47 test__fixunstfdi(-0x1.FFFFFFFFFFFFFFFCp+62, 0);
48 test__fixunstfdi(-0x1.FFFFFFFFFFFFFFF8p+62, 0);
5049}
std/special/compiler_rt/fixunstfsi_test.zig+2-2
......@@ -11,9 +11,9 @@ const inf128 = @bitCast(f128, u128(0x7fff0000000000000000000000000000));
1111test "fixunstfsi" {
1212 test__fixunstfsi(inf128, 0xffffffff);
1313 test__fixunstfsi(0, 0x0);
14 //TODO test__fixunstfsi(0x1.23456789abcdefp+5, 0x24);
14 test__fixunstfsi(0x1.23456789abcdefp+5, 0x24);
1515 test__fixunstfsi(0x1.23456789abcdefp-3, 0x0);
16 //TODO test__fixunstfsi(0x1.23456789abcdefp+20, 0x123456);
16 test__fixunstfsi(0x1.23456789abcdefp+20, 0x123456);
1717 test__fixunstfsi(0x1.23456789abcdefp+40, 0xffffffff);
1818 test__fixunstfsi(0x1.23456789abcdefp+256, 0xffffffff);
1919 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 {
1717 const exp = (u64.bit_count - 1) - @clz(a);
1818 const shift = mantissa_bits - @intCast(u7, exp);
1919
20 // TODO: @bitCast alignment error
20 // TODO(#1148): @bitCast alignment error
2121 var result align(16) = (@intCast(u128, a) << shift) ^ implicit_bit;
2222 result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits;
2323