]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
alpha.md (beq): For registers and ints 0-255...
authorRichard Henderson <rth@cygnus.com>
Wed, 1 Oct 1997 05:04:30 +0000 (22:04 -0700)
committerJeff Law <law@gcc.gnu.org>
Wed, 1 Oct 1997 05:04:30 +0000 (23:04 -0600)
        * alpha.md (beq): For registers and ints 0-255, use cmpeq+bne, since
        that pair will dual-issue on the 21164 and plus+beq won't.
        (bne): Likewise for cmpeq+beq.

From-SVN: r15814

gcc/ChangeLog
gcc/config/alpha/alpha.md

index c781c859623520f2aafd8f72d508099d41fe2997..0d6a891072242e53b0e2e13e0a7d2fa7a6bd8905 100644 (file)
@@ -1,3 +1,9 @@
+Tue Sep 30 23:06:43 1997  Richard Henderson  <rth@cygnus.com>
+
+       * alpha.md (beq): For registers and ints 0-255, use cmpeq+bne, since
+       that pair will dual-issue on the 21164 and plus+beq won't.
+       (bne): Likewise for cmpeq+beq.
+
 Tue Sep 30 16:07:58 1997  Jim Wilson  <wilson@cygnus.com>
 
        * except.c (find_exception_handler_labels): Correct argument to free.
index d718481642c22805816a00d6b17e3337cf017fd9..a5f31a37dfe0e8070b931265643dc1a712f9fb16 100644 (file)
   "
 {
   enum machine_mode mode;
-  enum rtx_code compare_code, branch_code;
+  enum rtx_code compare_code = EQ, branch_code = NE;
 
   if (alpha_compare_fp_p)
-    mode = DFmode, compare_code = EQ, branch_code = NE;
+    mode = DFmode;
   else
     {
-      mode = DImode, compare_code = MINUS, branch_code = EQ;
-      if (GET_CODE (alpha_compare_op1) == CONST_INT)
+      mode = DImode;
+      /* We want to use cmpeq/bne when we can, since there is a zero-delay
+        bypass between logicals and br/cmov on the 21164.  But we don't
+        want to force valid immediate constants into registers needlessly.  */
+      if (GET_CODE (alpha_compare_op1) == CONST_INT
+         && ((INTVAL (alpha_compare_op1) >= -0x8000
+              && INTVAL (alpha_compare_op1) < 0)
+             || (INTVAL (alpha_compare_op1) > 0xff
+                 && INTVAL (alpha_compare_op1) < 0x8000)))
        {
-         compare_code = PLUS;
+         compare_code = PLUS, branch_code = EQ;
          alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1));
        }
     }
   "
 {
   enum machine_mode mode;
-  enum rtx_code compare_code, branch_code;
+  enum rtx_code compare_code = EQ, branch_code = EQ;
 
   if (alpha_compare_fp_p)
-    mode = DFmode, compare_code = EQ, branch_code = EQ;
+    mode = DFmode;
   else
     {
-      mode = DImode, compare_code = MINUS, branch_code = NE;
-      if (GET_CODE (alpha_compare_op1) == CONST_INT)
+      mode = DImode;
+      /* We want to use cmpeq/bne when we can, since there is a zero-delay
+        bypass between logicals and br/cmov on the 21164.  But we don't
+        want to force valid immediate constants into registers needlessly.  */
+      if (GET_CODE (alpha_compare_op1) == CONST_INT
+         && ((INTVAL (alpha_compare_op1) >= -0x8000
+              && INTVAL (alpha_compare_op1) < 0)
+             || (INTVAL (alpha_compare_op1) > 0xff
+                 && INTVAL (alpha_compare_op1) < 0x8000)))
        {
-         compare_code = PLUS;
+         compare_code = PLUS, branch_code = NE;
          alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1));
        }
     }