(make_compound_operation...
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 2 Sep 1992 10:37:38 +0000 (06:37 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 2 Sep 1992 10:37:38 +0000 (06:37 -0400)
(make_compound_operation, case ASHIFTRT): Add new code to
handle (ashiftrt (neg (ashift FOO C1) C2)) just like we currently
handle (ashiftrt (OP (ashiftrt FOO C1) C2) C2).

From-SVN: r2028

gcc/combine.c

index 2af4949e054fb2eb660adaf4e27efc04c3be61af..5d21de343617ae8cc52df736d3c4399810e7a5b3 100644 (file)
@@ -4652,6 +4652,19 @@ make_compound_operation (x, in_code)
                                 code == LSHIFTRT, 0, in_code == COMPARE);
        }
 
+      /* Similarly for (ashiftrt (neg (ashift FOO C1)) C2).  */
+      if (GET_CODE (XEXP (x, 1)) == CONST_INT
+         && GET_CODE (XEXP (x, 0)) == NEG
+         && GET_CODE (XEXP (XEXP (x, 0), 0)) == ASHIFT
+         && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)) == CONST_INT
+         && INTVAL (XEXP (x, 1)) >= INTVAL (XEXP (XEXP (XEXP (x, 0), 0), 1)))
+       new = make_extraction (mode,
+                              gen_unary (GET_CODE (XEXP (x, 0)), mode,
+                                         XEXP (XEXP (XEXP (x, 0), 0), 0)),
+                              (INTVAL (XEXP (x, 1))
+                               - INTVAL (XEXP (XEXP (XEXP (x, 0), 0), 1))),
+                              NULL_RTX, mode_width - INTVAL (XEXP (x, 1)),
+                              code == LSHIFTRT, 0, in_code == COMPARE);
       break;
     }