Hello!

Currently, x87/SSE constant load splitter converts memory loads and
register copies to supported immediate loads (xorps reg,reg, fld0,
fld1, ...). However, it is cheaper to copy the value from register
than to rematerialize the constant. Also, the compiler differs between
SFmode, DFmode and XFmode x87 load, and currently produces several
separate fld1 insns for loads in different modes. The patch prevents
this situation and leaves float_extends from SFmode load (emitted by
compress_float_constant), which are later converted to either no-op or
plain x87 register moves.

2018-09-10  Uros Bizjak  <ubiz...@gmail.com>

    * config/i386/i386.md (x87/SSE constant load splitter): Use
    memory_operand instead of nonimmediate_operand for input operand
    predicate.

Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN.

Uros.

Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md (revision 264185)
+++ config/i386/i386.md (working copy)
@@ -3833,7 +3833,7 @@

 (define_split
   [(set (match_operand 0 "any_fp_register_operand")
-       (match_operand 1 "nonimmediate_operand"))]
+       (match_operand 1 "memory_operand"))]
   "reload_completed
    && (GET_MODE (operands[0]) == TFmode
        || GET_MODE (operands[0]) == XFmode
@@ -3845,7 +3845,7 @@

 (define_split
   [(set (match_operand 0 "any_fp_register_operand")
-       (float_extend (match_operand 1 "nonimmediate_operand")))]
+       (float_extend (match_operand 1 "memory_operand")))]
   "reload_completed
    && (GET_MODE (operands[0]) == TFmode
        || GET_MODE (operands[0]) == XFmode

Reply via email to