aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/fp-bit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/fp-bit.c')
-rw-r--r--gcc/config/fp-bit.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index bdf04ffd312..dbbb8ebb9a3 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -1035,27 +1035,12 @@ _fpdiv_parts (fp_number_type * a,
numerator *= 2;
}
- if (!ROUND_TOWARDS_ZERO && (quotient & GARDMASK) == GARDMSB)
- {
- if (quotient & (1 << NGARDS))
- {
- /* Because we're half way, we would round to even by adding
- GARDROUND + 1, except that's also done in the packing
- function, and rounding twice will lose precision and cause
- the result to be too far off. */
- }
- else if (numerator)
- {
- /* We're a further than half way by the small amount
- corresponding to the bits set in "numerator". Knowing
- that, we round here and not in pack_d, because there we
- don't have "numerator" available anymore. */
- quotient += GARDROUND + 1;
-
- /* Avoid further rounding in pack_d. */
- quotient &= ~(fractype) GARDMASK;
- }
- }
+ /* If we wanted to round here, that would require to take subnormal
+ numbers into account to avoiddouble rounding. Better to just
+ account for any bits beyond our current guard bits by setting the
+ sticky bit. */
+ if (numerator)
+ quotient |= 1;
a->fraction.ll = quotient;
return (a);