Commit a4295210 by John David Anglin Committed by John David Anglin

pa-protos.h (compute_frame_size): Use HOST_WIDE_INT for frame sizes.

	* pa-protos.h (compute_frame_size): Use HOST_WIDE_INT for frame sizes.
	* pa.c (store_reg, store_reg_modify, load_reg, set_reg_plus_d):
	Likewise.  Handle frames larger than 0x7fffffff on 64-bit ports.
	(emit_move_sequence): Check scratch_reg first in various if statements.
	Extend source simplification to handle all 64-bit CONST_INTs.
	(pa_output_function_prologue): Use HOST_WIDE_INT_PRINT_DEC for printing
	frame size.
	(hppa_expand_prologue, hppa_expand_epilogue): Use HOST_WIDE_INT for
	frame offset calculations.
	* pa.h (NEW_HP_ASSEMBLER): Add comment.
	(MAX_LEGIT_64BIT_CONST_INT, MIN_LEGIT_64BIT_CONST_INT,
	LEGITIMATE_64BIT_CONST_INT_P): Define.
	(LEGITIMATE_CONSTANT_P): Use LEGITIMATE_64BIT_CONST_INT_P.  Treat
	any CONST_INT as legitimate during and after reload.
	(VAL_32_BITS_P, INT_32_BITS): Define.
	(LEGITIMIZE_RELOAD_ADDRESS): Handle large frame offsets.

From-SVN: r76234
parent 3e89ed8d
2004-01-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa-protos.h (compute_frame_size): Use HOST_WIDE_INT for frame sizes.
* pa.c (store_reg, store_reg_modify, load_reg, set_reg_plus_d):
Likewise. Handle frames larger than 0x7fffffff on 64-bit ports.
(emit_move_sequence): Check scratch_reg first in various if statements.
Extend source simplification to handle all 64-bit CONST_INTs.
(pa_output_function_prologue): Use HOST_WIDE_INT_PRINT_DEC for printing
frame size.
(hppa_expand_prologue, hppa_expand_epilogue): Use HOST_WIDE_INT for
frame offset calculations.
* pa.h (NEW_HP_ASSEMBLER): Add comment.
(MAX_LEGIT_64BIT_CONST_INT, MIN_LEGIT_64BIT_CONST_INT,
LEGITIMATE_64BIT_CONST_INT_P): Define.
(LEGITIMATE_CONSTANT_P): Use LEGITIMATE_64BIT_CONST_INT_P. Treat
any CONST_INT as legitimate during and after reload.
(VAL_32_BITS_P, INT_32_BITS): Define.
(LEGITIMIZE_RELOAD_ADDRESS): Handle large frame offsets.
2004-01-20 Jan Hubicka <jh@suse.cz>
* emit-rtl.c (verify_rtx_sharing, copy_insn_1,
......
......@@ -137,7 +137,7 @@ extern struct rtx_def *hppa_builtin_saveregs (void);
extern void override_options (void);
extern void output_ascii (FILE *, const char *, int);
extern int compute_frame_size (int, int *);
extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int *);
extern int and_mask_p (unsigned HOST_WIDE_INT);
extern int cint_ok_for_move (HOST_WIDE_INT);
extern void hppa_expand_prologue (void);
......
......@@ -646,7 +646,6 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
to IN. If it can be done directly NO_REGS is returned.
Avoid doing any work for the common case calls. */
#define SECONDARY_RELOAD_CLASS(CLASS,MODE,IN) \
((CLASS == BASE_REG_CLASS && GET_CODE (IN) == REG \
&& REGNO (IN) < FIRST_PSEUDO_REGISTER) \
......@@ -1223,16 +1222,36 @@ extern int may_call_alloca;
|| GET_CODE (X) == HIGH) \
&& (reload_in_progress || reload_completed || ! symbolic_expression_p (X)))
/* Include all constant integers and constant doubles, but not
floating-point, except for floating-point zero.
Reject LABEL_REFs if we're not using gas or the new HP assembler.
/* A C expression that is nonzero if we are using the new HP assembler. */
?!? For now also reject CONST_DOUBLES in 64bit mode. This will need
further work. */
#ifndef NEW_HP_ASSEMBLER
#define NEW_HP_ASSEMBLER 0
#endif
/* The macros below define the immediate range for CONST_INTS on
the 64-bit port. Constants in this range can be loaded in three
instructions using a ldil/ldo/depdi sequence. Constants outside
this range are forced to the constant pool prior to reload. */
#define MAX_LEGIT_64BIT_CONST_INT ((HOST_WIDE_INT) 32 << 31)
#define MIN_LEGIT_64BIT_CONST_INT ((HOST_WIDE_INT) -32 << 31)
#define LEGITIMATE_64BIT_CONST_INT_P(X) \
((X) >= MIN_LEGIT_64BIT_CONST_INT && (X) < MAX_LEGIT_64BIT_CONST_INT)
/* A C expression that is nonzero if X is a legitimate constant for an
immediate operand.
We include all constant integers and constant doubles, but not
floating-point, except for floating-point zero. We reject LABEL_REFs
if we're not using gas or the new HP assembler.
In 64-bit mode, we reject CONST_DOUBLES. We also reject CONST_INTS
that need more than three instructions to load prior to reload. This
limit is somewhat arbitrary. It takes three instructions to load a
CONST_INT from memory but two are memory accesses. It may be better
to increase the allowed range for CONST_INTS. We may also be able
to handle CONST_DOUBLES. */
#define LEGITIMATE_CONSTANT_P(X) \
((GET_MODE_CLASS (GET_MODE (X)) != MODE_FLOAT \
|| (X) == CONST0_RTX (GET_MODE (X))) \
......@@ -1240,8 +1259,8 @@ extern int may_call_alloca;
&& !(TARGET_64BIT && GET_CODE (X) == CONST_DOUBLE) \
&& !(TARGET_64BIT && GET_CODE (X) == CONST_INT \
&& !(HOST_BITS_PER_WIDE_INT <= 32 \
|| (INTVAL (X) >= (HOST_WIDE_INT) -32 << 31 \
&& INTVAL (X) < (HOST_WIDE_INT) 32 << 31) \
|| (reload_in_progress || reload_completed) \
|| LEGITIMATE_64BIT_CONST_INT_P (INTVAL (X)) \
|| cint_ok_for_move (INTVAL (X)))) \
&& !function_label_operand (X, VOIDmode))
......@@ -1425,6 +1444,15 @@ extern int may_call_alloca;
#define VAL_14_BITS_P(X) ((unsigned HOST_WIDE_INT)(X) + 0x2000 < 0x4000)
#define INT_14_BITS(X) VAL_14_BITS_P (INTVAL (X))
#if HOST_BITS_PER_WIDE_INT > 32
#define VAL_32_BITS_P(X) \
((unsigned HOST_WIDE_INT)(X) + ((unsigned HOST_WIDE_INT) 1 << 31) \
< (unsigned HOST_WIDE_INT) 2 << 31)
#else
#define VAL_32_BITS_P(X) 1
#endif
#define INT_32_BITS(X) VAL_32_BITS_P (INTVAL (X))
/* These are the modes that we allow for scaled indexing. */
#define MODE_OK_FOR_SCALED_INDEXING_P(MODE) \
((TARGET_64BIT && (MODE) == DImode) \
......@@ -1557,14 +1585,13 @@ extern int may_call_alloca;
There may be more opportunities to improve code with this hook. */
#define LEGITIMIZE_RELOAD_ADDRESS(AD, MODE, OPNUM, TYPE, IND, WIN) \
do { \
int offset, newoffset, mask; \
long offset, newoffset, mask; \
rtx new, temp = NULL_RTX; \
\
mask = (GET_MODE_CLASS (MODE) == MODE_FLOAT \
? (TARGET_PA_20 && !TARGET_ELF32 ? 0x3fff : 0x1f) : 0x3fff); \
\
if (optimize \
&& GET_CODE (AD) == PLUS) \
if (optimize && GET_CODE (AD) == PLUS) \
temp = simplify_binary_operation (PLUS, Pmode, \
XEXP (AD, 0), XEXP (AD, 1)); \
\
......@@ -1583,16 +1610,14 @@ do { \
else \
newoffset = offset & ~mask; \
\
if (newoffset != 0 \
&& VAL_14_BITS_P (newoffset)) \
if (newoffset != 0 && VAL_14_BITS_P (newoffset)) \
{ \
\
temp = gen_rtx_PLUS (Pmode, XEXP (new, 0), \
GEN_INT (newoffset)); \
AD = gen_rtx_PLUS (Pmode, temp, GEN_INT (offset - newoffset));\
push_reload (XEXP (AD, 0), 0, &XEXP (AD, 0), 0, \
BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, \
(OPNUM), (TYPE)); \
BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, \
(OPNUM), (TYPE)); \
goto WIN; \
} \
} \
......
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