summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 29dfd15cc9f..474998dd29b 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2669,23 +2669,15 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
offset = -1;
}
- if (offset >= 0
- && (GET_MODE_PRECISION (GET_MODE (SET_DEST (temp)))
- <= HOST_BITS_PER_DOUBLE_INT))
+ if (offset >= 0)
{
- double_int m, o, i;
+ wide_int o;
rtx inner = SET_SRC (PATTERN (i3));
rtx outer = SET_SRC (temp);
-
- o = rtx_to_double_int (outer);
- i = rtx_to_double_int (inner);
-
- m = double_int::mask (width);
- i &= m;
- m = m.llshift (offset, HOST_BITS_PER_DOUBLE_INT);
- i = i.llshift (offset, HOST_BITS_PER_DOUBLE_INT);
- o = o.and_not (m) | i;
-
+
+ o = (wide_int (std::make_pair (outer, GET_MODE (SET_DEST (temp))))
+ .insert (std::make_pair (inner, GET_MODE (dest)),
+ offset, width));
combine_merges++;
subst_insn = i3;
subst_low_luid = DF_INSN_LUID (i2);
@@ -2696,8 +2688,8 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
/* Replace the source in I2 with the new constant and make the
resulting insn the new pattern for I3. Then skip to where we
validate the pattern. Everything was set up above. */
- SUBST (SET_SRC (temp),
- immed_double_int_const (o, GET_MODE (SET_DEST (temp))));
+ SUBST (SET_SRC (temp),
+ immed_wide_int_const (o, GET_MODE (SET_DEST (temp))));
newpat = PATTERN (i2);
@@ -5112,7 +5104,7 @@ subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy)
if (! x)
x = gen_rtx_CLOBBER (mode, const0_rtx);
}
- else if (CONST_INT_P (new_rtx)
+ else if (CONST_SCALAR_INT_P (new_rtx)
&& GET_CODE (x) == ZERO_EXTEND)
{
x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),