Commit 8deb7514 by Richard Henderson Committed by Richard Henderson

combine.c (simplify_and_const_int): Simplify (AND (PLUS X Y) C) if C has only…

combine.c (simplify_and_const_int): Simplify (AND (PLUS X Y) C) if C has only low bits set and doesn't intersect...

        * combine.c (simplify_and_const_int): Simplify (AND (PLUS X Y) C)
        if C has only low bits set and doesn't intersect with X or Y.

From-SVN: r47921
parent 3dba4251
2001-12-11 Richard Henderson <rth@redhat.com>
* combine.c (simplify_and_const_int): Simplify (AND (PLUS X Y) C)
if C has only low bits set and doesn't intersect with X or Y.
Tue Dec 11 23:58:39 EST 2001 John Wehle (john@feith.com)
* basic-block.h (flow_preorder_transversal_compute): Declare.
......
......@@ -7791,6 +7791,23 @@ simplify_and_const_int (x, mode, varop, constop)
simplify_and_const_int (NULL_RTX, GET_MODE (varop),
XEXP (varop, 1), constop))));
/* If VAROP is PLUS, and the constant is a mask of low bite, distribute
the AND and see if one of the operands simplifies to zero. If so, we
may eliminate it. */
if (GET_CODE (varop) == PLUS
&& exact_log2 (constop + 1) >= 0)
{
rtx o0, o1;
o0 = simplify_and_const_int (NULL_RTX, mode, XEXP (varop, 0), constop);
o1 = simplify_and_const_int (NULL_RTX, mode, XEXP (varop, 1), constop);
if (o0 == const0_rtx)
return o1;
if (o1 == const0_rtx)
return o0;
}
/* Get VAROP in MODE. Try to get a SUBREG if not. Don't make a new SUBREG
if we already had one (just check for the simplest cases). */
if (x && GET_CODE (XEXP (x, 0)) == SUBREG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment