Commit a02aa5b0 by John David Anglin Committed by John David Anglin

pa-linux.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Define.

	* pa-linux.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Define.
	* pa-protos.h (attr_length_millicode_call, attr_length_call,
	pa_init_machine_status): Declare new global functions.
	* pa.c (void copy_fp_args, length_fp_args, get_plabel): Declare and
	implement new functions.
	(attr_length_millicode_call, attr_length_call): Implement.
	(total_code_bytes): Change type to long.
	(pa_output_function_prologue): Compute total_code_bytes on TARGET_64BIT.
	Reset counter if flag_function_sections.
	(output_deferred_plabels): Set output alignment to 3 for TARGET_64BIT.
	(output_cbranch): Move call to gen_label_rtx.
	(output_millicode_call): Rewrite adding long TARGET_64BIT call, expose
	delay slot in all variants, shorten pc-relative calls.
	(output_call): Rewrite adding long TARGET_64BIT call, improved delay
	slot usage and exposure, various new call variants, and shortened
	sequences for some variants on TARGET_PA_20.
	Miscellaneous format changes.
	* pa.h (total_code_bytes): Change type to long.
	(MASK_LONG_CALLS, TARGET_LONG_CALLS, TARGET_LONG_ABS_CALL,
	TARGET_LONG_PIC_SDIFF_CALL, TARGET_LONG_PIC_PCREL_CALL): Define.
	(TARGET_SWITCHES): Add "-mlong-calls" and "-mno-long-calls" options.
	(EXTRA_CONSTRAINT, GO_IF_LEGITIMATE_ADDRESS,
	LEGITIMIZE_RELOAD_ADDRESS): Don't use long floating point loads and
	stores on TARGET_ELF32.
	*pa.md (define_delay): Allow insns in delay on TARGET_PORTABLE_RUNTIME.
	(unnamed patterns for mulsi3, divsi3, udivsi3, modsi3, umodsi3 and
	canonicalize_funcptr_for_compare expanders): Calculate attribute length
	attr_length_millicode_call().
	(call_internal_symref, call_value_internal_symref): Clobber register 1.
	Calculate attribute length using attr_length_call().
	(call_internal_reg_64bit, call_value_internal_reg_64bit): Move gp load
	to delay slot.
	(sibcall, sibcall_value): Rewrite.
	(sibcall_internal_symref, sibcall_value_internal_symref): Clobber
	register 1.  Use attr_length_call().
	(sibcall_internal_symref_64bit, sibcall_value_internal_symref_64bit):
	New patterns.
	(unamed pattern for canonicalize_funcptr_for_compare): Rewrite.
	* som.h (MEMBER_TYPE_FORCES_BLK): Define.
	* t-pa64 (TARGET_LIBGCC2_CFLAGS): Add "-mlong-calls".
	* doc/invoke.texi (mlong-calls): Document.

From-SVN: r58665
parent 8c081e84
2002-10-30 John David Anglin <dave@hiauly.hia.nrc.ca>
* pa-linux.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Define.
* pa-protos.h (attr_length_millicode_call, attr_length_call,
pa_init_machine_status): Declare new global functions.
* pa.c (void copy_fp_args, length_fp_args, get_plabel): Declare and
implement new functions.
(attr_length_millicode_call, attr_length_call): Implement.
(total_code_bytes): Change type to long.
(pa_output_function_prologue): Compute total_code_bytes on TARGET_64BIT.
Reset counter if flag_function_sections.
(output_deferred_plabels): Set output alignment to 3 for TARGET_64BIT.
(output_cbranch): Move call to gen_label_rtx.
(output_millicode_call): Rewrite adding long TARGET_64BIT call, expose
delay slot in all variants, shorten pc-relative calls.
(output_call): Rewrite adding long TARGET_64BIT call, improved delay
slot usage and exposure, various new call variants, and shortened
sequences for some variants on TARGET_PA_20.
Miscellaneous format changes.
* pa.h (total_code_bytes): Change type to long.
(MASK_LONG_CALLS, TARGET_LONG_CALLS, TARGET_LONG_ABS_CALL,
TARGET_LONG_PIC_SDIFF_CALL, TARGET_LONG_PIC_PCREL_CALL): Define.
(TARGET_SWITCHES): Add "-mlong-calls" and "-mno-long-calls" options.
(EXTRA_CONSTRAINT, GO_IF_LEGITIMATE_ADDRESS,
LEGITIMIZE_RELOAD_ADDRESS): Don't use long floating point loads and
stores on TARGET_ELF32.
*pa.md (define_delay): Allow insns in delay on TARGET_PORTABLE_RUNTIME.
(unnamed patterns for mulsi3, divsi3, udivsi3, modsi3, umodsi3 and
canonicalize_funcptr_for_compare expanders): Calculate attribute length
attr_length_millicode_call().
(call_internal_symref, call_value_internal_symref): Clobber register 1.
Calculate attribute length using attr_length_call().
(call_internal_reg_64bit, call_value_internal_reg_64bit): Move gp load
to delay slot.
(sibcall, sibcall_value): Rewrite.
(sibcall_internal_symref, sibcall_value_internal_symref): Clobber
register 1. Use attr_length_call().
(sibcall_internal_symref_64bit, sibcall_value_internal_symref_64bit):
New patterns.
(unamed pattern for canonicalize_funcptr_for_compare): Rewrite.
* som.h (MEMBER_TYPE_FORCES_BLK): Define.
* t-pa64 (TARGET_LIBGCC2_CFLAGS): Add "-mlong-calls".
* doc/invoke.texi (mlong-calls): Document.
2002-10-30 Roger Sayle <roger@eyesopen.com>
* fold-const.c (fold_binary_op_with_conditional_arg): Improve
......
......@@ -196,6 +196,19 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
/* As well as globalizing the label, we need to encode the label
to ensure a plabel is generated in an indirect call. */
#undef ASM_OUTPUT_EXTERNAL_LIBCALL
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
do \
{ \
if (!FUNCTION_NAME_P (XSTR (FUN, 0))) \
hppa_encode_label (FUN); \
(*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
} \
while (0)
/* Linux always uses gas. */
#undef TARGET_GAS
#define TARGET_GAS 1
......@@ -105,6 +105,8 @@ extern int jump_in_call_delay PARAMS ((rtx));
extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
enum machine_mode, rtx));
extern int hppa_fpstore_bypass_p PARAMS ((rtx, rtx));
extern int attr_length_millicode_call PARAMS ((rtx, int));
extern int attr_length_call PARAMS ((rtx, int));
/* Declare functions defined in pa.c and used in templates. */
......
......@@ -31,7 +31,7 @@ enum cmp_type /* comparison type */
};
/* For long call handling. */
extern unsigned int total_code_bytes;
extern unsigned long total_code_bytes;
/* Which processor to schedule for. */
......@@ -152,6 +152,12 @@ extern int target_flags;
#define TARGET_GNU_LD (target_flags & MASK_GNU_LD)
#endif
/* Force generation of long calls. */
#define MASK_LONG_CALLS 32768
#ifndef TARGET_LONG_CALLS
#define TARGET_LONG_CALLS (target_flags & MASK_LONG_CALLS)
#endif
#ifndef TARGET_PA_10
#define TARGET_PA_10 (target_flags & (MASK_PA_11 | MASK_PA_20) == 0)
#endif
......@@ -179,6 +185,27 @@ extern int target_flags;
#define TARGET_SOM 0
#endif
/* The following three defines are potential target switches. The current
defines are optimal given the current capabilities of GAS and GNU ld. */
/* Define to a C expression evaluating to true to use long absolute calls.
Currently, only the HP assembler and SOM linker support long absolute
calls. They are used only in non-pic code. */
#define TARGET_LONG_ABS_CALL (TARGET_SOM && !TARGET_GAS)
/* Define to a C expression evaluating to true to use long pic symbol
difference calls. This is a call variant similar to the long pic
pc-relative call. Long pic symbol difference calls are only used with
the HP SOM linker. Currently, only the HP assembler supports these
calls. GAS doesn't allow an arbritrary difference of two symbols. */
#define TARGET_LONG_PIC_SDIFF_CALL (!TARGET_GAS)
/* Define to a C expression evaluating to true to use long pic
pc-relative calls. Long pic pc-relative calls are only used with
GAS. Currently, they are usable for calls within a module but
not for external calls. */
#define TARGET_LONG_PIC_PCREL_CALL 0
/* Macro to define tables used to set the flags. This is a
list in braces of target switches with each switch being
{ "NAME", VALUE, "HELP_STRING" }. VALUE is the bits to set,
......@@ -237,6 +264,10 @@ extern int target_flags;
N_("Generate code for huge switch statements") }, \
{ "no-big-switch", -MASK_BIG_SWITCH, \
N_("Do not generate code for huge switch statements") }, \
{ "long-calls", MASK_LONG_CALLS, \
N_("Always generate long calls") }, \
{ "no-long-calls", -MASK_LONG_CALLS, \
N_("Generate long calls only when needed") }, \
{ "linker-opt", 0, \
N_("Enable linker optimizations") }, \
SUBTARGET_SWITCHES \
......@@ -1193,8 +1224,14 @@ extern int may_call_alloca;
/* Using DFmode forces only short displacements \
to be recognized as valid in reg+d addresses. \
However, this is not necessary for PA2.0 since\
it has long FP loads/stores. */ \
it has long FP loads/stores. \
\
FIXME: the ELF32 linker clobbers the LSB of \
the FP register number in {fldw,fstw} insns. \
Thus, we only allow long FP loads/stores on \
TARGET_64BIT. */ \
&& memory_address_p ((TARGET_PA_20 \
&& !TARGET_ELF32 \
? GET_MODE (OP) \
: DFmode), \
XEXP (OP, 0)) \
......@@ -1300,7 +1337,7 @@ extern int may_call_alloca;
if (GET_CODE (index) == CONST_INT \
&& ((INT_14_BITS (index) \
&& (TARGET_SOFT_FLOAT \
|| (TARGET_PA_20 \
|| (TARGET_PA_20 \
&& ((MODE == SFmode \
&& (INTVAL (index) % 4) == 0)\
|| (MODE == DFmode \
......@@ -1327,6 +1364,7 @@ extern int may_call_alloca;
/* We can allow symbolic LO_SUM addresses\
for PA2.0. */ \
|| (TARGET_PA_20 \
&& !TARGET_ELF32 \
&& GET_CODE (XEXP (X, 1)) != CONST_INT)\
|| ((MODE) != SFmode \
&& (MODE) != DFmode))) \
......@@ -1340,6 +1378,7 @@ extern int may_call_alloca;
/* We can allow symbolic LO_SUM addresses\
for PA2.0. */ \
|| (TARGET_PA_20 \
&& !TARGET_ELF32 \
&& GET_CODE (XEXP (X, 1)) != CONST_INT)\
|| ((MODE) != SFmode \
&& (MODE) != DFmode))) \
......@@ -1354,7 +1393,7 @@ extern int may_call_alloca;
&& REG_OK_FOR_BASE_P (XEXP (X, 0)) \
&& GET_CODE (XEXP (X, 1)) == UNSPEC \
&& (TARGET_SOFT_FLOAT \
|| TARGET_PA_20 \
|| (TARGET_PA_20 && !TARGET_ELF32) \
|| ((MODE) != SFmode \
&& (MODE) != DFmode))) \
goto ADDR; \
......@@ -1386,7 +1425,7 @@ do { \
rtx new, temp = NULL_RTX; \
\
mask = (GET_MODE_CLASS (MODE) == MODE_FLOAT \
? (TARGET_PA_20 ? 0x3fff : 0x1f) : 0x3fff); \
? (TARGET_PA_20 && !TARGET_ELF32 ? 0x3fff : 0x1f) : 0x3fff); \
\
if (optimize \
&& GET_CODE (AD) == PLUS) \
......
......@@ -371,3 +371,7 @@ do { \
on the location of the GCC tool directory. The downside is GCC
cannot be moved after installation using a symlink. */
#define ALWAYS_STRIP_DOTDOT 1
/* Aggregates with a single float or double field should be passed and
returned in the general registers. */
#define MEMBER_TYPE_FORCES_BLK(FIELD, MODE) (MODE==SFmode || MODE==DFmode)
TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1
TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1 -mlong-calls
LIB2FUNCS_EXTRA=quadlib.c
......
......@@ -508,7 +508,7 @@ in the following sections.
-march=@var{architecture-type} @gol
-mbig-switch -mdisable-fpregs -mdisable-indexing @gol
-mfast-indirect-calls -mgas -mgnu-ld -mhp-ld @gol
-mjump-in-delay -mlinker-opt @gol
-mjump-in-delay -mlinker-opt -mlong-calls @gol
-mlong-load-store -mno-big-switch -mno-disable-fpregs @gol
-mno-disable-indexing -mno-fast-indirect-calls -mno-gas @gol
-mno-jump-in-delay -mno-long-load-store @gol
......@@ -8094,6 +8094,33 @@ configure option, gcc's program search path, and finally by the user's
@env{PATH}. The linker used by GCC can be printed using @samp{which
`gcc -print-prog-name=ld`}.
@item -mlong-calls
@opindex mno-long-calls
Generate code that uses long call sequences. This ensures that a call
is always able to reach linker generated stubs. The default is to generate
long calls only when the distance from the call site to the beginning
of the function or translation unit, as the case may be, exceeds a
predefined limit set by the branch type being used. The limits for
normal calls are 7,600,000 and 240,000 bytes, respectively for the
PA 2.0 and PA 1.X architectures. Sibcalls are always limited at
240,000 bytes.
Distances are measured from the beginning of functions when using the
@option{-ffunction-sections} option, or when using the @option{-mgas}
and @option{-mno-portable-runtime} options together under HP-UX with
the SOM linker.
It is normally not desirable to use this option as it will degrade
performance. However, it may be useful in large applications,
particularly when partial linking is used to build the application.
The types of long calls used depends on the capabilities of the
assembler and linker, and the type of code being generated. The
impact on systems that support long absolute calls, and long pic
symbol-difference or pc-relative calls should be relatively small.
However, an indirect call is used on 32-bit ELF systems in pic code
and it is quite long.
@end table
@node Intel 960 Options
......
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