fix target/4041

Richard Henderson rth@twiddle.net
Thu Jun 20 18:21:00 GMT 2002


Need to avoid the m/m alternative for coldfire.


r~


        * config/m68k/m68k.md (zero_extendsidi2): Create expander; duplicate
        pattern and adjust constraints for coldfire.

Index: config/m68k/m68k.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.md,v
retrieving revision 1.49
retrieving revision 1.51
diff -u -p -r1.49 -r1.51
--- config/m68k/m68k.md	2 Apr 2002 08:14:57 -0000	1.49
+++ config/m68k/m68k.md	20 Jun 2002 23:50:13 -0000	1.51
@@ -1525,10 +1525,40 @@
 }")
 
 ;; this is the canonical form for (lshiftrt:DI x 32)
-(define_insn "zero_extendsidi2"
+(define_expand "zero_extendsidi2"
+  [(set (match_operand:DI 0 "nonimmediate_operand" "")
+    (zero_extend:DI (match_operand:SI 1 "general_operand" "")))]
+  ""
+  "")
+
+(define_insn "*zero_extendsidi2_cf"
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=r,m")
+    (zero_extend:DI (match_operand:SI 1 "general_operand" "rm,r")))]
+  "TARGET_5200"
+  "*
+{
+  CC_STATUS_INIT;
+  if (GET_CODE (operands[0]) == REG)
+    operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
+  else if (GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
+    return \"move%.l %1,%0\;clr%.l %0\";
+  else if (GET_CODE (XEXP (operands[0], 0)) == POST_INC)
+    return \"clr%.l %0\;move%.l %1,%0\";
+  else
+    operands[2] = adjust_address (operands[0], SImode, 4);
+  if (GET_CODE (operands[1]) != REG || GET_CODE (operands[2]) != REG
+      || REGNO (operands[1]) != REGNO (operands[2]))
+    output_asm_insn (\"move%.l %1,%2\", operands);
+  if (ADDRESS_REG_P (operands[0]))
+    return \"sub%.l %0,%0\";
+  else
+    return \"clr%.l %0\";
+}")
+
+(define_insn "*zero_extendsidi2"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
     (zero_extend:DI (match_operand:SI 1 "general_operand" "rm")))]
-  ""
+  "!TARGET_5200"
   "*
 {
   CC_STATUS_INIT;



More information about the Gcc-patches mailing list