Commit bb80db7b by Kazu Hirata Committed by Kazu Hirata

combine.c (simplify_and_const_int): Use gen_int_mode instead of GEN_INT (trunc_int_for_mode (...)).

	* combine.c (simplify_and_const_int): Use gen_int_mode instead
	of GEN_INT (trunc_int_for_mode (...)).
	* loop-iv.c (iv_number_of_iterations): Likewise.
	* postreload.c (reload_cse_move2add): Likewise.
	* simplify-rtx.c (simplify_const_unary_operation,
	simplify_const_binary_operation): Likewise.
	* stor-layout.c (get_mode_bounds): Likewise.

From-SVN: r95935
parent 60b92d70
...@@ -21,6 +21,14 @@ ...@@ -21,6 +21,14 @@
* tree-ssa-pre.c (remove_dead_inserted_code): Likewise. * tree-ssa-pre.c (remove_dead_inserted_code): Likewise.
* tree-ssa.c (kill_redundant_phi_nodes): Likewise. * tree-ssa.c (kill_redundant_phi_nodes): Likewise.
* combine.c (simplify_and_const_int): Use gen_int_mode instead
of GEN_INT (trunc_int_for_mode (...)).
* loop-iv.c (iv_number_of_iterations): Likewise.
* postreload.c (reload_cse_move2add): Likewise.
* simplify-rtx.c (simplify_const_unary_operation,
simplify_const_binary_operation): Likewise.
* stor-layout.c (get_mode_bounds): Likewise.
2005-03-05 Richard Sandiford <rsandifo@redhat.com> 2005-03-05 Richard Sandiford <rsandifo@redhat.com>
* doc/invoke.texi: Document new MIPS -msym32 and -mno-sym32 options. * doc/invoke.texi: Document new MIPS -msym32 and -mno-sym32 options.
......
...@@ -8095,7 +8095,7 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, ...@@ -8095,7 +8095,7 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop,
/* If VAROP is a CONST_INT, then we need to apply the mask in CONSTOP /* If VAROP is a CONST_INT, then we need to apply the mask in CONSTOP
to VAROP and return the new constant. */ to VAROP and return the new constant. */
if (GET_CODE (varop) == CONST_INT) if (GET_CODE (varop) == CONST_INT)
return GEN_INT (trunc_int_for_mode (INTVAL (varop) & constop, mode)); return gen_int_mode (INTVAL (varop) & constop, mode);
/* See what bits may be nonzero in VAROP. Unlike the general case of /* See what bits may be nonzero in VAROP. Unlike the general case of
a call to nonzero_bits, here we don't care about bits outside a call to nonzero_bits, here we don't care about bits outside
......
...@@ -2369,8 +2369,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, ...@@ -2369,8 +2369,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
tmp = simplify_gen_binary (UDIV, mode, tmp1, GEN_INT (d)); tmp = simplify_gen_binary (UDIV, mode, tmp1, GEN_INT (d));
inv = inverse (s, size); inv = inverse (s, size);
inv = trunc_int_for_mode (inv, mode); tmp = simplify_gen_binary (MULT, mode, tmp, gen_int_mode (inv, mode));
tmp = simplify_gen_binary (MULT, mode, tmp, GEN_INT (inv));
desc->niter_expr = simplify_gen_binary (AND, mode, tmp, bound); desc->niter_expr = simplify_gen_binary (AND, mode, tmp, bound);
} }
else else
......
...@@ -1244,10 +1244,8 @@ reload_cse_move2add (rtx first) ...@@ -1244,10 +1244,8 @@ reload_cse_move2add (rtx first)
if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0) if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0)
{ {
rtx new_src = rtx new_src = gen_int_mode (INTVAL (src) - reg_offset[regno],
GEN_INT (trunc_int_for_mode (INTVAL (src) GET_MODE (reg));
- reg_offset[regno],
GET_MODE (reg)));
/* (set (reg) (plus (reg) (const_int 0))) is not canonical; /* (set (reg) (plus (reg) (const_int 0))) is not canonical;
use (set (reg) (reg)) instead. use (set (reg) (reg)) instead.
We don't delete this insn, nor do we convert it into a We don't delete this insn, nor do we convert it into a
...@@ -1284,9 +1282,8 @@ reload_cse_move2add (rtx first) ...@@ -1284,9 +1282,8 @@ reload_cse_move2add (rtx first)
{ {
rtx narrow_reg = gen_rtx_REG (narrow_mode, rtx narrow_reg = gen_rtx_REG (narrow_mode,
REGNO (reg)); REGNO (reg));
rtx narrow_src = rtx narrow_src = gen_int_mode (INTVAL (src),
GEN_INT (trunc_int_for_mode (INTVAL (src), narrow_mode);
narrow_mode));
rtx new_set = rtx new_set =
gen_rtx_SET (VOIDmode, gen_rtx_SET (VOIDmode,
gen_rtx_STRICT_LOW_PART (VOIDmode, gen_rtx_STRICT_LOW_PART (VOIDmode,
...@@ -1335,10 +1332,10 @@ reload_cse_move2add (rtx first) ...@@ -1335,10 +1332,10 @@ reload_cse_move2add (rtx first)
HOST_WIDE_INT base_offset = reg_offset[REGNO (src)]; HOST_WIDE_INT base_offset = reg_offset[REGNO (src)];
HOST_WIDE_INT regno_offset = reg_offset[regno]; HOST_WIDE_INT regno_offset = reg_offset[regno];
rtx new_src = rtx new_src =
GEN_INT (trunc_int_for_mode (added_offset gen_int_mode (added_offset
+ base_offset + base_offset
- regno_offset, - regno_offset,
GET_MODE (reg))); GET_MODE (reg));
int success = 0; int success = 0;
if (new_src == const0_rtx) if (new_src == const0_rtx)
......
...@@ -829,9 +829,7 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode, ...@@ -829,9 +829,7 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
gcc_unreachable (); gcc_unreachable ();
} }
val = trunc_int_for_mode (val, mode); return gen_int_mode (val, mode);
return GEN_INT (val);
} }
/* We can do some operations on integer CONST_DOUBLEs. Also allow /* We can do some operations on integer CONST_DOUBLEs. Also allow
...@@ -2491,8 +2489,7 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode, ...@@ -2491,8 +2489,7 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode,
gcc_unreachable (); gcc_unreachable ();
} }
val = trunc_int_for_mode (val, mode); return gen_int_mode (val, mode);
return GEN_INT (val);
} }
return NULL_RTX; return NULL_RTX;
......
...@@ -2097,8 +2097,8 @@ get_mode_bounds (enum machine_mode mode, int sign, ...@@ -2097,8 +2097,8 @@ get_mode_bounds (enum machine_mode mode, int sign,
max_val = ((unsigned HOST_WIDE_INT) 1 << (size - 1) << 1) - 1; max_val = ((unsigned HOST_WIDE_INT) 1 << (size - 1) << 1) - 1;
} }
*mmin = GEN_INT (trunc_int_for_mode (min_val, target_mode)); *mmin = gen_int_mode (min_val, target_mode);
*mmax = GEN_INT (trunc_int_for_mode (max_val, target_mode)); *mmax = gen_int_mode (max_val, target_mode);
} }
#include "gt-stor-layout.h" #include "gt-stor-layout.h"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment