OSDN Git Service

2007-02-02 Hui-May Chang <hm.chang@apple.com>
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Feb 2007 18:19:13 +0000 (18:19 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Feb 2007 18:19:13 +0000 (18:19 +0000)
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

gcc/ChangeLog
gcc/config/i386/i386.c

index 5308a3c..3a5bae7 100644 (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
index 35b03a9..e652d7e 100644 (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_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.