From fb874aed33e9a6026e1753fd1a67aba575d77e2d Mon Sep 17 00:00:00 2001 From: bonzini Date: Thu, 27 May 2004 08:28:31 +0000 Subject: 2004-05-25 Paolo Bonzini * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82317 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/simplify-rtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/simplify-rtx.c') diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 0bef69e986f..fb80219155c 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) -- cgit v1.2.3