Commit a9098fd0 by Geoff Keating Committed by Geoffrey Keating

rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): All constants of size no larger than…

rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): All constants of size no larger than a pointer should go in the TOC.

* config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): All
constants of size no larger than a pointer should go in the TOC.
Add 'MODE' parameter.
(LEGITIMIZE_RELOAD_ADDRESS): Add MODE parameter to
ASM_OUTPUT_SPECIAL_POOL_ENTRY_P.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): Likewise.
* config/rs6000/aix.h (SELECT_RTX_SECTION): Likewise.
* config/rs6000/netware.h (SELECT_RTX_SECTION): Likewise.
* config/rs6000/rs6000.c (constant_pool_expr_1): Likewise.
(rs6000_legitimize_address): Likewise.
(rs6000_emit_move): Likewise.
(rs6000_select_rtx_section): Likewise.
(output_toc): Deal properly with outputting small constants like
HImode, and SFmode in 32-bit mode, and DFmode in 64-bit mode.
* config/rs6000/sysv4.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Add
MODE parameter.  Put small constants in the TOC.

* config/rs6000/rs6000.c (easy_fp_constant_p): All constants are
easy in SImode.
(rs6000_emit_move): When reload calls us with an illegitimate
address, exit early.  Move the change_address calls to one place
at the end of the routine.  Merge the SImode and DImode expanders.
When called by reload to put an integer into a FP register, force
it to memory.

* config/rs6000/rs6000.c (struct toc_hash_struct): Add 'key_mode'
field.
(rs6000_hash_constant): Hash mode too.
(toc_hash_function): Allow for key_mode.
(toc_hash_eq): Structures are different if key_mode differs.
(output_toc): Add 'mode' parameter.  Save key_mode.
* config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY):
Pass 'mode' parameter.
* config/rs6000/rs6000-protos.h (output_toc): Add 'mode' param.

From-SVN: r35164
parent 89c01f0e
2000-07-20 Geoff Keating <geoffk@cygnus.com>
* config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): All
constants of size no larger than a pointer should go in the TOC.
Add 'MODE' parameter.
(LEGITIMIZE_RELOAD_ADDRESS): Add MODE parameter to
ASM_OUTPUT_SPECIAL_POOL_ENTRY_P.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): Likewise.
* config/rs6000/aix.h (SELECT_RTX_SECTION): Likewise.
* config/rs6000/netware.h (SELECT_RTX_SECTION): Likewise.
* config/rs6000/rs6000.c (constant_pool_expr_1): Likewise.
(rs6000_legitimize_address): Likewise.
(rs6000_emit_move): Likewise.
(rs6000_select_rtx_section): Likewise.
(output_toc): Deal properly with outputting small constants like
HImode, and SFmode in 32-bit mode, and DFmode in 64-bit mode.
* config/rs6000/sysv4.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Add
MODE parameter. Put small constants in the TOC.
* config/rs6000/rs6000.c (easy_fp_constant_p): All constants are
easy in SImode.
(rs6000_emit_move): When reload calls us with an illegitimate
address, exit early. Move the change_address calls to one place
at the end of the routine. Merge the SImode and DImode expanders.
When called by reload to put an integer into a FP register, force
it to memory.
* config/rs6000/rs6000.c (struct toc_hash_struct): Add 'key_mode'
field.
(rs6000_hash_constant): Hash mode too.
(toc_hash_function): Allow for key_mode.
(toc_hash_eq): Structures are different if key_mode differs.
(output_toc): Add 'mode' parameter. Save key_mode.
* config/rs6000/rs6000.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY):
Pass 'mode' parameter.
* config/rs6000/rs6000-protos.h (output_toc): Add 'mode' param.
* config/rs6000/rs6000.c (output_toc): Use RS6000_OUTPUT_BASENAME
for vtable references.
......
......@@ -234,7 +234,7 @@ toc_section () \
toc entry. */
#define SELECT_RTX_SECTION(MODE, X) \
{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE)) \
toc_section (); \
else \
read_only_private_data_section (); \
......
......@@ -163,7 +163,7 @@ toc_section () \
#undef SELECT_RTX_SECTION
#define SELECT_RTX_SECTION(MODE, X) \
{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE)) \
toc_section (); \
else \
const_section (); \
......
......@@ -86,7 +86,7 @@ extern int ccr_bit PARAMS ((rtx, int));
extern void print_operand PARAMS ((FILE *, rtx, int));
extern void print_operand_address PARAMS ((FILE *, rtx));
extern char * output_cbranch PARAMS ((rtx, const char *, int, rtx));
extern void output_toc PARAMS ((FILE *, rtx, int));
extern void output_toc PARAMS ((FILE *, rtx, int, enum machine_mode));
extern int rs6000_adjust_cost PARAMS ((rtx, rtx, rtx, int));
extern int rs6000_adjust_priority PARAMS ((rtx, int));
extern void rs6000_initialize_trampoline PARAMS ((rtx, rtx, rtx));
......
......@@ -1956,7 +1956,7 @@ do { \
{ \
HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; \
unsigned HOST_WIDE_INT high \
HOST_WIDE_INT high \
= (((val - low) & 0xffffffffu) ^ 0x80000000u) - 0x80000000u; \
\
/* Check for 32-bit overflow. */ \
......@@ -1978,7 +1978,7 @@ do { \
} \
else if (TARGET_TOC \
&& CONSTANT_POOL_EXPR_P (X) \
&& ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (X))) \
&& ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (get_pool_constant (X), MODE)) \
{ \
(X) = create_TOC_reference (X); \
goto WIN; \
......@@ -2359,27 +2359,29 @@ extern int rs6000_trunc_used;
/* Flag to say the TOC is initialized */
extern int toc_initialized;
/* Return non-zero if this entry is to be written into the constant pool
in a special way. We do so if this is a SYMBOL_REF, LABEL_REF or a CONST
containing one of them. If -mfp-in-toc (the default), we also do
this for floating-point constants. We actually can only do this
if the FP formats of the target and host machines are the same, but
we can't check that since not every file that uses
GO_IF_LEGITIMATE_ADDRESS_P includes real.h. */
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
/* Return non-zero if this entry is to be written into the constant
pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
or a CONST containing one of them. If -mfp-in-toc (the default),
we also do this for floating-point constants. We actually can only
do this if the FP formats of the target and host machines are the
same, but we can't check that since not every file that uses
GO_IF_LEGITIMATE_ADDRESS_P includes real.h. We also do this when
we can write the entry into the TOC and the entry is not larger
than a TOC entry. */
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
(TARGET_TOC \
&& (GET_CODE (X) == SYMBOL_REF \
|| (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
|| GET_CODE (X) == LABEL_REF \
|| (! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC) \
&& GET_CODE (X) == CONST_DOUBLE \
&& (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
|| TARGET_POWERPC64))))
#if 0
&& BITS_PER_WORD == HOST_BITS_PER_INT)))
#endif
|| (GET_CODE (X) == CONST_INT \
&& GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
|| (GET_CODE (X) == CONST_DOUBLE \
&& (TARGET_POWERPC64 \
|| TARGET_MINIMAL_TOC \
|| (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
&& ! TARGET_NO_FP_IN_TOC)))))
/* Macro to output a special constant pool entry. Go to WIN if we output
it. Otherwise, it is written the usual way.
......@@ -2387,9 +2389,9 @@ extern int toc_initialized;
On the RS/6000, toc entries are handled this way. */
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY(FILE, X, MODE, ALIGN, LABELNO, WIN) \
{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X)) \
{ if (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (X, MODE)) \
{ \
output_toc (FILE, X, LABELNO); \
output_toc (FILE, X, LABELNO, MODE); \
goto WIN; \
} \
}
......
......@@ -563,12 +563,14 @@ fini_section () \
allow floating point constants in the TOC if -mrelocatable. */
#undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X) \
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
(TARGET_TOC \
&& (GET_CODE (X) == SYMBOL_REF \
|| (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS \
&& GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
|| GET_CODE (X) == LABEL_REF \
|| (GET_CODE (X) == CONST_INT \
&& GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
|| (!TARGET_NO_FP_IN_TOC \
&& !TARGET_RELOCATABLE \
&& GET_CODE (X) == CONST_DOUBLE \
......
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