diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-27 07:29:21 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-27 07:29:21 +0000 |
commit | ba8dfb0890200c952076430f29086b90a95e21bd (patch) | |
tree | 4aa113c1bf28b09947ed8356c4d508a5ad73380f /gcc/simplify-rtx.c | |
parent | 05f3e2cd715285fea8b22747bbad7aab7148fd49 (diff) | |
download | gcc-ba8dfb0890200c952076430f29086b90a95e21bd.tar.gz |
* rtl.h (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
from 3 x MAX_MACHINE_MODE.
(CONSTM1_RTX): Define.
* emit-rtl.c (const_tiny_rtx): Change into array of 4 x MAX_MACHINE_MODE
from 3 x MAX_MACHINE_MODE.
(gen_rtx_CONST_VECTOR): Use CONSTM1_RTX if all inner constants are
CONSTM1_RTX.
(init_emit_once): Initialize CONSTM1_RTX for MODE_INT and
MODE_VECTOR_INT modes.
* simplify-rtx.c (simplify_binary_operation_1) <case IOR, XOR, AND>:
Optimize if one operand is CONSTM1_RTX.
* config/i386/i386.c (ix86_expand_sse_movcc): Optimize mask ? -1 : x
into mask | x.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179238 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index d81e3a6282c..13016169859 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -2431,9 +2431,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, case IOR: if (trueop1 == CONST0_RTX (mode)) return op0; - if (CONST_INT_P (trueop1) - && ((UINTVAL (trueop1) & GET_MODE_MASK (mode)) - == GET_MODE_MASK (mode))) + if (INTEGRAL_MODE_P (mode) && trueop1 == CONSTM1_RTX (mode)) return op1; if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0)) return op0; @@ -2573,9 +2571,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, case XOR: if (trueop1 == CONST0_RTX (mode)) return op0; - if (CONST_INT_P (trueop1) - && ((UINTVAL (trueop1) & GET_MODE_MASK (mode)) - == GET_MODE_MASK (mode))) + if (INTEGRAL_MODE_P (mode) && trueop1 == CONSTM1_RTX (mode)) return simplify_gen_unary (NOT, mode, op0, mode); if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0) @@ -2721,6 +2717,8 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, case AND: if (trueop1 == CONST0_RTX (mode) && ! side_effects_p (op0)) return trueop1; + if (INTEGRAL_MODE_P (mode) && trueop1 == CONSTM1_RTX (mode)) + return op0; if (HWI_COMPUTABLE_MODE_P (mode)) { HOST_WIDE_INT nzop0 = nonzero_bits (trueop0, mode); |