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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-12-08
                 CC|                            |jgreenhalgh at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Looks like the effect of excess_precision changes.

In i386.h, we define:

/* Whether to allow x87 floating-point arithmetic on MODE (one of
   SFmode, DFmode and XFmode) in the current excess precision
   configuration.  */
#define X87_ENABLE_ARITH(MODE) \
  (flag_excess_precision == EXCESS_PRECISION_FAST || (MODE) == XFmode)

/* Likewise, whether to allow direct conversions from integer mode
   IMODE (HImode, SImode or DImode) to MODE.  */
#define X87_ENABLE_FLOAT(MODE, IMODE)                   \
  (flag_excess_precision == EXCESS_PRECISION_FAST       \
   || (MODE) == XFmode                                  \
   || ((MODE) == DFmode && (IMODE) == SImode)           \
   || (IMODE) == HImode)

and relevant pattern in i386.md:

(define_insn "*fop_<mode>_comm"
  [(set (match_operand:MODEF 0 "register_operand" "=f,x,v")
        (match_operator:MODEF 3 "binary_fp_operator"
          [(match_operand:MODEF 1 "nonimmediate_operand" "%0,0,v")
           (match_operand:MODEF 2 "nonimmediate_operand" "fm,xm,vm")]))]
  "((SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
    || (TARGET_80387 && X87_ENABLE_ARITH (<MODE>mode)))
   && COMMUTATIVE_ARITH_P (operands[3])
   && !(MEM_P (operands[1]) && MEM_P (operands[2]))"

The testcase generates the insn from ix86_emit_i387_round, where
flag_excess_precision is set to EXCESS_PRECISION_STANDARD.

IMO, we want to set flag_excess_precision to EXCESS_PRECISION_FAST for
-ffast-math.

Confirmed, CC author of the patch.

Reply via email to