diff options
author | Richard Guenther <rguenther@suse.de> | 2010-07-29 13:45:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-07-29 13:45:47 +0000 |
commit | 950f7f45269b7cb641b9f754b408980a01971ce2 (patch) | |
tree | acaa4c3048af7730f61897ba56c531c20312e416 /gcc | |
parent | 8d0741923dc99b7876f8faafdc238b59a32d0ffc (diff) | |
download | gcc-950f7f45269b7cb641b9f754b408980a01971ce2.zip gcc-950f7f45269b7cb641b9f754b408980a01971ce2.tar.gz gcc-950f7f45269b7cb641b9f754b408980a01971ce2.tar.bz2 |
double-int.h (double_int_and_not): New function.
2010-07-28 Richard Guenther <rguenther@suse.de>
* double-int.h (double_int_and_not): New function.
* combine.c (try_combine): Use it.
* tree-vrp.c (simplify_bit_ops_using_ranges): Likewise.
From-SVN: r162681
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/combine.c | 2 | ||||
-rw-r--r-- | gcc/double-int.h | 12 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 12 |
4 files changed, 22 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e081dc2..40edbc5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-07-28 Richard Guenther <rguenther@suse.de> + + * double-int.h (double_int_and_not): New function. + * combine.c (try_combine): Use it. + * tree-vrp.c (simplify_bit_ops_using_ranges): Likewise. + 2010-07-29 Bernd Schmidt <bernds@codesourcery.com> PR rtl-optimization/42575 diff --git a/gcc/combine.c b/gcc/combine.c index ad96e03..9754b08 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2601,7 +2601,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) i = double_int_and (i, m); m = double_int_lshift (m, offset, HOST_BITS_PER_DOUBLE_INT, false); i = double_int_lshift (i, offset, HOST_BITS_PER_DOUBLE_INT, false); - o = double_int_ior (double_int_and (o, double_int_not (m)), i); + o = double_int_ior (double_int_and_not (o, m), i); combine_merges++; subst_insn = i3; diff --git a/gcc/double-int.h b/gcc/double-int.h index 00ec4ef..b14693d 100644 --- a/gcc/double-int.h +++ b/gcc/double-int.h @@ -158,7 +158,7 @@ static inline double_int double_int_not (double_int a) { a.low = ~a.low; - a.high = ~ a.high; + a.high = ~a.high; return a; } @@ -182,6 +182,16 @@ double_int_and (double_int a, double_int b) return a; } +/* Returns A & ~B. */ + +static inline double_int +double_int_and_not (double_int a, double_int b) +{ + a.low &= ~b.low; + a.high &= ~b.high; + return a; +} + /* Returns A ^ B. */ static inline double_int diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index fbb549f..05fa186 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -6953,15 +6953,13 @@ simplify_bit_ops_using_ranges (gimple_stmt_iterator *gsi, gimple stmt) switch (gimple_assign_rhs_code (stmt)) { case BIT_AND_EXPR: - mask = double_int_and (may_be_nonzero0, - double_int_not (must_be_nonzero1)); + mask = double_int_and_not (may_be_nonzero0, must_be_nonzero1); if (double_int_zero_p (mask)) { op = op0; break; } - mask = double_int_and (may_be_nonzero1, - double_int_not (must_be_nonzero0)); + mask = double_int_and_not (may_be_nonzero1, must_be_nonzero0); if (double_int_zero_p (mask)) { op = op1; @@ -6969,15 +6967,13 @@ simplify_bit_ops_using_ranges (gimple_stmt_iterator *gsi, gimple stmt) } break; case BIT_IOR_EXPR: - mask = double_int_and (may_be_nonzero0, - double_int_not (must_be_nonzero1)); + mask = double_int_and_not (may_be_nonzero0, must_be_nonzero1); if (double_int_zero_p (mask)) { op = op1; break; } - mask = double_int_and (may_be_nonzero1, - double_int_not (must_be_nonzero0)); + mask = double_int_and_not (may_be_nonzero1, must_be_nonzero0); if (double_int_zero_p (mask)) { op = op0; |