aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2005-02-06 23:33:25 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2005-02-06 23:33:25 +0000
commit1419a8859b3ab56d7d5f9cef4f9df3cf0293e911 (patch)
tree3d829d7408aa98516b8361276ceedb7e0e91c80a
parent706bb773eca8b618b4481e59b9e4c42d53e9efda (diff)
downloadgcc-1419a8859b3ab56d7d5f9cef4f9df3cf0293e911.zip
gcc-1419a8859b3ab56d7d5f9cef4f9df3cf0293e911.tar.gz
gcc-1419a8859b3ab56d7d5f9cef4f9df3cf0293e911.tar.bz2
simplify-rtx.c (simplify_relational_operation_1): Simplify (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0)) into...
* simplify-rtx.c (simplify_relational_operation_1): Simplify (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0)) into just (zero_extract:SI FOO (const_int 1) BAR). Co-Authored-By: Andrew Pinski <pinskia@physics.uc.edu> Co-Authored-By: Paolo Bonzini <paolo.bonzini@lu.unisi.ch> From-SVN: r94684
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/simplify-rtx.c12
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c92e209..4ae512a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-06 Roger Sayle <roger@eyesopen.com>
+ Andrew Pinski <pinskia@physics.uc.edu>
+ Paolo Bonzini <paolo.bonzini@lu.unisi.ch>
+
+ * simplify-rtx.c (simplify_relational_operation_1): Simplify
+ (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0))
+ into just (zero_extract:SI FOO (const_int 1) BAR).
+
2005-02-06 Joseph S. Myers <joseph@codesourcery.com>
* doc/cpp.texi: Include gcc-common.texi. Don't define gcctabopt
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index a1a7747..f23dba7 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -2880,6 +2880,18 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
return simplify_gen_relational (code, mode, cmp_mode, x, c);
}
+ /* (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0))) is
+ the same as (zero_extract:SI FOO (const_int 1) BAR). */
+ if (code == NE
+ && op1 == const0_rtx
+ && GET_MODE_CLASS (mode) == MODE_INT
+ && cmp_mode != VOIDmode
+ && nonzero_bits (op0, cmp_mode) == 1
+ && STORE_FLAG_VALUE == 1)
+ return GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode)
+ ? simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode)
+ : gen_lowpart (mode, op0);
+
return NULL_RTX;
}