https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81906

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #12 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
[my comment collided with Joseph's, I'm pointing out that one additional
copysign is sufficient under -frounding-math)

I think this expansion works as intended for to-nearest and towards-zero
rounding modes, and swaps upwards and downwards rounding for negative operands.
Which implies that under -frounding-math the approach is fixable by swapping
signs of the 2**52 operands:

  xa = fabs (operand1);
  a2_52 = 2**52;
  [if flag_rounding_math]
    a2_52 = copysign (a2_52, operand1);
  xa = xa + a2_52 - a2_52;
  return copysign (xa, operand1);

Reply via email to