aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorLars Brinkhoff <lars@nocrew.org>2002-03-19 10:00:43 -0800
committerRichard Henderson <rth@gcc.gnu.org>2002-03-19 10:00:43 -0800
commit2496c7bd5f519bc9334f2a4ad771b4b8c9cba7c7 (patch)
tree03b085deca8da9a691cb5cdc16540f0276bd3595 /gcc
parent09979e6f03b42f800cf39123596e7d4027da9057 (diff)
downloadgcc-2496c7bd5f519bc9334f2a4ad771b4b8c9cba7c7.zip
gcc-2496c7bd5f519bc9334f2a4ad771b4b8c9cba7c7.tar.gz
gcc-2496c7bd5f519bc9334f2a4ad771b4b8c9cba7c7.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/combine.c4
-rw-r--r--gcc/config/rs6000/rs6000.c9
-rw-r--r--gcc/config/rs6000/rs6000.md6
-rw-r--r--gcc/emit-rtl.c8
-rw-r--r--gcc/expmed.c13
-rw-r--r--gcc/expr.c5
-rw-r--r--gcc/optabs.c6
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/simplify-rtx.c4
10 files changed, 45 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 795c75f..fbaee55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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>
diff --git a/gcc/combine.c b/gcc/combine.c
index 7dc4b29..0f17559 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -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;
}
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 8ad9fa5..de4af5d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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 ();
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index f5e27ee..1330361 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -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
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 937bd20..d54baca 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -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. */
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 48a3ef6..d2edd81 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -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 ();
diff --git a/gcc/expr.c b/gcc/expr.c
index ebe05fc..f8a045a 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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);
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 94927b9..2abf673 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -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)
diff --git a/gcc/rtl.h b/gcc/rtl.h
index e8f819c..711f53b 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -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));
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 5fba25c..21012ce 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -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
{