mn10200.c (mn10200_va_arg): New.
* mn10200.c (mn10200_va_arg): New. * mn10200.h (EXPAND_BUILTIN_VA_ARG): New. From-SVN: r28315
This commit is contained in:
parent
d0be05dbc4
commit
8bb793f37f
|
@ -1,3 +1,8 @@
|
|||
Wed Jul 28 11:20:19 1999 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* mn10200.c (mn10200_va_arg): New.
|
||||
* mn10200.h (EXPAND_BUILTIN_VA_ARG): New.
|
||||
|
||||
Wed Jul 28 11:19:06 1999 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* builtins.c (std_expand_builtin_va_arg): Use int_size_in_bytes
|
||||
|
|
|
@ -1436,6 +1436,43 @@ function_arg_partial_nregs (cum, mode, type, named)
|
|||
return (nregs * UNITS_PER_WORD - cum->nbytes) / UNITS_PER_WORD;
|
||||
}
|
||||
|
||||
rtx
|
||||
mn10200_va_arg (valist, type)
|
||||
tree valist, type;
|
||||
{
|
||||
HOST_WIDE_INT align, rsize;
|
||||
tree t, ptr, pptr;
|
||||
|
||||
/* Compute the rounded size of the type. */
|
||||
align = PARM_BOUNDARY / BITS_PER_UNIT;
|
||||
rsize = (((int_size_in_bytes (type) + align - 1) / align) * align);
|
||||
|
||||
t = build (POSTINCREMENT_EXPR, TREE_TYPE (valist), valist,
|
||||
build_int_2 ((rsize > 8 ? 4 : rsize), 0));
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
|
||||
ptr = build_pointer_type (type);
|
||||
|
||||
/* "Large" types are passed by reference. */
|
||||
if (rsize > 8)
|
||||
{
|
||||
pptr = build_pointer_type (ptr);
|
||||
t = build1 (NOP_EXPR, pptr, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
|
||||
t = build1 (INDIRECT_REF, ptr, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
t = build1 (NOP_EXPR, ptr, t);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
}
|
||||
|
||||
/* Calculate! */
|
||||
return expand_expr (t, NULL_RTX, Pmode, EXPAND_NORMAL);
|
||||
}
|
||||
|
||||
char *
|
||||
output_tst (operand, insn)
|
||||
rtx operand, insn;
|
||||
|
|
|
@ -508,6 +508,10 @@ extern struct rtx_def *function_arg();
|
|||
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
|
||||
function_arg (&CUM, MODE, TYPE, NAMED)
|
||||
|
||||
/* Implement `va_arg'. */
|
||||
extern struct rtx_def *mn10200_va_arg();
|
||||
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
|
||||
mn10200_va_arg (valist, type)
|
||||
|
||||
/* For "large" items, we pass them by invisible reference, and the
|
||||
callee is responsible for copying the data item if it might be
|
||||
|
|
Loading…
Reference in New Issue