This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rz@linux-m68k.org: Re: m68k, extendqidi2 problem]


Hi,

sorry, I messed up something in .muttrc so the appended patch
went out only privately to Richard Henderson. 
Richard Henderson gave it already the blessing so please check
it in.

Richard

2004-03-16 Richard Zidlicky <rz@linux-m68k.org>
	* config/m68k/m68k.md: Avoid generating illegal code in extendqidi2

--- Begin Message ---
On Sat, Mar 06, 2004 at 11:27:07AM -0800, Richard Henderson wrote:
> On Sat, Mar 06, 2004 at 12:21:26AM +0100, Richard Zidlicky wrote:
> > It seems we can keep the constraint as is and make a move.w when
> > %1 is ADDRESS_REG_P...
> 
> That seems ok.

here is the patch

--- gcc-3.4-20040218/gcc/config/m68k/m68k.md.rz-extbdi	2004-03-07 23:08:04.000000000 +0100
+++ gcc-3.4-20040218/gcc/config/m68k/m68k.md	2004-03-07 23:32:21.000000000 +0100
@@ -1455,10 +1455,20 @@
 {
   CC_STATUS_INIT;
   operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
-  if (TARGET_68020 || TARGET_COLDFIRE)
-    return "move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
+  if (ADDRESS_REG_P(operands[1]))
+    {
+      if (TARGET_68020 || TARGET_COLDFIRE)
+        return "move%.w %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
+      else
+        return "move%.w %1,%2\;ext%.w %0\;ext%.l %2\;move%.l %2,%0\;smi %0";
+    }
   else
-    return "move%.b %1,%2\;ext%.w %0\;ext%.l %2\;move%.l %2,%0\;smi %0";
+    {
+      if (TARGET_68020 || TARGET_COLDFIRE)
+        return "move%.b %1,%2\;extb%.l %2\;smi %0\;extb%.l %0";
+      else
+        return "move%.b %1,%2\;ext%.w %0\;ext%.l %2\;move%.l %2,%0\;smi %0";
+    }
 })
 
 (define_insn "extendhidi2"




--- End Message ---

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]