rs6000.h (FUNCTION_ARG, [...]): Delete.
* config/rs6000/rs6000.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/rs6000/rs6000-protos.h (function_arg_advance): Delete. (function_arg): Delete. (function_arg_boundary): Take a const_tree. * config/rs6000/rs6000.c (function_arg_boundary): Likewise. (rs6000_spe_function_arg): Likewise. (rs6000_parm_start): Likewise. (rs6000_arg_size): Likewise. (rs6000_darwin64_record_arg_advance_recurse): Likewise. (rs6000_darwin64_record_arg): Likewise. Take a bool instead of an int. (rs6000_mixed_function_arg): Likewise. (function_arg): Rename to... (rs6000_function_arg): ...this. (function_arg_advance): Rename to... (rs6000_function_arg_advance_1): ...this (rs6000_function_arg_advance): New function. Call it. (setup_incoming_varargs): Call rs6000_function_arg_advance_1. (rs6000_return_in_memory): Adjust call to rs6000_darwin64_record_arg. (rs6000_function_value): Likewise. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. From-SVN: r163586
This commit is contained in:
parent
da787decc6
commit
7c8232a2e9
|
@ -1,3 +1,27 @@
|
||||||
|
2010-08-27 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* config/rs6000/rs6000.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
|
||||||
|
* config/rs6000/rs6000-protos.h (function_arg_advance): Delete.
|
||||||
|
(function_arg): Delete.
|
||||||
|
(function_arg_boundary): Take a const_tree.
|
||||||
|
* config/rs6000/rs6000.c (function_arg_boundary): Likewise.
|
||||||
|
(rs6000_spe_function_arg): Likewise.
|
||||||
|
(rs6000_parm_start): Likewise.
|
||||||
|
(rs6000_arg_size): Likewise.
|
||||||
|
(rs6000_darwin64_record_arg_advance_recurse): Likewise.
|
||||||
|
(rs6000_darwin64_record_arg): Likewise. Take a bool instead of
|
||||||
|
an int.
|
||||||
|
(rs6000_mixed_function_arg): Likewise.
|
||||||
|
(function_arg): Rename to...
|
||||||
|
(rs6000_function_arg): ...this.
|
||||||
|
(function_arg_advance): Rename to...
|
||||||
|
(rs6000_function_arg_advance_1): ...this
|
||||||
|
(rs6000_function_arg_advance): New function. Call it.
|
||||||
|
(setup_incoming_varargs): Call rs6000_function_arg_advance_1.
|
||||||
|
(rs6000_return_in_memory): Adjust call to rs6000_darwin64_record_arg.
|
||||||
|
(rs6000_function_value): Likewise.
|
||||||
|
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
|
||||||
|
|
||||||
2010-08-27 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
2010-08-27 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
|
||||||
|
|
||||||
* config/arm/arm.md (enabled): Test the value of arch_enabled
|
* config/arm/arm.md (enabled): Test the value of arch_enabled
|
||||||
|
|
|
@ -136,10 +136,7 @@ extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
|
||||||
unsigned int);
|
unsigned int);
|
||||||
extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
|
extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
|
||||||
unsigned int);
|
unsigned int);
|
||||||
extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
|
extern int function_arg_boundary (enum machine_mode, const_tree);
|
||||||
tree, int, int);
|
|
||||||
extern int function_arg_boundary (enum machine_mode, tree);
|
|
||||||
extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
|
|
||||||
extern tree altivec_resolve_overloaded_builtin (location_t, tree, void *);
|
extern tree altivec_resolve_overloaded_builtin (location_t, tree, void *);
|
||||||
extern rtx rs6000_libcall_value (enum machine_mode);
|
extern rtx rs6000_libcall_value (enum machine_mode);
|
||||||
extern rtx rs6000_va_arg (tree, tree);
|
extern rtx rs6000_va_arg (tree, tree);
|
||||||
|
|
|
@ -1155,20 +1155,25 @@ static int rs6000_tls_symbol_ref_1 (rtx *, void *);
|
||||||
static const char *rs6000_get_some_local_dynamic_name (void);
|
static const char *rs6000_get_some_local_dynamic_name (void);
|
||||||
static int rs6000_get_some_local_dynamic_name_1 (rtx *, void *);
|
static int rs6000_get_some_local_dynamic_name_1 (rtx *, void *);
|
||||||
static rtx rs6000_complex_function_value (enum machine_mode);
|
static rtx rs6000_complex_function_value (enum machine_mode);
|
||||||
static rtx rs6000_spe_function_arg (CUMULATIVE_ARGS *,
|
static rtx rs6000_spe_function_arg (const CUMULATIVE_ARGS *,
|
||||||
enum machine_mode, tree);
|
enum machine_mode, const_tree);
|
||||||
static void rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *,
|
static void rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *,
|
||||||
HOST_WIDE_INT, int);
|
HOST_WIDE_INT, int);
|
||||||
static void rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *,
|
static void rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *,
|
||||||
tree, HOST_WIDE_INT);
|
const_tree,
|
||||||
|
HOST_WIDE_INT);
|
||||||
static void rs6000_darwin64_record_arg_flush (CUMULATIVE_ARGS *,
|
static void rs6000_darwin64_record_arg_flush (CUMULATIVE_ARGS *,
|
||||||
HOST_WIDE_INT,
|
HOST_WIDE_INT,
|
||||||
rtx[], int *);
|
rtx[], int *);
|
||||||
static void rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *,
|
static void rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *,
|
||||||
const_tree, HOST_WIDE_INT,
|
const_tree, HOST_WIDE_INT,
|
||||||
rtx[], int *);
|
rtx[], int *);
|
||||||
static rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, const_tree, int, bool);
|
static rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, const_tree, bool, bool);
|
||||||
static rtx rs6000_mixed_function_arg (enum machine_mode, tree, int);
|
static rtx rs6000_mixed_function_arg (enum machine_mode, const_tree, int);
|
||||||
|
static void rs6000_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
|
||||||
|
const_tree, bool);
|
||||||
|
static rtx rs6000_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
|
||||||
|
const_tree, bool);
|
||||||
static void rs6000_move_block_from_reg (int regno, rtx x, int nregs);
|
static void rs6000_move_block_from_reg (int regno, rtx x, int nregs);
|
||||||
static void setup_incoming_varargs (CUMULATIVE_ARGS *,
|
static void setup_incoming_varargs (CUMULATIVE_ARGS *,
|
||||||
enum machine_mode, tree,
|
enum machine_mode, tree,
|
||||||
|
@ -1554,6 +1559,10 @@ static const struct attribute_spec rs6000_attribute_table[] =
|
||||||
#define TARGET_PASS_BY_REFERENCE rs6000_pass_by_reference
|
#define TARGET_PASS_BY_REFERENCE rs6000_pass_by_reference
|
||||||
#undef TARGET_ARG_PARTIAL_BYTES
|
#undef TARGET_ARG_PARTIAL_BYTES
|
||||||
#define TARGET_ARG_PARTIAL_BYTES rs6000_arg_partial_bytes
|
#define TARGET_ARG_PARTIAL_BYTES rs6000_arg_partial_bytes
|
||||||
|
#undef TARGET_FUNCTION_ARG_ADVANCE
|
||||||
|
#define TARGET_FUNCTION_ARG_ADVANCE rs6000_function_arg_advance
|
||||||
|
#undef TARGET_FUNCTION_ARG
|
||||||
|
#define TARGET_FUNCTION_ARG rs6000_function_arg
|
||||||
|
|
||||||
#undef TARGET_BUILD_BUILTIN_VA_LIST
|
#undef TARGET_BUILD_BUILTIN_VA_LIST
|
||||||
#define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list
|
#define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list
|
||||||
|
@ -7466,7 +7475,7 @@ rs6000_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
|
||||||
valcum.vregno = ALTIVEC_ARG_MIN_REG;
|
valcum.vregno = ALTIVEC_ARG_MIN_REG;
|
||||||
/* Do a trial code generation as if this were going to be passed
|
/* Do a trial code generation as if this were going to be passed
|
||||||
as an argument; if any part goes in memory, we return NULL. */
|
as an argument; if any part goes in memory, we return NULL. */
|
||||||
valret = rs6000_darwin64_record_arg (&valcum, type, 1, true);
|
valret = rs6000_darwin64_record_arg (&valcum, type, true, true);
|
||||||
if (valret)
|
if (valret)
|
||||||
return false;
|
return false;
|
||||||
/* Otherwise fall through to more conventional ABI rules. */
|
/* Otherwise fall through to more conventional ABI rules. */
|
||||||
|
@ -7650,7 +7659,7 @@ function_arg_padding (enum machine_mode mode, const_tree type)
|
||||||
Quadword align large synthetic vector types. */
|
Quadword align large synthetic vector types. */
|
||||||
|
|
||||||
int
|
int
|
||||||
function_arg_boundary (enum machine_mode mode, tree type)
|
function_arg_boundary (enum machine_mode mode, const_tree type)
|
||||||
{
|
{
|
||||||
if (DEFAULT_ABI == ABI_V4
|
if (DEFAULT_ABI == ABI_V4
|
||||||
&& (GET_MODE_SIZE (mode) == 8
|
&& (GET_MODE_SIZE (mode) == 8
|
||||||
|
@ -7680,7 +7689,8 @@ function_arg_boundary (enum machine_mode mode, tree type)
|
||||||
the parameter area. NWORDS of the parameter area are already used. */
|
the parameter area. NWORDS of the parameter area are already used. */
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
rs6000_parm_start (enum machine_mode mode, tree type, unsigned int nwords)
|
rs6000_parm_start (enum machine_mode mode, const_tree type,
|
||||||
|
unsigned int nwords)
|
||||||
{
|
{
|
||||||
unsigned int align;
|
unsigned int align;
|
||||||
unsigned int parm_offset;
|
unsigned int parm_offset;
|
||||||
|
@ -7693,7 +7703,7 @@ rs6000_parm_start (enum machine_mode mode, tree type, unsigned int nwords)
|
||||||
/* Compute the size (in words) of a function argument. */
|
/* Compute the size (in words) of a function argument. */
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
rs6000_arg_size (enum machine_mode mode, tree type)
|
rs6000_arg_size (enum machine_mode mode, const_tree type)
|
||||||
{
|
{
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
|
|
||||||
|
@ -7771,7 +7781,7 @@ rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *cum,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *cum,
|
rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *cum,
|
||||||
tree type,
|
const_tree type,
|
||||||
HOST_WIDE_INT startbitpos)
|
HOST_WIDE_INT startbitpos)
|
||||||
{
|
{
|
||||||
tree f;
|
tree f;
|
||||||
|
@ -7867,9 +7877,9 @@ rs6000_darwin64_struct_check_p (enum machine_mode mode, const_tree type)
|
||||||
with MODE and TYPE set to that of the pointer to the arg, not the arg
|
with MODE and TYPE set to that of the pointer to the arg, not the arg
|
||||||
itself. */
|
itself. */
|
||||||
|
|
||||||
void
|
static void
|
||||||
function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
rs6000_function_arg_advance_1 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
||||||
tree type, int named, int depth)
|
const_tree type, bool named, int depth)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Only tick off an argument if we're not recursing. */
|
/* Only tick off an argument if we're not recursing. */
|
||||||
|
@ -8062,6 +8072,13 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
rs6000_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
||||||
|
const_tree type, bool named)
|
||||||
|
{
|
||||||
|
rs6000_function_arg_advance_1 (cum, mode, type, named, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
spe_build_register_parallel (enum machine_mode mode, int gregno)
|
spe_build_register_parallel (enum machine_mode mode, int gregno)
|
||||||
{
|
{
|
||||||
|
@ -8100,8 +8117,8 @@ spe_build_register_parallel (enum machine_mode mode, int gregno)
|
||||||
|
|
||||||
/* Determine where to put a SIMD argument on the SPE. */
|
/* Determine where to put a SIMD argument on the SPE. */
|
||||||
static rtx
|
static rtx
|
||||||
rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
rs6000_spe_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
||||||
tree type)
|
const_tree type)
|
||||||
{
|
{
|
||||||
int gregno = cum->sysv_gregno;
|
int gregno = cum->sysv_gregno;
|
||||||
|
|
||||||
|
@ -8296,7 +8313,7 @@ rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *cum, const_tree type,
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
rs6000_darwin64_record_arg (CUMULATIVE_ARGS *orig_cum, const_tree type,
|
rs6000_darwin64_record_arg (CUMULATIVE_ARGS *orig_cum, const_tree type,
|
||||||
int named, bool retval)
|
bool named, bool retval)
|
||||||
{
|
{
|
||||||
rtx rvec[FIRST_PSEUDO_REGISTER];
|
rtx rvec[FIRST_PSEUDO_REGISTER];
|
||||||
int k = 1, kbase = 1;
|
int k = 1, kbase = 1;
|
||||||
|
@ -8341,7 +8358,8 @@ rs6000_darwin64_record_arg (CUMULATIVE_ARGS *orig_cum, const_tree type,
|
||||||
/* Determine where to place an argument in 64-bit mode with 32-bit ABI. */
|
/* Determine where to place an argument in 64-bit mode with 32-bit ABI. */
|
||||||
|
|
||||||
static rtx
|
static rtx
|
||||||
rs6000_mixed_function_arg (enum machine_mode mode, tree type, int align_words)
|
rs6000_mixed_function_arg (enum machine_mode mode, const_tree type,
|
||||||
|
int align_words)
|
||||||
{
|
{
|
||||||
int n_units;
|
int n_units;
|
||||||
int i, k;
|
int i, k;
|
||||||
|
@ -8412,9 +8430,9 @@ rs6000_mixed_function_arg (enum machine_mode mode, tree type, int align_words)
|
||||||
with MODE and TYPE set to that of the pointer to the arg, not the arg
|
with MODE and TYPE set to that of the pointer to the arg, not the arg
|
||||||
itself. */
|
itself. */
|
||||||
|
|
||||||
rtx
|
static rtx
|
||||||
function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
rs6000_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
||||||
tree type, int named)
|
const_tree type, bool named)
|
||||||
{
|
{
|
||||||
enum rs6000_abi abi = DEFAULT_ABI;
|
enum rs6000_abi abi = DEFAULT_ABI;
|
||||||
|
|
||||||
|
@ -8861,7 +8879,7 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|
||||||
|
|
||||||
/* Skip the last named argument. */
|
/* Skip the last named argument. */
|
||||||
next_cum = *cum;
|
next_cum = *cum;
|
||||||
function_arg_advance (&next_cum, mode, type, 1, 0);
|
rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0);
|
||||||
|
|
||||||
if (DEFAULT_ABI == ABI_V4)
|
if (DEFAULT_ABI == ABI_V4)
|
||||||
{
|
{
|
||||||
|
@ -26584,7 +26602,7 @@ rs6000_function_value (const_tree valtype,
|
||||||
valcum.vregno = ALTIVEC_ARG_MIN_REG;
|
valcum.vregno = ALTIVEC_ARG_MIN_REG;
|
||||||
/* Do a trial code generation as if this were going to be passed as
|
/* Do a trial code generation as if this were going to be passed as
|
||||||
an argument; if any part goes in memory, we return NULL. */
|
an argument; if any part goes in memory, we return NULL. */
|
||||||
valret = rs6000_darwin64_record_arg (&valcum, valtype, 1, true);
|
valret = rs6000_darwin64_record_arg (&valcum, valtype, true, true);
|
||||||
if (valret)
|
if (valret)
|
||||||
return valret;
|
return valret;
|
||||||
/* Otherwise fall through to standard ABI rules. */
|
/* Otherwise fall through to standard ABI rules. */
|
||||||
|
|
|
@ -1696,38 +1696,6 @@ typedef struct rs6000_args
|
||||||
#define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \
|
#define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \
|
||||||
init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE, 0)
|
init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE, 0)
|
||||||
|
|
||||||
/* Update the data in CUM to advance over an argument
|
|
||||||
of mode MODE and data type TYPE.
|
|
||||||
(TYPE is null for libcalls where that information may not be available.) */
|
|
||||||
|
|
||||||
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
|
|
||||||
function_arg_advance (&CUM, MODE, TYPE, NAMED, 0)
|
|
||||||
|
|
||||||
/* Determine where to put an argument to a function.
|
|
||||||
Value is zero to push the argument on the stack,
|
|
||||||
or a hard register in which to store the argument.
|
|
||||||
|
|
||||||
MODE is the argument's machine mode.
|
|
||||||
TYPE is the data type of the argument (as a tree).
|
|
||||||
This is null for libcalls where that information may
|
|
||||||
not be available.
|
|
||||||
CUM is a variable of type CUMULATIVE_ARGS which gives info about
|
|
||||||
the preceding args and about the function being called.
|
|
||||||
NAMED is nonzero if this argument is a named parameter
|
|
||||||
(otherwise it is an extra parameter matching an ellipsis).
|
|
||||||
|
|
||||||
On RS/6000 the first eight words of non-FP are normally in registers
|
|
||||||
and the rest are pushed. The first 13 FP args are in registers.
|
|
||||||
|
|
||||||
If this is floating-point and no prototype is specified, we use
|
|
||||||
both an FP and integer register (or possibly FP reg and stack). Library
|
|
||||||
functions (when TYPE is zero) always have the proper types for args,
|
|
||||||
so we can pass the FP value just in one register. emit_library_function
|
|
||||||
doesn't support EXPR_LIST anyway. */
|
|
||||||
|
|
||||||
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
|
|
||||||
function_arg (&CUM, MODE, TYPE, NAMED)
|
|
||||||
|
|
||||||
/* If defined, a C expression which determines whether, and in which
|
/* If defined, a C expression which determines whether, and in which
|
||||||
direction, to pad out an argument with extra space. The value
|
direction, to pad out an argument with extra space. The value
|
||||||
should be of type `enum direction': either `upward' to pad above
|
should be of type `enum direction': either `upward' to pad above
|
||||||
|
|
Loading…
Reference in New Issue