diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2004-05-27 08:28:31 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gcc.gnu.org> | 2004-05-27 08:28:31 +0000 |
commit | dce1438a65f25cceffec22d53d41ea35ee422673 (patch) | |
tree | c7ecfdfb81b14955672d885852ac8aa682ee7655 /gcc/simplify-rtx.c | |
parent | 42f806e5a0bbc3f5a02394893343e7e6ce1e94f2 (diff) | |
download | gcc-dce1438a65f25cceffec22d53d41ea35ee422673.zip gcc-dce1438a65f25cceffec22d53d41ea35ee422673.tar.gz gcc-dce1438a65f25cceffec22d53d41ea35ee422673.tar.bz2 |
combine.c (gen_binary): Remove.
2004-05-25 Paolo Bonzini <bonzini@gnu.org>
* combine.c (gen_binary): Remove.
(known_cond, simplify_shift_const
find_split_point, combine_simplify_rtx,
simplify_if_then_else, simplify_set,
simplify_logical, expand_field_assignment,
extract_left_shift, force_to_mode,
if_then_else_cond, apply_distributive_law,
simplify_and_const_int, simplify_shift_const,
gen_lowpart_for_combine, simplify_comparison,
reversed_comparison): Replace with
simplify_gen_binary, simplify_gen_relational or
distribute_and_simplify_rtx.
(distribute_and_simplify_rtx): New function.
* simplify-rtx.c (simplify_binary_operation):
Use nonzero_bits to simplify ANDs where we are
turning off bits already known to be off in OP0.
From-SVN: r82317
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 0bef69e..fb80219 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1844,9 +1844,11 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode, case AND: if (trueop1 == const0_rtx && ! side_effects_p (op0)) return const0_rtx; + /* If we are turning off bits already known off in OP0, we need + not do an AND. */ if (GET_CODE (trueop1) == CONST_INT - && ((INTVAL (trueop1) & GET_MODE_MASK (mode)) - == GET_MODE_MASK (mode))) + && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT + && (nonzero_bits (trueop0, mode) & ~INTVAL (trueop1)) == 0) return op0; if (trueop0 == trueop1 && ! side_effects_p (op0) && GET_MODE_CLASS (mode) != MODE_CC) |