authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-15 18:14:25+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2021-04-15 18:14:25+02:00
log8e0b2f0e52b195933ae7df9d66f8763fd53b0281
tree217fbb2abcd9c3a4a75b432f64669a8a83105f9e
parentf9481402f0c6f2eb4618bb0385aff18c12912c26

compiler-rt: Fix typo in implementation of fp truncation ops

The problem went unnoticed for years, yay.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/special/compiler_rt/truncXfYf2.zig+1-1
......@@ -122,7 +122,7 @@ fn truncXfYf2(comptime dst_t: type, comptime src_t: type, a: src_t) dst_t {
122122 if (shift > srcSigBits) {
123123 absResult = 0;
124124 } else {
125 const sticky: src_rep_t = significand << @intCast(SrcShift, srcBits - shift);
125 const sticky: src_rep_t = @boolToInt(significand << @intCast(SrcShift, srcBits - shift) != 0);
126126 const denormalizedSignificand: src_rep_t = significand >> @intCast(SrcShift, shift) | sticky;
127127 absResult = @intCast(dst_rep_t, denormalizedSignificand >> (srcSigBits - dstSigBits));
128128 const roundBits: src_rep_t = denormalizedSignificand & roundMask;