rs6000: Allow any CC mode in movcc
diff mbox series

Message ID 8bec8a108504d8c71cfbf3aacbb1754dccbc58c0.1573385587.git.segher@kernel.crashing.org
State New
Headers show
Series
  • rs6000: Allow any CC mode in movcc
Related show

Commit Message

Segher Boessenkool Nov. 10, 2019, 11:40 a.m. UTC
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.

Tested on powerpc64-linux {-m32,-m64}.  Committing to trunk.


Segher


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.

---
 gcc/config/rs6000/rs6000.md | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

Patch
diff mbox series

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 1944abf..0cdfdef 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7220,13 +7220,15 @@  (define_expand "movcc"
   ""
   "")
 
-(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