rs6000: Allow any CC mode in movcc
authorSegher Boessenkool <segher@kernel.crashing.org>
Sun, 10 Nov 2019 11:53:31 +0000 (12:53 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Sun, 10 Nov 2019 11:53:31 +0000 (12:53 +0100)
Sometimes combine wants to do a move in CCFPmode, but we don't currently
handle moves in any CC mode other than CCmode.  Fix that oversight.

* config/rs6000/rs6000.md (CC_any): New mode iterator.
(*movcc_internal1): Rename to...
(*movcc_<mode> for CC_any): ... this.  Support moves of all CC modes.

From-SVN: r278017

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index 280f87804349c80ec335d252775505fa5a64f1a8..a4beddc8ab80b2d7e0bf3b0274ff14db8593cf48 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-10  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * config/rs6000/rs6000.md (CC_any): New mode iterator.
+       (*movcc_internal1): Rename to...
+       (*movcc_<mode> for CC_any): ... this.  Support moves of all CC modes.
+
 2019-11-09  Jan Hubicka  <hubicka@ucw.cz>
 
        * cgraph.h (struct cgraph_node): Add ipcp_clone flag.
index fb18681da5d20738eaa10cc5441f016f5403d3f4..37689bd46b193fb7f3db339244d373c4cec83c3e 100644 (file)
   ""
   "")
 
-(define_insn "*movcc_internal1"
-  [(set (match_operand:CC 0 "nonimmediate_operand"
-                           "=y,x,?y,y,r,r,r,r, r,*c*l,r,m")
-       (match_operand:CC 1 "general_operand"
-                           " y,r, r,O,x,y,r,I,*h,   r,m,r"))]
-  "register_operand (operands[0], CCmode)
-   || register_operand (operands[1], CCmode)"
+(define_mode_iterator CC_any [CC CCUNS CCEQ CCFP])
+
+(define_insn "*movcc_<mode>"
+  [(set (match_operand:CC_any 0 "nonimmediate_operand"
+                               "=y,x,?y,y,r,r,r,r, r,*c*l,r,m")
+       (match_operand:CC_any 1 "general_operand"
+                               " y,r, r,O,x,y,r,I,*h,   r,m,r"))]
+  "register_operand (operands[0], <MODE>mode)
+   || register_operand (operands[1], <MODE>mode)"
   "@
    mcrf %0,%1
    mtcrf 128,%1