Commit 69494148 by Eric Botcazou Committed by Eric Botcazou

sparc.c (function_arg_partial_nregs): Never return 1 for complex integral modes…

sparc.c (function_arg_partial_nregs): Never return 1 for complex integral modes whose size is lesser or equal to a word.

	* config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]:
	Never return 1 for complex integral modes whose size is lesser or
	equal to a word.
	(function_arg_pass_by_reference) [TARGET_ARCH64]: Mention CTImode
	in the comment.
	(function_arg_advance) [TARGET_ARCH64]: Don't special-case complex
	modes.
	(sparc_va_arg) [TARGET_ARCH64]: Handle any types whose is greater
	than 16 bytes by reference.

From-SVN: r73044
parent 2035efe7
2003-10-29 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]:
Never return 1 for complex integral modes whose size is lesser or
equal to a word.
(function_arg_pass_by_reference) [TARGET_ARCH64]: Mention CTImode
in the comment.
(function_arg_advance) [TARGET_ARCH64]: Don't special-case complex
modes.
(sparc_va_arg) [TARGET_ARCH64]: Handle any types whose is greater
than 16 bytes by reference.
2003-10-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> 2003-10-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* config/ia64/ia64.c (ia64_assemble_integer): Test POINTER_SIZE, * config/ia64/ia64.c (ia64_assemble_integer): Test POINTER_SIZE,
......
...@@ -5429,7 +5429,8 @@ function_arg_partial_nregs (const struct sparc_args *cum, ...@@ -5429,7 +5429,8 @@ function_arg_partial_nregs (const struct sparc_args *cum,
&& slotno == SPARC_INT_ARG_MAX - 1) && slotno == SPARC_INT_ARG_MAX - 1)
return 1; return 1;
} }
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT else if ((GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD)
|| (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT || (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
&& ! (TARGET_FPU && named))) && ! (TARGET_FPU && named)))
{ {
...@@ -5476,7 +5477,8 @@ function_arg_pass_by_reference (const struct sparc_args *cum ATTRIBUTE_UNUSED, ...@@ -5476,7 +5477,8 @@ function_arg_pass_by_reference (const struct sparc_args *cum ATTRIBUTE_UNUSED,
else else
{ {
return ((type && TREE_CODE (type) == ARRAY_TYPE) return ((type && TREE_CODE (type) == ARRAY_TYPE)
/* Consider complex values as aggregates, so care for TCmode. */ /* Consider complex values as aggregates, so care
for CTImode and TCmode. */
|| GET_MODE_SIZE (mode) > 16 || GET_MODE_SIZE (mode) > 16
|| (type || (type
&& AGGREGATE_TYPE_P (type) && AGGREGATE_TYPE_P (type)
...@@ -5521,14 +5523,6 @@ function_arg_advance (struct sparc_args *cum, enum machine_mode mode, ...@@ -5521,14 +5523,6 @@ function_arg_advance (struct sparc_args *cum, enum machine_mode mode,
else /* passed by reference */ else /* passed by reference */
++cum->words; ++cum->words;
} }
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT)
{
cum->words += 2;
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
{
cum->words += GET_MODE_SIZE (mode) / UNITS_PER_WORD;
}
else else
{ {
cum->words += (mode != BLKmode cum->words += (mode != BLKmode
...@@ -5661,17 +5655,19 @@ sparc_va_arg (tree valist, tree type) ...@@ -5661,17 +5655,19 @@ sparc_va_arg (tree valist, tree type)
if (TYPE_ALIGN (type) >= 2 * (unsigned) BITS_PER_WORD) if (TYPE_ALIGN (type) >= 2 * (unsigned) BITS_PER_WORD)
align = 2 * UNITS_PER_WORD; align = 2 * UNITS_PER_WORD;
if (AGGREGATE_TYPE_P (type)) /* Consider complex values as aggregates, so care
for CTImode and TCmode. */
if ((unsigned HOST_WIDE_INT) size > 16)
{ {
if ((unsigned HOST_WIDE_INT) size > 16) indirect = 1;
{ size = rsize = UNITS_PER_WORD;
indirect = 1; align = 0;
size = rsize = UNITS_PER_WORD; }
align = 0; else if (AGGREGATE_TYPE_P (type))
} {
/* SPARC v9 ABI states that structures up to 8 bytes in size are /* SPARC-V9 ABI states that structures up to 16 bytes in size
given one 8 byte slot. */ are given whole slots as needed. */
else if (size == 0) if (size == 0)
size = rsize = UNITS_PER_WORD; size = rsize = UNITS_PER_WORD;
else else
size = rsize; size = rsize;
......
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