diff options
author | Torbjorn Granlund <tege@gnu.org> | 1994-11-17 23:31:20 +0000 |
---|---|---|
committer | Torbjorn Granlund <tege@gnu.org> | 1994-11-17 23:31:20 +0000 |
commit | 29d72c4b69a50992879a0d8c349b76e9ab136d45 (patch) | |
tree | f42b01a7bad7022f724bea094fc0e47e0d20fffb | |
parent | b76f773b543a91d50e21b1a3417a01505bedad3e (diff) | |
download | gcc-29d72c4b69a50992879a0d8c349b76e9ab136d45.zip gcc-29d72c4b69a50992879a0d8c349b76e9ab136d45.tar.gz gcc-29d72c4b69a50992879a0d8c349b76e9ab136d45.tar.bz2 |
(simplify_binary_operation): Do (x - (x & y)) -> (x & ~y).
From-SVN: r8494
-rw-r--r-- | gcc/cse.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -3718,6 +3718,15 @@ simplify_binary_operation (code, mode, op0, op1) /* Don't let a relocatable value get a negative coeff. */ if (GET_CODE (op1) == CONST_INT && GET_MODE (op0) != VOIDmode) return plus_constant (op0, - INTVAL (op1)); + + /* (x - (x & y)) -> (x & ~y) */ + if (GET_CODE (op1) == AND) + { + if (rtx_equal_p (op0, XEXP (op1, 0))) + return cse_gen_binary (AND, mode, op0, gen_rtx (NOT, mode, XEXP (op1, 1))); + if (rtx_equal_p (op0, XEXP (op1, 1))) + return cse_gen_binary (AND, mode, op0, gen_rtx (NOT, mode, XEXP (op1, 0))); + } break; case MULT: |