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
This commit is contained in:
parent
3dba42519e
commit
8deb751450
2 changed files with 22 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue