Commit 28ae9fed by Kazu Hirata Committed by Kazu Hirata

reload1.c (sext_for_mode): Remove.

	* reload1.c (sext_for_mode): Remove.
	(reload_cse_move2add): Use trunc_int_for_mode instead of
	sext_for_mode.
	(move2add_note_store): Likewise.
	Reset register information if we see a set in non-integer
	mode.

From-SVN: r63540
parent c5cf6d7d
2003-02-27 Kazu Hirata <kazu@cs.umass.edu>
* reload1.c (sext_for_mode): Remove.
(reload_cse_move2add): Use trunc_int_for_mode instead of
sext_for_mode.
(move2add_note_store): Likewise.
Reset register information if we see a set in non-integer
mode.
2003-02-27 David Edelsohn <edelsohn@gnu.org> 2003-02-27 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/aix43.h (ASM_SPEC): Only emit -mppc64 if no -mcpu * config/rs6000/aix43.h (ASM_SPEC): Only emit -mppc64 if no -mcpu
......
...@@ -455,8 +455,6 @@ static void move2add_note_store PARAMS ((rtx, rtx, void *)); ...@@ -455,8 +455,6 @@ static void move2add_note_store PARAMS ((rtx, rtx, void *));
static void add_auto_inc_notes PARAMS ((rtx, rtx)); static void add_auto_inc_notes PARAMS ((rtx, rtx));
#endif #endif
static void copy_eh_notes PARAMS ((rtx, rtx)); static void copy_eh_notes PARAMS ((rtx, rtx));
static HOST_WIDE_INT sext_for_mode PARAMS ((enum machine_mode,
HOST_WIDE_INT));
static void failed_reload PARAMS ((rtx, int)); static void failed_reload PARAMS ((rtx, int));
static int set_reload_reg PARAMS ((int, int)); static int set_reload_reg PARAMS ((int, int));
static void reload_cse_simplify PARAMS ((rtx, rtx)); static void reload_cse_simplify PARAMS ((rtx, rtx));
...@@ -9084,25 +9082,6 @@ static int move2add_luid; ...@@ -9084,25 +9082,6 @@ static int move2add_luid;
invalidate all previously collected reg_offset data. */ invalidate all previously collected reg_offset data. */
static int move2add_last_label_luid; static int move2add_last_label_luid;
/* Generate a CONST_INT and force it in the range of MODE. */
static HOST_WIDE_INT
sext_for_mode (mode, value)
enum machine_mode mode;
HOST_WIDE_INT value;
{
HOST_WIDE_INT cval = value & GET_MODE_MASK (mode);
int width = GET_MODE_BITSIZE (mode);
/* If MODE is narrower than HOST_WIDE_INT and CVAL is a negative number,
sign extend it. */
if (width > 0 && width < HOST_BITS_PER_WIDE_INT
&& (cval & ((HOST_WIDE_INT) 1 << (width - 1))) != 0)
cval |= (HOST_WIDE_INT) -1 << width;
return cval;
}
/* ??? We don't know how zero / sign extension is handled, hence we /* ??? We don't know how zero / sign extension is handled, hence we
can't go from a narrower to a wider mode. */ can't go from a narrower to a wider mode. */
#define MODES_OK_FOR_MOVE2ADD(OUTMODE, INMODE) \ #define MODES_OK_FOR_MOVE2ADD(OUTMODE, INMODE) \
...@@ -9169,9 +9148,10 @@ reload_cse_move2add (first) ...@@ -9169,9 +9148,10 @@ reload_cse_move2add (first)
if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0) if (GET_CODE (src) == CONST_INT && reg_base_reg[regno] < 0)
{ {
int success = 0; int success = 0;
rtx new_src = GEN_INT (sext_for_mode (GET_MODE (reg), rtx new_src =
INTVAL (src) GEN_INT (trunc_int_for_mode (INTVAL (src)
- reg_offset[regno])); - 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
...@@ -9250,10 +9230,11 @@ reload_cse_move2add (first) ...@@ -9250,10 +9230,11 @@ reload_cse_move2add (first)
HOST_WIDE_INT added_offset = INTVAL (src3); HOST_WIDE_INT added_offset = INTVAL (src3);
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 = GEN_INT (sext_for_mode (GET_MODE (reg), rtx new_src =
added_offset GEN_INT (trunc_int_for_mode (added_offset
+ base_offset + base_offset
- regno_offset)); - regno_offset,
GET_MODE (reg)));
int success = 0; int success = 0;
if (new_src == const0_rtx) if (new_src == const0_rtx)
...@@ -9270,9 +9251,9 @@ reload_cse_move2add (first) ...@@ -9270,9 +9251,9 @@ reload_cse_move2add (first)
delete_insn (insn); delete_insn (insn);
insn = next; insn = next;
reg_mode[regno] = GET_MODE (reg); reg_mode[regno] = GET_MODE (reg);
reg_offset[regno] = sext_for_mode (GET_MODE (reg), reg_offset[regno] =
added_offset trunc_int_for_mode (added_offset + base_offset,
+ base_offset); GET_MODE (reg));
continue; continue;
} }
} }
...@@ -9342,7 +9323,8 @@ move2add_note_store (dst, set, data) ...@@ -9342,7 +9323,8 @@ move2add_note_store (dst, set, data)
regno += REGNO (dst); regno += REGNO (dst);
if (HARD_REGNO_NREGS (regno, mode) == 1 && GET_CODE (set) == SET if (SCALAR_INT_MODE_P (mode)
&& HARD_REGNO_NREGS (regno, mode) == 1 && GET_CODE (set) == SET
&& GET_CODE (SET_DEST (set)) != ZERO_EXTRACT && GET_CODE (SET_DEST (set)) != ZERO_EXTRACT
&& GET_CODE (SET_DEST (set)) != SIGN_EXTRACT && GET_CODE (SET_DEST (set)) != SIGN_EXTRACT
&& GET_CODE (SET_DEST (set)) != STRICT_LOW_PART) && GET_CODE (SET_DEST (set)) != STRICT_LOW_PART)
...@@ -9437,9 +9419,9 @@ move2add_note_store (dst, set, data) ...@@ -9437,9 +9419,9 @@ move2add_note_store (dst, set, data)
reg_base_reg[regno] = reg_base_reg[base_regno]; reg_base_reg[regno] = reg_base_reg[base_regno];
/* Compute the sum of the offsets or constants. */ /* Compute the sum of the offsets or constants. */
reg_offset[regno] = sext_for_mode (dst_mode, reg_offset[regno] = trunc_int_for_mode (offset
offset + reg_offset[base_regno],
+ reg_offset[base_regno]); dst_mode);
} }
else else
{ {
......
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