aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-09-18 11:39:03 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-09-18 11:39:03 -0700
commit9f8e169eb7a21b2f374df31dd32beef667676a13 (patch)
treee5368a85baba02b2ff951b82f3c658f9d223df6c /gcc
parent1f3f36d154896f68c1c35420121782ed236da177 (diff)
downloadgcc-9f8e169eb7a21b2f374df31dd32beef667676a13.zip
gcc-9f8e169eb7a21b2f374df31dd32beef667676a13.tar.gz
gcc-9f8e169eb7a21b2f374df31dd32beef667676a13.tar.bz2
combine.c (simplify_comparison): Shift a NOT out of a single bit test.
* combine.c (simplify_comparison): Shift a NOT out of a single bit test. From-SVN: r36508
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/combine.c15
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ec5c663..047adf8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2000-09-18 Richard Henderson <rth@cygnus.com>
+ * combine.c (simplify_comparison): Shift a NOT out of a single
+ bit test.
+
* combine.c (if_then_else_cond): Canonicalize BImode true to
STORE_FLAG_VALUE.
* explow.c (trunc_int_for_mode): Likewise.
diff --git a/gcc/combine.c b/gcc/combine.c
index b8ac09b..a498b58 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10811,6 +10811,21 @@ simplify_comparison (code, pop0, pop1)
continue;
}
+ /* Convert (ne (and (lshiftrt (not X)) 1) 0) to
+ (eq (and (lshiftrt X) 1) 0). */
+ if (const_op == 0 && equality_comparison_p
+ && XEXP (op0, 1) == const1_rtx
+ && GET_CODE (XEXP (op0, 0)) == LSHIFTRT
+ && GET_CODE (XEXP (XEXP (op0, 0), 0)) == NOT)
+ {
+ op0 = simplify_and_const_int
+ (op0, mode, gen_rtx_combine (LSHIFTRT, mode,
+ XEXP (XEXP (XEXP (op0, 0), 0), 0),
+ XEXP (XEXP (op0, 0), 1)),
+ (HOST_WIDE_INT) 1);
+ code = (code == NE ? EQ : NE);
+ continue;
+ }
break;
case ASHIFT: