Commit d34c5b80 by David Edelsohn

[multiple changes]

2001-05-02  David Edelsohn  <edelsohn@gnu.org>

	* config/rs6000/rs6000.c (rs6000_emit_move): Merge
	special_constant conditional blocks together.

2001-05-02  Dale Johannesen  <dalej@apple.com>

	* config/rs6000/rs6000.h (RS6000_ARG_SIZE): Remove unused NAMED
	parameter.
	(STRICT_ARGUMENT_NAMING): Define.
	* config/rs6000/rs6000.c (function_arg_advance, function_arg,
	function_arg_partial_nregs, setup_incoming_varargs): Remove
	args logic which depends on "named" now that STRICT_ARGUMENT_NAMING
	is defined.

From-SVN: r41771
parent 80f5bb34
2001-05-02 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.c (rs6000_emit_move): Merge
special_constant conditional blocks together.
2001-05-02 Dale Johannesen <dalej@apple.com>
* config/rs6000/rs6000.h (RS6000_ARG_SIZE): Remove unused NAMED
parameter.
(STRICT_ARGUMENT_NAMING): Define.
* config/rs6000/rs6000.c (function_arg_advance, function_arg,
function_arg_partial_nregs, setup_incoming_varargs): Remove
args logic which depends on "named" now that STRICT_ARGUMENT_NAMING
is defined.
Wed May 2 13:09:36 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Wed May 2 13:09:36 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* config/i386/i386.h (FUNCTION_BOUNDARY): Result is unsigned. * config/i386/i386.h (FUNCTION_BOUNDARY): Result is unsigned.
......
...@@ -1721,8 +1721,6 @@ rs6000_emit_move (dest, source, mode) ...@@ -1721,8 +1721,6 @@ rs6000_emit_move (dest, source, mode)
&& ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1]) && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1])
&& ! TOC_RELATIVE_EXPR_P (operands[1])) && ! TOC_RELATIVE_EXPR_P (operands[1]))
{ {
int special_constant_p = 0;
/* Emit a USE operation so that the constant isn't deleted if /* Emit a USE operation so that the constant isn't deleted if
expensive optimizations are turned on because nobody expensive optimizations are turned on because nobody
references it. This should only be done for operands that references it. This should only be done for operands that
...@@ -1773,18 +1771,10 @@ rs6000_emit_move (dest, source, mode) ...@@ -1773,18 +1771,10 @@ rs6000_emit_move (dest, source, mode)
operands[1] = force_const_mem (mode, operands[1]); operands[1] = force_const_mem (mode, operands[1]);
if (TARGET_TOC if (TARGET_TOC
&& CONSTANT_POOL_EXPR_P (XEXP (operands[1], 0))) && CONSTANT_POOL_EXPR_P (XEXP (operands[1], 0))
{ && ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (
rtx constant; get_pool_constant (XEXP (operands[1], 0)),
enum machine_mode cmode; get_pool_mode (XEXP (operands[1], 0))))
constant = get_pool_constant (XEXP (operands[1], 0));
cmode = get_pool_mode (XEXP (operands[1], 0));
special_constant_p =
ASM_OUTPUT_SPECIAL_POOL_ENTRY_P (constant, cmode);
}
if (special_constant_p)
{ {
operands[1] = gen_rtx_MEM (mode, operands[1] = gen_rtx_MEM (mode,
create_TOC_reference (XEXP (operands[1], 0))); create_TOC_reference (XEXP (operands[1], 0)));
...@@ -1952,7 +1942,7 @@ function_arg_advance (cum, mode, type, named) ...@@ -1952,7 +1942,7 @@ function_arg_advance (cum, mode, type, named)
{ {
if (mode == DFmode) if (mode == DFmode)
cum->words += cum->words & 1; cum->words += cum->words & 1;
cum->words += RS6000_ARG_SIZE (mode, type, 1); cum->words += RS6000_ARG_SIZE (mode, type);
} }
} }
else else
...@@ -1965,7 +1955,7 @@ function_arg_advance (cum, mode, type, named) ...@@ -1965,7 +1955,7 @@ function_arg_advance (cum, mode, type, named)
|| mode == TFmode) || mode == TFmode)
n_words = 1; n_words = 1;
else else
n_words = RS6000_ARG_SIZE (mode, type, 1); n_words = RS6000_ARG_SIZE (mode, type);
/* Long long is put in odd registers. */ /* Long long is put in odd registers. */
if (n_words == 2 && (gregno & 1) == 0) if (n_words == 2 && (gregno & 1) == 0)
...@@ -2000,14 +1990,10 @@ function_arg_advance (cum, mode, type, named) ...@@ -2000,14 +1990,10 @@ function_arg_advance (cum, mode, type, named)
{ {
int align = (TARGET_32BIT && (cum->words & 1) != 0 int align = (TARGET_32BIT && (cum->words & 1) != 0
&& function_arg_boundary (mode, type) == 64) ? 1 : 0; && function_arg_boundary (mode, type) == 64) ? 1 : 0;
cum->words += align; cum->words += align + RS6000_ARG_SIZE (mode, type);
if (named)
{
cum->words += RS6000_ARG_SIZE (mode, type, named);
if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_HARD_FLOAT) if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_HARD_FLOAT)
cum->fregno++; cum->fregno++;
}
if (TARGET_DEBUG_ARG) if (TARGET_DEBUG_ARG)
{ {
...@@ -2048,7 +2034,7 @@ function_arg (cum, mode, type, named) ...@@ -2048,7 +2034,7 @@ function_arg (cum, mode, type, named)
CUMULATIVE_ARGS *cum; CUMULATIVE_ARGS *cum;
enum machine_mode mode; enum machine_mode mode;
tree type; tree type;
int named; int named ATTRIBUTE_UNUSED;
{ {
enum rs6000_abi abi = DEFAULT_ABI; enum rs6000_abi abi = DEFAULT_ABI;
...@@ -2092,7 +2078,7 @@ function_arg (cum, mode, type, named) ...@@ -2092,7 +2078,7 @@ function_arg (cum, mode, type, named)
|| mode == TFmode) || mode == TFmode)
n_words = 1; n_words = 1;
else else
n_words = RS6000_ARG_SIZE (mode, type, 1); n_words = RS6000_ARG_SIZE (mode, type);
/* Long long is put in odd registers. */ /* Long long is put in odd registers. */
if (n_words == 2 && (gregno & 1) == 0) if (n_words == 2 && (gregno & 1) == 0)
...@@ -2111,9 +2097,6 @@ function_arg (cum, mode, type, named) ...@@ -2111,9 +2097,6 @@ function_arg (cum, mode, type, named)
&& function_arg_boundary (mode, type) == 64) ? 1 : 0; && function_arg_boundary (mode, type) == 64) ? 1 : 0;
int align_words = cum->words + align; int align_words = cum->words + align;
if (! named)
return NULL_RTX;
if (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST) if (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
return NULL_RTX; return NULL_RTX;
...@@ -2135,7 +2118,7 @@ function_arg (cum, mode, type, named) ...@@ -2135,7 +2118,7 @@ function_arg (cum, mode, type, named)
((align_words >= GP_ARG_NUM_REG) ((align_words >= GP_ARG_NUM_REG)
? NULL_RTX ? NULL_RTX
: (align_words : (align_words
+ RS6000_ARG_SIZE (mode, type, named) + RS6000_ARG_SIZE (mode, type)
> GP_ARG_NUM_REG > GP_ARG_NUM_REG
/* If this is partially on the stack, then /* If this is partially on the stack, then
we only include the portion actually we only include the portion actually
...@@ -2165,11 +2148,8 @@ function_arg_partial_nregs (cum, mode, type, named) ...@@ -2165,11 +2148,8 @@ function_arg_partial_nregs (cum, mode, type, named)
CUMULATIVE_ARGS *cum; CUMULATIVE_ARGS *cum;
enum machine_mode mode; enum machine_mode mode;
tree type; tree type;
int named; int named ATTRIBUTE_UNUSED;
{ {
if (! named)
return 0;
if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
return 0; return 0;
...@@ -2180,7 +2160,7 @@ function_arg_partial_nregs (cum, mode, type, named) ...@@ -2180,7 +2160,7 @@ function_arg_partial_nregs (cum, mode, type, named)
} }
if (cum->words < GP_ARG_NUM_REG if (cum->words < GP_ARG_NUM_REG
&& GP_ARG_NUM_REG < (cum->words + RS6000_ARG_SIZE (mode, type, named))) && GP_ARG_NUM_REG < (cum->words + RS6000_ARG_SIZE (mode, type)))
{ {
int ret = GP_ARG_NUM_REG - cum->words; int ret = GP_ARG_NUM_REG - cum->words;
if (ret && TARGET_DEBUG_ARG) if (ret && TARGET_DEBUG_ARG)
...@@ -2247,9 +2227,6 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) ...@@ -2247,9 +2227,6 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
int reg_size = TARGET_32BIT ? 4 : 8; int reg_size = TARGET_32BIT ? 4 : 8;
rtx save_area = NULL_RTX, mem; rtx save_area = NULL_RTX, mem;
int first_reg_offset, set; int first_reg_offset, set;
if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
{
tree fntype; tree fntype;
int stdarg_p; int stdarg_p;
...@@ -2264,6 +2241,8 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) ...@@ -2264,6 +2241,8 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
if (stdarg_p) if (stdarg_p)
function_arg_advance (&next_cum, mode, type, 1); function_arg_advance (&next_cum, mode, type, 1);
if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS)
{
/* Indicate to allocate space on the stack for varargs save area. */ /* Indicate to allocate space on the stack for varargs save area. */
/* ??? Does this really have to be located at a magic spot on the /* ??? Does this really have to be located at a magic spot on the
stack, or can we allocate this with assign_stack_local instead. */ stack, or can we allocate this with assign_stack_local instead. */
...@@ -2276,12 +2255,12 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl) ...@@ -2276,12 +2255,12 @@ setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
} }
else else
{ {
first_reg_offset = next_cum.words;
save_area = virtual_incoming_args_rtx; save_area = virtual_incoming_args_rtx;
cfun->machine->sysv_varargs_p = 0; cfun->machine->sysv_varargs_p = 0;
first_reg_offset = cum->words;
if (MUST_PASS_IN_STACK (mode, type)) if (MUST_PASS_IN_STACK (mode, type))
first_reg_offset += RS6000_ARG_SIZE (TYPE_MODE (type), type, 1); first_reg_offset += RS6000_ARG_SIZE (TYPE_MODE (type), type);
} }
set = get_varargs_alias_set (); set = get_varargs_alias_set ();
......
...@@ -1432,9 +1432,8 @@ typedef struct rs6000_args ...@@ -1432,9 +1432,8 @@ typedef struct rs6000_args
/* Define intermediate macro to compute the size (in registers) of an argument /* Define intermediate macro to compute the size (in registers) of an argument
for the RS/6000. */ for the RS/6000. */
#define RS6000_ARG_SIZE(MODE, TYPE, NAMED) \ #define RS6000_ARG_SIZE(MODE, TYPE) \
(! (NAMED) ? 0 \ ((MODE) != BLKmode \
: (MODE) != BLKmode \
? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \ ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \
: ((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) \ : ((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) \
+ (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
...@@ -1550,6 +1549,10 @@ typedef struct rs6000_args ...@@ -1550,6 +1549,10 @@ typedef struct rs6000_args
#define EXPAND_BUILTIN_VA_ARG(valist, type) \ #define EXPAND_BUILTIN_VA_ARG(valist, type) \
rs6000_va_arg (valist, type) rs6000_va_arg (valist, type)
/* Define this macro to be a nonzero value if the location where a function
argument is passed depends on whether or not it is a named argument. */
#define STRICT_ARGUMENT_NAMING 1
/* This macro generates the assembly code for function entry. /* This macro generates the assembly code for function entry.
FILE is a stdio stream to output the code to. FILE is a stdio stream to output the code to.
SIZE is an int: how many units of temporary storage to allocate. SIZE is an int: how many units of temporary storage to allocate.
......
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