revert: i386.c (ix86_function_arg_regno_p): Put back the code before the following patch under TARGET_MACHO.

2007-02-02  Hui-May Chang  <hm.chang@apple.com>

	Revert for x86 darwin:
	2005-06-19  Uros Bizjak  <uros@kss-loka.si>

	* config/i386/i386.c (ix86_function_arg_regno_p): Put back the
	code before the following patch under TARGET_MACHO.
	(ix86_function_value_regno_p): Likewise.

From-SVN: r121515
This commit is contained in:
Hui-May Chang 2007-02-02 18:19:13 +00:00 committed by Mike Stump
parent b4f7c767a0
commit 88c6f10182
2 changed files with 54 additions and 16 deletions

View File

@ -1,3 +1,12 @@
2007-02-02 Hui-May Chang <hm.chang@apple.com>
Revert for x86 darwin:
2005-06-19 Uros Bizjak <uros@kss-loka.si>
* config/i386/i386.c (ix86_function_arg_regno_p): Put back the
code before the following patch under TARGET_MACHO.
(ix86_function_value_regno_p): Likewise.
2007-02-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fold-const.c (negate_expr_p, fold_negate_expr): Handle

View File

@ -2902,15 +2902,29 @@ ix86_function_arg_regno_p (int regno)
{
int i;
if (!TARGET_64BIT)
return (regno < REGPARM_MAX
|| (TARGET_MMX && MMX_REGNO_P (regno)
&& (regno < FIRST_MMX_REG + MMX_REGPARM_MAX))
|| (TARGET_SSE && SSE_REGNO_P (regno)
&& (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)));
{
if (TARGET_MACHO)
return (regno < REGPARM_MAX
|| (TARGET_SSE && SSE_REGNO_P (regno) && !fixed_regs[regno]));
else
return (regno < REGPARM_MAX
|| (TARGET_MMX && MMX_REGNO_P (regno)
&& (regno < FIRST_MMX_REG + MMX_REGPARM_MAX))
|| (TARGET_SSE && SSE_REGNO_P (regno)
&& (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)));
}
if (TARGET_SSE && SSE_REGNO_P (regno)
&& (regno < FIRST_SSE_REG + SSE_REGPARM_MAX))
return true;
if (TARGET_MACHO)
{
if (SSE_REGNO_P (regno) && TARGET_SSE)
return true;
}
else
{
if (TARGET_SSE && SSE_REGNO_P (regno)
&& (regno < FIRST_SSE_REG + SSE_REGPARM_MAX))
return true;
}
/* RAX is used as hidden argument to va_arg functions. */
if (!regno)
return true;
@ -4014,16 +4028,31 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type)
bool
ix86_function_value_regno_p (int regno)
{
if (regno == 0
|| (regno == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387)
|| (regno == FIRST_SSE_REG && TARGET_SSE))
return true;
if (TARGET_MACHO)
{
if (!TARGET_64BIT)
{
return ((regno) == 0
|| ((regno) == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387)
|| ((regno) == FIRST_SSE_REG && TARGET_SSE));
}
return ((regno) == 0 || (regno) == FIRST_FLOAT_REG
|| ((regno) == FIRST_SSE_REG && TARGET_SSE)
|| ((regno) == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387));
}
else
{
if (regno == 0
|| (regno == FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387)
|| (regno == FIRST_SSE_REG && TARGET_SSE))
return true;
if (!TARGET_64BIT
&& (regno == FIRST_MMX_REG && TARGET_MMX))
return true;
if (!TARGET_64BIT
&& (regno == FIRST_MMX_REG && TARGET_MMX))
return true;
return false;
return false;
}
}
/* Define how to find the value returned by a function.