diff options
| author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-14 17:50:30 +0000 |
|---|---|---|
| committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-14 17:50:30 +0000 |
| commit | d3ca4dfe37a344912bbd471fe042cb0d2abd7fe7 (patch) | |
| tree | a68ee3f29bb4d7d981224b90d9c08e4f68d48a8a | |
| parent | 5a8d56a084c2a445cd5a53dee2ada6604a94ba8b (diff) | |
| download | ppe42-gcc-d3ca4dfe37a344912bbd471fe042cb0d2abd7fe7.tar.gz ppe42-gcc-d3ca4dfe37a344912bbd471fe042cb0d2abd7fe7.zip | |
* simplify-rtx.c (simplify_binary_operation): Simplify ~y when
(x - (x & y)) is found.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62906 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/simplify-rtx.c | 14 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 09580645f56..a51c6bdfd07 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-02-14 Kazu Hirata <kazu@cs.umass.edu> + + * simplify-rtx.c (simplify_binary_operation): Simplify ~y when + (x - (x & y)) is found. + 2003-02-14 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * configure.in: Fix typo. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index e874c2a2883..9d3b2138784 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1338,11 +1338,17 @@ simplify_binary_operation (code, mode, op0, op1) if (GET_CODE (op1) == AND) { if (rtx_equal_p (op0, XEXP (op1, 0))) - return simplify_gen_binary (AND, mode, op0, - gen_rtx_NOT (mode, XEXP (op1, 1))); + { + tem = simplify_gen_unary (NOT, mode, XEXP (op1, 1), + GET_MODE (XEXP (op1, 1))); + return simplify_gen_binary (AND, mode, op0, tem); + } if (rtx_equal_p (op0, XEXP (op1, 1))) - return simplify_gen_binary (AND, mode, op0, - gen_rtx_NOT (mode, XEXP (op1, 0))); + { + tem = simplify_gen_unary (NOT, mode, XEXP (op1, 0), + GET_MODE (XEXP (op1, 0))); + return simplify_gen_binary (AND, mode, op0, tem); + } } break; |

