emit-rtl.c (gen_int_mode): New function.

* emit-rtl.c (gen_int_mode): New function.
        * rtl.h: Prototype for it.
        * combine.c (make_extraction, simplify_comparison), expmed.c
        (store_bit_field, expand_mult_highpart, expand_divmod), expr.c
        (convert_modes, store_field), optabs.c (expand_fix),
        simplify-rtx.c (neg_const_int, simplify_unary_real),

        * config/rs6000/rs6000.c, config/rs6000/rs6000.md:
        Use it instead of GEN_INT (trunc_int_for_mode (...)).

From-SVN: r51030
This commit is contained in:
Lars Brinkhoff 2002-03-19 10:00:43 -08:00 committed by Richard Henderson
parent 09979e6f03
commit 2496c7bd5f
10 changed files with 45 additions and 28 deletions

View File

@ -1,3 +1,15 @@
2002-03-19 Lars Brinkhoff <lars@nocrew.org>
* emit-rtl.c (gen_int_mode): New function.
* rtl.h: Prototype for it.
* combine.c (make_extraction, simplify_comparison), expmed.c
(store_bit_field, expand_mult_highpart, expand_divmod), expr.c
(convert_modes, store_field), optabs.c (expand_fix),
simplify-rtx.c (neg_const_int, simplify_unary_real),
* config/rs6000/rs6000.c, config/rs6000/rs6000.md:
Use it instead of GEN_INT (trunc_int_for_mode (...)).
2002-03-19 Jakub Jelinek <jakub@redhat.com>
PR c/5656
@ -95,8 +107,8 @@
2002-03-18 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.h (PREDICATE_CODES): Add PARALLEL to
any_operand.
* config/rs6000/rs6000.h (PREDICATE_CODES): Add PARALLEL to
any_operand.
2002-03-17 Richard Henderson <rth@redhat.com>

View File

@ -6033,7 +6033,7 @@ make_extraction (mode, inner, pos, pos_rtx, len,
return new;
if (GET_CODE (new) == CONST_INT)
return GEN_INT (trunc_int_for_mode (INTVAL (new), mode));
return gen_int_mode (INTVAL (new), mode);
/* If we know that no extraneous bits are set, and that the high
bit is not set, convert the extraction to the cheaper of
@ -10792,7 +10792,7 @@ simplify_comparison (code, pop0, pop1)
unsigned HOST_WIDE_INT temp = const_op & GET_MODE_MASK (mode);
temp >>= INTVAL (XEXP (op0, 1));
op1 = GEN_INT (trunc_int_for_mode (temp, mode));
op1 = gen_int_mode (temp, mode);
op0 = XEXP (op0, 0);
continue;
}

View File

@ -2177,8 +2177,7 @@ rs6000_emit_move (dest, source, mode)
/* FIXME. This should never happen. */
/* Since it seems that it does, do the safe thing and convert
to a CONST_INT. */
operands[1] =
GEN_INT (trunc_int_for_mode (CONST_DOUBLE_LOW (operands[1]), mode));
operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), mode);
}
if (GET_CODE (operands[1]) == CONST_DOUBLE
&& ! FLOAT_MODE_P (mode)
@ -8312,10 +8311,8 @@ rs6000_emit_eh_toc_restore (stacksize)
bottom_of_stack, stacksize,
NULL_RTX, 1, OPTAB_WIDEN);
emit_move_insn (tocompare,
GEN_INT (trunc_int_for_mode (TARGET_32BIT
? 0x80410014
: 0xE8410028, SImode)));
emit_move_insn (tocompare, gen_int_mode (TARGET_32BIT ? 0x80410014
: 0xE8410028, SImode));
if (insn_after_throw == NULL_RTX)
abort ();

View File

@ -7819,7 +7819,7 @@
else
operands[2] = gen_lowpart (SImode, operands[0]);
operands[3] = GEN_INT (trunc_int_for_mode (l, SImode));
operands[3] = gen_int_mode (l, SImode);
}")
(define_insn "*movsf_hardfloat"
@ -7909,8 +7909,8 @@
operands[2] = operand_subword (operands[0], endian, 0, DFmode);
operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
operands[4] = GEN_INT (trunc_int_for_mode (l[endian], SImode));
operands[5] = GEN_INT (trunc_int_for_mode (l[1 - endian], SImode));
operands[4] = gen_int_mode (l[endian], SImode);
operands[5] = gen_int_mode (l[1 - endian], SImode);
}")
(define_split

View File

@ -355,6 +355,14 @@ gen_rtx_CONST_INT (mode, arg)
return (rtx) *slot;
}
rtx
gen_int_mode (c, mode)
HOST_WIDE_INT c;
enum machine_mode mode;
{
return GEN_INT (trunc_int_for_mode (c, mode));
}
/* CONST_DOUBLEs needs special handling because their length is known
only at run-time. */

View File

@ -656,7 +656,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, total_size)
value1 = gen_lowpart (maxmode, value1);
}
else if (GET_CODE (value) == CONST_INT)
value1 = GEN_INT (trunc_int_for_mode (INTVAL (value), maxmode));
value1 = gen_int_mode (INTVAL (value), maxmode);
else if (!CONSTANT_P (value))
/* Parse phase is supposed to make VALUE's data type
match that of the component reference, which is a type
@ -2789,7 +2789,7 @@ expand_mult_highpart (mode, op0, cnst1, target, unsignedp, max_cost)
if (size > HOST_BITS_PER_WIDE_INT)
abort ();
op1 = GEN_INT (trunc_int_for_mode (cnst1, mode));
op1 = gen_int_mode (cnst1, mode);
wide_op1
= immed_double_const (cnst1,
@ -3273,7 +3273,7 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
if (rem_flag && d < 0)
{
d = abs_d;
op1 = GEN_INT (trunc_int_for_mode (abs_d, compute_mode));
op1 = gen_int_mode (abs_d, compute_mode);
}
if (d == 1)
@ -3312,8 +3312,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
t1 = copy_to_mode_reg (compute_mode, op0);
do_cmp_and_jump (t1, const0_rtx, GE,
compute_mode, label);
expand_inc (t1, GEN_INT (trunc_int_for_mode
(abs_d - 1, compute_mode)));
expand_inc (t1, gen_int_mode (abs_d - 1,
compute_mode));
emit_label (label);
quotient = expand_shift (RSHIFT_EXPR, compute_mode, t1,
build_int_2 (lgup, 0),
@ -3853,8 +3853,7 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
t1 = expand_shift (RSHIFT_EXPR, compute_mode, op0,
build_int_2 (pre_shift, 0), NULL_RTX, unsignedp);
quotient = expand_mult (compute_mode, t1,
GEN_INT (trunc_int_for_mode
(ml, compute_mode)),
gen_int_mode (ml, compute_mode),
NULL_RTX, 0);
insn = get_last_insn ();

View File

@ -1352,7 +1352,7 @@ convert_modes (mode, oldmode, x, unsignedp)
&& (val & ((HOST_WIDE_INT) 1 << (width - 1))))
val |= (HOST_WIDE_INT) (-1) << width;
return GEN_INT (trunc_int_for_mode (val, mode));
return gen_int_mode (val, mode);
}
return gen_lowpart (mode, x);
@ -5150,8 +5150,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, unsignedp, type,
if (unsignedp)
return expand_and (tmode, temp,
GEN_INT (trunc_int_for_mode (width_mask,
tmode)),
gen_int_mode (width_mask, tmode),
NULL_RTX);
count = build_int_2 (GET_MODE_BITSIZE (tmode) - bitsize, 0);

View File

@ -4560,9 +4560,9 @@ expand_fix (to, from, unsignedp)
NULL_RTX, 0, OPTAB_LIB_WIDEN);
expand_fix (to, target, 0);
target = expand_binop (GET_MODE (to), xor_optab, to,
GEN_INT (trunc_int_for_mode
((HOST_WIDE_INT) 1 << (bitsize - 1),
GET_MODE (to))),
gen_int_mode
((HOST_WIDE_INT) 1 << (bitsize - 1),
GET_MODE (to)),
to, 1, OPTAB_LIB_WIDEN);
if (target != to)

View File

@ -1246,6 +1246,8 @@ extern rtx gen_rtx PARAMS ((enum rtx_code,
extern rtvec gen_rtvec PARAMS ((int, ...));
extern rtx copy_insn_1 PARAMS ((rtx));
extern rtx copy_insn PARAMS ((rtx));
extern rtx gen_int_mode PARAMS ((HOST_WIDE_INT,
enum machine_mode));
/* In rtl.c */
extern rtx rtx_alloc PARAMS ((RTX_CODE));

View File

@ -114,7 +114,7 @@ neg_const_int (mode, i)
enum machine_mode mode;
rtx i;
{
return GEN_INT (trunc_int_for_mode (- INTVAL (i), mode));
return gen_int_mode (- INTVAL (i), mode);
}
@ -376,7 +376,7 @@ simplify_unary_real (p)
default:
abort ();
}
args->result = GEN_INT (trunc_int_for_mode (i, args->mode));
args->result = gen_int_mode (i, args->mode);
}
else
{