simplify-rtx.c (simplify_binary_operation): Simplify ~y when (x - (x & y)) is found.
authorKazu Hirata <kazu@cs.umass.edu>
Fri, 14 Feb 2003 17:50:30 +0000 (17:50 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Fri, 14 Feb 2003 17:50:30 +0000 (17:50 +0000)
* simplify-rtx.c (simplify_binary_operation): Simplify ~y when
(x - (x & y)) is found.

From-SVN: r62906

gcc/ChangeLog
gcc/simplify-rtx.c

index 09580645f565fd142ea0f3037919e26722954b1d..a51c6bdfd07574db1658764f8e686cca2d9dd335 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-14  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * simplify-rtx.c (simplify_binary_operation): Simplify ~y when
+       (x - (x & y)) is found.
+
 2003-02-14  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
 
        * configure.in: Fix typo.
index e874c2a2883101d06593429685b131d8edfa645b..9d3b21387842008b8b10b742b8d433ef7b931e46 100644 (file)
@@ -1338,11 +1338,17 @@ simplify_binary_operation (code, mode, op0, op1)
          if (GET_CODE (op1) == AND)
            {
             if (rtx_equal_p (op0, XEXP (op1, 0)))
-              return simplify_gen_binary (AND, mode, op0,
-                                          gen_rtx_NOT (mode, XEXP (op1, 1)));
+              {
+                tem = simplify_gen_unary (NOT, mode, XEXP (op1, 1),
+                                          GET_MODE (XEXP (op1, 1)));
+                return simplify_gen_binary (AND, mode, op0, tem);
+              }
             if (rtx_equal_p (op0, XEXP (op1, 1)))
-              return simplify_gen_binary (AND, mode, op0,
-                                          gen_rtx_NOT (mode, XEXP (op1, 0)));
+              {
+                tem = simplify_gen_unary (NOT, mode, XEXP (op1, 0),
+                                          GET_MODE (XEXP (op1, 0)));
+                return simplify_gen_binary (AND, mode, op0, tem);
+              }
           }
          break;