summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-02 18:19:13 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2007-02-02 18:19:13 +0000
commit60d73ea6e8c1cf3a2b58b375de53f661ed4e6e1a (patch)
treeb294125bb2d07e528e2e4dfb9f39ff8f9f449f57
parent8571d5eeec7f77deb82e37c0d226011d63cafed9 (diff)
downloadppe42-gcc-60d73ea6e8c1cf3a2b58b375de53f661ed4e6e1a.tar.gz
ppe42-gcc-60d73ea6e8c1cf3a2b58b375de53f661ed4e6e1a.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121515 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/i386/i386.c63
2 files changed, 55 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5308a3c0f9c..3a5bae7d70b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 35b03a9cc48..e652d7ef341 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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_SSE && SSE_REGNO_P (regno)
- && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX))
- return true;
+ {
+ 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_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.
OpenPOWER on IntegriCloud