Commit 105b2084 by Jakub Jelinek Committed by Jakub Jelinek

sparc.c (function_arg_record_value_1): Pass complex floating fields in float regs.

	* config/sparc/sparc.c (function_arg_record_value_1): Pass complex
	floating fields in float regs.
	(function_arg_record_value_2): Likewise.

From-SVN: r51667
parent db08fddf
2002-03-31 Jakub Jelinek <jakub@redhat.com>
* config/sparc/sparc.c (function_arg_record_value_1): Pass complex
floating fields in float regs.
(function_arg_record_value_2): Likewise.
2002-03-31 Hans-Peter Nilsson <hp@bitrange.com> 2002-03-31 Hans-Peter Nilsson <hp@bitrange.com>
* config/mmix/mmix.md (define_constants): Remove misleading * config/mmix/mmix.md (define_constants): Remove misleading
......
...@@ -4245,7 +4245,10 @@ function_arg_record_value_1 (type, startbitpos, parms) ...@@ -4245,7 +4245,10 @@ function_arg_record_value_1 (type, startbitpos, parms)
if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE) if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE)
function_arg_record_value_1 (TREE_TYPE (field), bitpos, parms); function_arg_record_value_1 (TREE_TYPE (field), bitpos, parms);
else if (TREE_CODE (TREE_TYPE (field)) == REAL_TYPE else if ((TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
|| (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE
&& (TREE_CODE (TREE_TYPE (TREE_TYPE (field)))
== REAL_TYPE)))
&& TARGET_FPU && TARGET_FPU
&& ! packed_p && ! packed_p
&& parms->named) && parms->named)
...@@ -4268,6 +4271,8 @@ function_arg_record_value_1 (type, startbitpos, parms) ...@@ -4268,6 +4271,8 @@ function_arg_record_value_1 (type, startbitpos, parms)
/* There's no need to check this_slotno < SPARC_FP_ARG MAX. /* There's no need to check this_slotno < SPARC_FP_ARG MAX.
If it wasn't true we wouldn't be here. */ If it wasn't true we wouldn't be here. */
parms->nregs += 1; parms->nregs += 1;
if (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE)
parms->nregs += 1;
} }
else else
{ {
...@@ -4371,24 +4376,45 @@ function_arg_record_value_2 (type, startbitpos, parms) ...@@ -4371,24 +4376,45 @@ function_arg_record_value_2 (type, startbitpos, parms)
if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE) if (TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE)
function_arg_record_value_2 (TREE_TYPE (field), bitpos, parms); function_arg_record_value_2 (TREE_TYPE (field), bitpos, parms);
else if (TREE_CODE (TREE_TYPE (field)) == REAL_TYPE else if ((TREE_CODE (TREE_TYPE (field)) == REAL_TYPE
|| (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE
&& (TREE_CODE (TREE_TYPE (TREE_TYPE (field)))
== REAL_TYPE)))
&& TARGET_FPU && TARGET_FPU
&& ! packed_p && ! packed_p
&& parms->named) && parms->named)
{ {
int this_slotno = parms->slotno + bitpos / BITS_PER_WORD; int this_slotno = parms->slotno + bitpos / BITS_PER_WORD;
int regno;
enum machine_mode mode = DECL_MODE (field);
rtx reg; rtx reg;
function_arg_record_value_3 (bitpos, parms); function_arg_record_value_3 (bitpos, parms);
regno = SPARC_FP_ARG_FIRST + this_slotno * 2
reg = gen_rtx_REG (DECL_MODE (field), + ((mode == SFmode || mode == SCmode)
(SPARC_FP_ARG_FIRST + this_slotno * 2 && (bitpos & 32) != 0);
+ (DECL_MODE (field) == SFmode switch (mode)
&& (bitpos & 32) != 0))); {
case SCmode: mode = SFmode; break;
case DCmode: mode = DFmode; break;
case TCmode: mode = TFmode; break;
default: break;
}
reg = gen_rtx_REG (mode, regno);
XVECEXP (parms->ret, 0, parms->nregs) XVECEXP (parms->ret, 0, parms->nregs)
= gen_rtx_EXPR_LIST (VOIDmode, reg, = gen_rtx_EXPR_LIST (VOIDmode, reg,
GEN_INT (bitpos / BITS_PER_UNIT)); GEN_INT (bitpos / BITS_PER_UNIT));
parms->nregs += 1; parms->nregs += 1;
if (TREE_CODE (TREE_TYPE (field)) == COMPLEX_TYPE)
{
regno += GET_MODE_SIZE (mode) / 4;
reg = gen_rtx_REG (mode, regno);
XVECEXP (parms->ret, 0, parms->nregs)
= gen_rtx_EXPR_LIST (VOIDmode, reg,
GEN_INT ((bitpos + GET_MODE_BITSIZE (mode))
/ BITS_PER_UNIT));
parms->nregs += 1;
}
} }
else else
{ {
......
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