(addhi3): Use byte opcodes when the low byte of a word is known to be zero.
authorJames Van Artsdalen <jrv@gnu.org>
Sat, 2 Oct 1993 22:26:01 +0000 (22:26 +0000)
committerJames Van Artsdalen <jrv@gnu.org>
Sat, 2 Oct 1993 22:26:01 +0000 (22:26 +0000)
From-SVN: r5563

gcc/config/i386/i386.md

index f0a0498..6ead794 100644 (file)
   ""
   "*
 {
+  /* ??? what about offsettable memory references? */
+  if (QI_REG_P (operands[0])
+      && GET_CODE (operands[2]) == CONST_INT
+      && (INTVAL (operands[2]) & 0xff) == 0)
+    {
+      CC_STATUS_INIT;
+
+      operands[2] = GEN_INT ((INTVAL (operands[2]) >> 8) & 0xff);
+
+      if (operands[2] == const1_rtx)
+       return AS1 (inc%B0,%h0);
+
+      if (operands[2] == constm1_rtx)
+       return AS1 (dec%B0,%h0);
+
+      return AS2 (add%B0,%2,%h0);
+    }
+
   if (operands[2] == const1_rtx)
     return AS1 (inc%W0,%0);