summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-27 07:29:21 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-27 07:29:21 +0000
commitba8dfb0890200c952076430f29086b90a95e21bd (patch)
tree4aa113c1bf28b09947ed8356c4d508a5ad73380f /gcc/emit-rtl.c
parent05f3e2cd715285fea8b22747bbad7aab7148fd49 (diff)
downloadgcc-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/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index ee38d3c90b0..dae7669297a 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -93,9 +93,10 @@ static GTY(()) int label_num = 1;
/* We record floating-point CONST_DOUBLEs in each floating-point mode for
the values of 0, 1, and 2. For the integer entries and VOIDmode, we
- record a copy of const[012]_rtx. */
+ record a copy of const[012]_rtx and constm1_rtx. CONSTM1_RTX
+ is set only for MODE_INT and MODE_VECTOR_INT modes. */
-rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
+rtx const_tiny_rtx[4][(int) MAX_MACHINE_MODE];
rtx const_true_rtx;
@@ -5514,6 +5515,8 @@ gen_rtx_CONST_VECTOR (enum machine_mode mode, rtvec v)
return CONST0_RTX (mode);
else if (x == CONST1_RTX (inner))
return CONST1_RTX (mode);
+ else if (x == CONSTM1_RTX (inner))
+ return CONSTM1_RTX (mode);
}
return gen_rtx_raw_CONST_VECTOR (mode, v);
@@ -5674,7 +5677,7 @@ init_emit_once (void)
dconsthalf = dconst1;
SET_REAL_EXP (&dconsthalf, REAL_EXP (&dconsthalf) - 1);
- for (i = 0; i < (int) ARRAY_SIZE (const_tiny_rtx); i++)
+ for (i = 0; i < 3; i++)
{
const REAL_VALUE_TYPE *const r =
(i == 0 ? &dconst0 : i == 1 ? &dconst1 : &dconst2);
@@ -5704,6 +5707,13 @@ init_emit_once (void)
const_tiny_rtx[i][(int) mode] = GEN_INT (i);
}
+ const_tiny_rtx[3][(int) VOIDmode] = constm1_rtx;
+
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ const_tiny_rtx[3][(int) mode] = constm1_rtx;
+
for (mode = GET_CLASS_NARROWEST_MODE (MODE_COMPLEX_INT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
@@ -5726,6 +5736,7 @@ init_emit_once (void)
{
const_tiny_rtx[0][(int) mode] = gen_const_vector (mode, 0);
const_tiny_rtx[1][(int) mode] = gen_const_vector (mode, 1);
+ const_tiny_rtx[3][(int) mode] = gen_const_vector (mode, 3);
}
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);