Commit 3f12cd9b by Kazu Hirata Committed by Kazu Hirata

pa-protos.h: Remove the prototype for hppa_builtin_saveregs.

	* config/pa/pa-protos.h: Remove the prototype for
	hppa_builtin_saveregs.  Add a prototype for
	pa_return_in_memory.
	* config/pa/pa.c (TARGET_PROMOTE_FUNCTION_RETURN): New.
	(TARGET_PROMOTE_PROTOTYPES): Likewise.
	(TARGET_STRUCT_VALUE_RTX): Likewise.
	(TARGET_RETURN_IN_MEMORY): Likewise.
	(TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise.
	(pa_struct_value_rtx): Likewise.
	(pa_return_in_memory): Likewise.
	* config/pa/pa.h (STRUCT_VALUE_REGNUM): Rename to
	PA_STRUCT_VALUE_REGNUM.
	(INIT_CUMULATIVE_ARGS): Use pa_return_in_memory.
	(EXPAND_BUILTIN_SAVEREGS): Remove.
	(PROMOTE_PROTOTYPES): Likewise.
	(PROMOTE_FUNCTION_RETURN): Likewise.

From-SVN: r76600
parent f289e226
2004-01-25 Kazu Hirata <kazu@cs.umass.edu> 2004-01-25 Kazu Hirata <kazu@cs.umass.edu>
* config/pa/pa-protos.h: Remove the prototype for
hppa_builtin_saveregs. Add a prototype for
pa_return_in_memory.
* config/pa/pa.c (TARGET_PROMOTE_FUNCTION_RETURN): New.
(TARGET_PROMOTE_PROTOTYPES): Likewise.
(TARGET_STRUCT_VALUE_RTX): Likewise.
(TARGET_RETURN_IN_MEMORY): Likewise.
(TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise.
(pa_struct_value_rtx): Likewise.
(pa_return_in_memory): Likewise.
* config/pa/pa.h (STRUCT_VALUE_REGNUM): Rename to
PA_STRUCT_VALUE_REGNUM.
(INIT_CUMULATIVE_ARGS): Use pa_return_in_memory.
(EXPAND_BUILTIN_SAVEREGS): Remove.
(PROMOTE_PROTOTYPES): Likewise.
(PROMOTE_FUNCTION_RETURN): Likewise.
2004-01-25 Kazu Hirata <kazu@cs.umass.edu>
* config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): New. * config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): New.
(TARGET_STRUCT_VALUE_RTX): Likewise. (TARGET_STRUCT_VALUE_RTX): Likewise.
(vax_struct_value_rtx): Likewise. (vax_struct_value_rtx): Likewise.
......
...@@ -133,8 +133,6 @@ extern int insn_refs_are_delayed (rtx); ...@@ -133,8 +133,6 @@ extern int insn_refs_are_delayed (rtx);
/* Prototype function used in macro CONST_OK_FOR_LETTER_P. */ /* Prototype function used in macro CONST_OK_FOR_LETTER_P. */
extern int zdepi_cint_p (unsigned HOST_WIDE_INT); extern int zdepi_cint_p (unsigned HOST_WIDE_INT);
extern struct rtx_def *hppa_builtin_saveregs (void);
extern void override_options (void); extern void override_options (void);
extern void output_ascii (FILE *, const char *, int); extern void output_ascii (FILE *, const char *, int);
extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int *); extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int *);
...@@ -164,4 +162,5 @@ extern rtx function_value (tree, tree); ...@@ -164,4 +162,5 @@ extern rtx function_value (tree, tree);
extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, extern int function_arg_partial_nregs (CUMULATIVE_ARGS *,
enum machine_mode, enum machine_mode,
tree, int); tree, int);
extern bool pa_return_in_memory (tree, tree);
#endif /* TREE_CODE */ #endif /* TREE_CODE */
...@@ -131,6 +131,7 @@ static void pa_asm_out_constructor (rtx, int); ...@@ -131,6 +131,7 @@ static void pa_asm_out_constructor (rtx, int);
static void pa_asm_out_destructor (rtx, int); static void pa_asm_out_destructor (rtx, int);
#endif #endif
static void pa_init_builtins (void); static void pa_init_builtins (void);
static rtx hppa_builtin_saveregs (void);
static void copy_fp_args (rtx) ATTRIBUTE_UNUSED; static void copy_fp_args (rtx) ATTRIBUTE_UNUSED;
static int length_fp_args (rtx) ATTRIBUTE_UNUSED; static int length_fp_args (rtx) ATTRIBUTE_UNUSED;
static struct deferred_plabel *get_plabel (const char *) static struct deferred_plabel *get_plabel (const char *)
...@@ -148,6 +149,7 @@ static void output_deferred_plabels (void); ...@@ -148,6 +149,7 @@ static void output_deferred_plabels (void);
#ifdef HPUX_LONG_DOUBLE_LIBRARY #ifdef HPUX_LONG_DOUBLE_LIBRARY
static void pa_hpux_init_libfuncs (void); static void pa_hpux_init_libfuncs (void);
#endif #endif
static rtx pa_struct_value_rtx (tree, int);
/* Save the operands last given to a compare for use when we /* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */ generate a scc or bcc insn. */
...@@ -261,6 +263,19 @@ static size_t n_deferred_plabels = 0; ...@@ -261,6 +263,19 @@ static size_t n_deferred_plabels = 0;
#define TARGET_INIT_LIBFUNCS pa_hpux_init_libfuncs #define TARGET_INIT_LIBFUNCS pa_hpux_init_libfuncs
#endif #endif
#undef TARGET_PROMOTE_FUNCTION_RETURN
#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX pa_struct_value_rtx
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY pa_return_in_memory
#undef TARGET_EXPAND_BUILTIN_SAVEREGS
#define TARGET_EXPAND_BUILTIN_SAVEREGS hppa_builtin_saveregs
struct gcc_target targetm = TARGET_INITIALIZER; struct gcc_target targetm = TARGET_INITIALIZER;
void void
...@@ -5836,7 +5851,7 @@ function_arg_padding (enum machine_mode mode, tree type) ...@@ -5836,7 +5851,7 @@ function_arg_padding (enum machine_mode mode, tree type)
to determine if stdargs or varargs is used and fill in an initial to determine if stdargs or varargs is used and fill in an initial
va_list. A pointer to this constructor is returned. */ va_list. A pointer to this constructor is returned. */
struct rtx_def * static rtx
hppa_builtin_saveregs (void) hppa_builtin_saveregs (void)
{ {
rtx offset, dest; rtx offset, dest;
...@@ -8748,7 +8763,7 @@ insn_refs_are_delayed (rtx insn) ...@@ -8748,7 +8763,7 @@ insn_refs_are_delayed (rtx insn)
the mode is SF or DF. Then the value is returned in fr4 (32). the mode is SF or DF. Then the value is returned in fr4 (32).
This must perform the same promotions as PROMOTE_MODE, else This must perform the same promotions as PROMOTE_MODE, else
PROMOTE_FUNCTION_RETURN will not work correctly. TARGET_PROMOTE_FUNCTION_RETURN will not work correctly.
Small structures must be returned in a PARALLEL on PA64 in order Small structures must be returned in a PARALLEL on PA64 in order
to match the HP Compiler ABI. */ to match the HP Compiler ABI. */
...@@ -9077,4 +9092,27 @@ pa_globalize_label (FILE *stream, const char *name) ...@@ -9077,4 +9092,27 @@ pa_globalize_label (FILE *stream, const char *name)
fputs (",DATA\n", stream); fputs (",DATA\n", stream);
} }
} }
static rtx
pa_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
int incoming ATTRIBUTE_UNUSED)
{
return gen_rtx_REG (Pmode, PA_STRUCT_VALUE_REGNUM);
}
bool
pa_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
{
/* SOM ABI says that objects larger than 64 bits are returned in memory.
PA64 ABI says that objects larger than 128 bits are returned in memory.
Note, int_size_in_bytes can return -1 if the size of the object is
variable or larger than the maximum value that can be expressed as
a HOST_WIDE_INT. It can also return zero for an empty type. The
simplest way to handle variable and empty types is to pass them in
memory. This avoids problems in defining the boundaries of argument
slots, allocating registers, etc. */
return (int_size_in_bytes (type) > (TARGET_64BIT ? 16 : 8)
|| int_size_in_bytes (type) <= 0);
}
#include "gt-pa.h" #include "gt-pa.h"
...@@ -554,21 +554,9 @@ extern struct rtx_def *hppa_pic_save_rtx (void); ...@@ -554,21 +554,9 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
#define DEFAULT_PCC_STRUCT_RETURN 0 #define DEFAULT_PCC_STRUCT_RETURN 0
/* SOM ABI says that objects larger than 64 bits are returned in memory.
PA64 ABI says that objects larger than 128 bits are returned in memory.
Note, int_size_in_bytes can return -1 if the size of the object is
variable or larger than the maximum value that can be expressed as
a HOST_WIDE_INT. It can also return zero for an empty type. The
simplest way to handle variable and empty types is to pass them in
memory. This avoids problems in defining the boundaries of argument
slots, allocating registers, etc. */
#define RETURN_IN_MEMORY(TYPE) \
(int_size_in_bytes (TYPE) > (TARGET_64BIT ? 16 : 8) \
|| int_size_in_bytes (TYPE) <= 0)
/* Register in which address to store a structure value /* Register in which address to store a structure value
is passed to a function. */ is passed to a function. */
#define STRUCT_VALUE_REGNUM 28 #define PA_STRUCT_VALUE_REGNUM 28
/* Describe how we implement __builtin_eh_return. */ /* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) \ #define EH_RETURN_DATA_REGNO(N) \
...@@ -804,7 +792,7 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; }; ...@@ -804,7 +792,7 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; };
(CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \ (CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \
? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \ ? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \
+ (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \ + (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \
|| RETURN_IN_MEMORY (TREE_TYPE (FNTYPE)))) \ || pa_return_in_memory (TREE_TYPE (FNTYPE), 0))) \
: 0) : 0)
...@@ -1153,13 +1141,6 @@ extern int may_call_alloca; ...@@ -1153,13 +1141,6 @@ extern int may_call_alloca;
#define TRAMPOLINE_ADJUST_ADDRESS(ADDR) \ #define TRAMPOLINE_ADJUST_ADDRESS(ADDR) \
if (!TARGET_64BIT) (ADDR) = memory_address (Pmode, plus_constant ((ADDR), 46)) if (!TARGET_64BIT) (ADDR) = memory_address (Pmode, plus_constant ((ADDR), 46))
/* Emit code for a call to builtin_saveregs. We must emit USE insns which
reference the 4 integer arg registers and 4 fp arg registers.
Ordinarily they are not call used registers, but they are for
_builtin_saveregs, so we must make this explicit. */
#define EXPAND_BUILTIN_SAVEREGS() hppa_builtin_saveregs ()
/* Implement `va_start' for varargs and stdarg. */ /* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \ #define EXPAND_BUILTIN_VA_START(valist, nextarg) \
...@@ -1734,10 +1715,6 @@ do { \ ...@@ -1734,10 +1715,6 @@ do { \
is done just by pretending it is already truncated. */ is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
/* When a prototype says `char' or `short', really pass an `int'. */
#define PROMOTE_PROTOTYPES 1
#define PROMOTE_FUNCTION_RETURN 1
/* Specify the machine mode that pointers have. /* Specify the machine mode that pointers have.
After generation of rtl, the compiler makes no further distinction After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */ between pointers and any other objects of this machine mode. */
......
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