| author | |
| committer | |
| log | 1eda86e1ad46493a996521b7a0c6bd59133960ae |
| tree | 8e08f487baf83401265da59a7e5147686726454a |
| parent | 06e8c2e5194439ce5b66f18fcf60108604449957 |
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 | |
| 2 | 2 | // and then make the return types of some of these functions the enum instead of c_int |
| 3 | 3 | const LE_LESS = c_int(-1); |
| 4 | 4 | const LE_EQUAL = c_int(0); |
| ... | ... | @@ -56,7 +56,7 @@ pub extern fn __letf2(a: f128, b: f128) c_int { |
| 56 | 56 | LE_GREATER; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | // TODO https://github.com/ziglang/zig/issues/305 | |
| 59 | // TODO https://github.com/ziglang/zig/issues/641 | |
| 60 | 60 | // and then make the return types of some of these functions the enum instead of c_int |
| 61 | 61 | const GE_LESS = c_int(-1); |
| 62 | 62 | const 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 | 44 | // If 0 <= exponent < significandBits, right shift to get the result. |
| 45 | 45 | // Otherwise, shift left. |
| 46 | 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 | 47 | return @intCast(fixuint_t, significand >> @intCast(Log2Int(rep_t), significandBits - exponent)); |
| 51 | 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 | 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 | 36 | test__fixunstfdi(-0x1.FFFFFFFFFFFFFp+62, 0); |
| 37 | 37 | test__fixunstfdi(-0x1.FFFFFFFFFFFFEp+62, 0); |
| 38 | 38 | |
| 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); | |
| 50 | 49 | } |
std/special/compiler_rt/fixunstfsi_test.zig+2-2| ... | ... | @@ -11,9 +11,9 @@ const inf128 = @bitCast(f128, u128(0x7fff0000000000000000000000000000)); |
| 11 | 11 | test "fixunstfsi" { |
| 12 | 12 | test__fixunstfsi(inf128, 0xffffffff); |
| 13 | 13 | test__fixunstfsi(0, 0x0); |
| 14 | //TODO test__fixunstfsi(0x1.23456789abcdefp+5, 0x24); | |
| 14 | test__fixunstfsi(0x1.23456789abcdefp+5, 0x24); | |
| 15 | 15 | test__fixunstfsi(0x1.23456789abcdefp-3, 0x0); |
| 16 | //TODO test__fixunstfsi(0x1.23456789abcdefp+20, 0x123456); | |
| 16 | test__fixunstfsi(0x1.23456789abcdefp+20, 0x123456); | |
| 17 | 17 | test__fixunstfsi(0x1.23456789abcdefp+40, 0xffffffff); |
| 18 | 18 | test__fixunstfsi(0x1.23456789abcdefp+256, 0xffffffff); |
| 19 | 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 | 17 | const exp = (u64.bit_count - 1) - @clz(a); |
| 18 | 18 | const shift = mantissa_bits - @intCast(u7, exp); |
| 19 | 19 | |
| 20 | // TODO: @bitCast alignment error | |
| 20 | // TODO(#1148): @bitCast alignment error | |
| 21 | 21 | var result align(16) = (@intCast(u128, a) << shift) ^ implicit_bit; |
| 22 | 22 | result += (@intCast(u128, exp) + exponent_bias) << mantissa_bits; |
| 23 | 23 |