]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
combine.c (simplify_comparison): Convert (ne (and (not X) 1) 0) to (eq (and X 1) 0).
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 13 Jul 2003 19:03:28 +0000 (19:03 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 13 Jul 2003 19:03:28 +0000 (19:03 +0000)
* combine.c (simplify_comparison): Convert (ne (and (not X) 1) 0)
to (eq (and X 1) 0).

From-SVN: r69300

gcc/ChangeLog
gcc/combine.c

index e94b4c0e517a06b3259e086be5090aeb61a705c0..0da79711c1e67c07814665d5eccaec687a2fa4c2 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-13  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * combine.c (simplify_comparison): Convert (ne (and (not X) 1) 0)
+       to (eq (and X 1) 0).
+
 2003-07-13  Andreas Jaeger  <aj@suse.de>
 
        * config.gcc: Add pmmintrin.h for x86_64-*-*.
index 499e7b992cc86289dd23a52d3533ad2750602192..3c3172b0835bf909f3675c42dcedf1e16da02ee7 100644 (file)
@@ -11059,6 +11059,17 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
                }
            }
 
+         /* Convert (ne (and (not X) 1) 0) to (eq (and X 1) 0).  */
+         if (const_op == 0 && equality_comparison_p
+             && XEXP (op0, 1) == const1_rtx
+             && GET_CODE (XEXP (op0, 0)) == NOT)
+           {
+             op0 = simplify_and_const_int
+               (op0, mode, XEXP (XEXP (op0, 0), 0), (HOST_WIDE_INT) 1);
+             code = (code == NE ? EQ : NE);
+             continue;
+           }
+
          /* Convert (ne (and (lshiftrt (not X)) 1) 0) to
             (eq (and (lshiftrt X) 1) 0).  */
          if (const_op == 0 && equality_comparison_p