diff mbox series

[i386] : Use only memory_operand input operands in x87/SSE constant load splitter

Message ID CAFULd4bgordFQ_uCf0URukbEovYDBZ45s7Y2QKmxdJhMAENtCw@mail.gmail.com
State New
Headers show
Series [i386] : Use only memory_operand input operands in x87/SSE constant load splitter | expand

Commit Message

Uros Bizjak Sept. 10, 2018, 6:57 p.m. UTC
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  <ubizjak@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.
diff mbox series

Patch

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