This is the mail archive of the gcc-patches@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]

Re: AM33: enable inc4 for data registers...


On Apr 23, 2000, Alexandre Oliva <aoliva@cygnus.com> wrote:

> On Apr 22, 2000, Jeffrey A Law <law@cygnus.com> wrote:
>> "inc4" on a data register is always 3 bytes long whereas using an "add"
>> instruction to perform the same operation is only 2 bytes long.

> Good point.  Nevertheless, it's still important to separate the case
> of `x' from the case of `a', because `inc4 a[0-3]' won't modify CC
> whereas `inc4 r[0-7]' will.  I'll post a patch to correct this later
> on.

Here's the patch.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@cygnus.com>

	* config/mn10300/mn10300.md (addsi): `inc4' on address
	registers does not modify cc.

Index: gcc/config/mn10300/mn10300.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mn10300/mn10300.md,v
retrieving revision 1.28
diff -u -r1.28 mn10300.md
--- gcc/config/mn10300/mn10300.md	2000/04/21 21:14:13	1.28
+++ gcc/config/mn10300/mn10300.md	2000/04/21 22:17:20
@@ -768,9 +768,9 @@
   [(set_attr "cc" "none_0hit")])
 
 (define_insn ""
-  [(set (match_operand:SI 0 "register_operand" "=dx,ax,ax,dax,!dax")
-	(plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,dax")
-		 (match_operand:SI 2 "nonmemory_operand" "J,J,L,daxi,dax")))]
+  [(set (match_operand:SI 0 "register_operand" "=dx,a,a,x,dax,!dax")
+	(plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0,dax")
+		 (match_operand:SI 2 "nonmemory_operand" "J,J,L,L,daxi,dax")))]
   "TARGET_AM33"
   "*
 {
@@ -780,10 +780,11 @@
     case 1:
       return \"inc %0\";
     case 2:
-      return \"inc4 %0\";
     case 3:
-      return \"add %2,%0\";
+      return \"inc4 %0\";
     case 4:
+      return \"add %2,%0\";
+    case 5:
       {
 	enum reg_class src1_class, src2_class, dst_class;
 
@@ -842,7 +843,7 @@
       abort();
     }
 }"
-  [(set_attr "cc" "set_zn,none_0hit,none_0hit,set_zn,set_zn")])
+  [(set_attr "cc" "set_zn,none_0hit,none_0hit,set_zn,set_zn,set_zn")])
 
 (define_insn ""
   [(set (match_operand:SI 0 "register_operand" "=dx,ax,ax,dax,!dax")

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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