Commit d13256a3 by Steve Ellcey Committed by Steve Ellcey

ia64.h (FUNCTION_ARG_BOUNDARY): Change macro to call ia64_function_arg_boundary.

	* config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Change macro to
	call ia64_function_arg_boundary.
	* config/ia64/ia64-protos.h (ia64_function_arg_boundary): New.
	* config/ia64/ia64.c (ia64_function_arg_boundary): New.
	(ia64_function_arg_advance): Do not put 128 bit floats into
	FP registers.

From-SVN: r88608
parent fbdad37d
2004-10-06 Steve Ellcey <sje@cup.hp.com>
* config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Change macro to
call ia64_function_arg_boundary.
* config/ia64/ia64-protos.h (ia64_function_arg_boundary): New.
* config/ia64/ia64.c (ia64_function_arg_boundary): New.
(ia64_function_arg_advance): Do not put 128 bit floats into
FP registers.
2004-10-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2004-10-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (expand_builtin_strcpy): Delete duplicate code. * builtins.c (expand_builtin_strcpy): Delete duplicate code.
......
...@@ -77,6 +77,7 @@ extern int ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *, ...@@ -77,6 +77,7 @@ extern int ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *,
enum machine_mode, tree, int); enum machine_mode, tree, int);
extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
tree, int); tree, int);
extern int ia64_function_arg_boundary (enum machine_mode, tree);
extern void ia64_asm_output_external (FILE *, tree, const char *); extern void ia64_asm_output_external (FILE *, tree, const char *);
#endif /* TREE_CODE */ #endif /* TREE_CODE */
......
...@@ -3325,10 +3325,11 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -3325,10 +3325,11 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
cum->fp_regs = fp_regs; cum->fp_regs = fp_regs;
} }
/* Integral and aggregates go in general registers. If we have run out of /* Integral and aggregates go in general registers. So do TFmode FP values.
FR registers, then FP values must also go in general registers. This can If we have run out of FR registers, then other FP values must also go in
happen when we have a SFmode HFA. */ general registers. This can happen when we have a SFmode HFA. */
else if (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS) else if (mode == TFmode || mode == TCmode
|| (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS))
cum->int_regs = cum->words; cum->int_regs = cum->words;
/* If there is a prototype, then FP values go in a FR register when /* If there is a prototype, then FP values go in a FR register when
...@@ -3351,6 +3352,31 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -3351,6 +3352,31 @@ ia64_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
} }
} }
/* Arguments with alignment larger than 8 bytes start at the next even
boundary. On ILP32 HPUX, TFmode arguments start on next even boundery
even though their normal alignment is 8 bytes. See ia64_function_arg. */
int
ia64_function_arg_boundary (enum machine_mode mode, tree type)
{
if (mode == TFmode && TARGET_HPUX && TARGET_ILP32)
return PARM_BOUNDARY * 2;
if (type)
{
if (TYPE_ALIGN (type) > PARM_BOUNDARY)
return PARM_BOUNDARY * 2;
else
return PARM_BOUNDARY;
}
if (GET_MODE_BITSIZE (mode) > PARM_BOUNDARY)
return PARM_BOUNDARY * 2;
else
return PARM_BOUNDARY;
}
/* Variable sized types are passed by reference. */ /* Variable sized types are passed by reference. */
/* ??? At present this is a GCC extension to the IA-64 ABI. */ /* ??? At present this is a GCC extension to the IA-64 ABI. */
......
...@@ -1376,15 +1376,11 @@ do { \ ...@@ -1376,15 +1376,11 @@ do { \
/* If defined, a C expression that gives the alignment boundary, in bits, of an /* If defined, a C expression that gives the alignment boundary, in bits, of an
argument with the specified mode and type. */ argument with the specified mode and type. */
/* Arguments with alignment larger than 8 bytes start at the next even /* Return the alignment boundary in bits for an argument with a specified
boundary. See ia64_function_arg. */ mode and type. */
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \ #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
(((TYPE) ? (TYPE_ALIGN (TYPE) > 8 * BITS_PER_UNIT) \ ia64_function_arg_boundary (MODE, TYPE)
: (((((MODE) == BLKmode \
? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
+ UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1)) \
? 128 : PARM_BOUNDARY)
/* A C expression that is nonzero if REGNO is the number of a hard register in /* A C expression that is nonzero if REGNO is the number of a hard register in
which function arguments are sometimes passed. This does *not* include which function arguments are sometimes passed. This does *not* include
......
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