[Bug target/46080] [4.4/4.5/4.6 Regression] incorrect precision of sqrtf builtin for x87 arithmetic (-mfpmath=387)

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 20 10:46:00 GMT 2010


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46080

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-10-20 10:46:14 UTC ---
That depends on the register allocation, whether the result of fsqrt needs to
be flushed into memory or can stay in the i387 register stack.  In the former
case it gets rounded from long double to float, in the latter case it doesn't.

OT, I wonder about:
  /* Test the result; if it is NaN, set errno=EDOM because
     the argument was not in the domain.  */
  do_compare_rtx_and_jump (target, target, EQ, 0, GET_MODE (target),
                           NULL_RTX, NULL_RTX, lab,
                           /* The jump is very likely.  */
                           REG_BR_PROB_BASE - (REG_BR_PROB_BASE / 2000 - 1));
Why do we use (EQ target target) here instead of (ORDERED target target)?
At least on i?87 the latter is cheaper than the former, we eventually simplify
it, but it would be IMHO better to avoid generating useless rtx when the
comparison often needs to be split into ORDERED && UNEQ.



More information about the Gcc-bugs mailing list