Add missing fzero/fone cases to DImode move on 32-bit v9 sparc.
authordavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 Oct 2011 22:21:51 +0000 (22:21 +0000)
committerdavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 Oct 2011 22:21:51 +0000 (22:21 +0000)
* config/sparc/sparc.md (*movdi_insn_sp32_v9): Add alternatives for
generating fzero and fone instructions.
(DImode const_int --> reg splitter): Only trigger for integer regs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180352 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/sparc/sparc.md

index 3dc4ba9..be79367 100644 (file)
@@ -1,5 +1,9 @@
 2011-10-23  David S. Miller  <davem@davemloft.net>
 
+       * config/sparc/sparc.md (*movdi_insn_sp32_v9): Add alternatives for
+       generating fzero and fone instructions.
+       (DImode const_int --> reg splitter): Only trigger for integer regs.
+
        * config/sparc/predicates.md (input_operand): Disallow vector
        constants other than 0 and -1.
        * config/sparc/sparc.c (sparc_preferred_reload_class): Return
index c6454f5..fa27bba 100644 (file)
 
 (define_insn "*movdi_insn_sp32_v9"
   [(set (match_operand:DI 0 "nonimmediate_operand"
-                                       "=T,o,T,U,o,r,r,r,?T,?f,?f,?o,?e,?e,?W")
+                                       "=T,o,T,U,o,r,r,r,?T,?f,?f,?o,?e,?e,?W,b,b")
         (match_operand:DI 1 "input_operand"
-                                       " J,J,U,T,r,o,i,r, f, T, o, f, e, W, e"))]
+                                       " J,J,U,T,r,o,i,r, f, T, o, f, e, W, e,J,P"))]
   "! TARGET_ARCH64
    && TARGET_V9
    && (register_operand (operands[0], DImode)
    #
    fmovd\\t%1, %0
    ldd\\t%1, %0
-   std\\t%1, %0"
-  [(set_attr "type" "store,store,store,load,*,*,*,*,fpstore,fpload,*,*,fpmove,fpload,fpstore")
-   (set_attr "length" "*,2,*,*,2,2,2,2,*,*,2,2,*,*,*")
-   (set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*")])
+   std\\t%1, %0
+   fzero\t%0
+   fone\t%0"
+  [(set_attr "type" "store,store,store,load,*,*,*,*,fpstore,fpload,*,*,fpmove,fpload,fpstore,fga,fga")
+   (set_attr "length" "*,2,*,*,2,2,2,2,*,*,2,2,*,*,*,*,*")
+   (set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*,double,double")])
 
 (define_insn "*movdi_insn_sp64"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,m,?e,?e,?W,b,b")
 (define_split
   [(set (match_operand:DI 0 "register_operand" "")
         (match_operand:DI 1 "const_int_operand" ""))]
-  "! TARGET_ARCH64 && reload_completed"
+  "! TARGET_ARCH64
+   && ((GET_CODE (operands[0]) == REG
+        && SPARC_INT_REG_P (REGNO (operands[0])))
+       || (GET_CODE (operands[0]) == SUBREG
+           && GET_CODE (SUBREG_REG (operands[0])) == REG
+           && SPARC_INT_REG_P (REGNO (SUBREG_REG (operands[0])))))
+   && reload_completed"
   [(clobber (const_int 0))]
 {
 #if HOST_BITS_PER_WIDE_INT == 32