OSDN Git Service

* config/i386/i386.c (init_cumulative_args): Set mmx/sse registers
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Jul 2004 01:59:12 +0000 (01:59 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 Jul 2004 01:59:12 +0000 (01:59 +0000)
        available for use only when TARGET_MMX/_SSE is set, and check for
        variable argument function if any register count is non-zero.
        (function_arg): Correctly suppress repeated warnings for passing SSE
        vectors are arguments without SSE enabled.
        (ix86_function_arg_boundary): Without SSE enabled, the use of what
        would be SSE register modes does no longer influence the alignment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84431 138bc75d-0d04-0410-961f-82ee72b054a4

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

index d99487d..a9ce92c 100644 (file)
@@ -1,3 +1,13 @@
+2004-07-09  Jan Beulich  <jbeulich@novell.com>
+
+       * config/i386/i386.c (init_cumulative_args): Set mmx/sse registers
+       available for use only when TARGET_MMX/_SSE is set, and check for
+       variable argument function if any register count is non-zero.
+       (function_arg): Correctly suppress repeated warnings for passing SSE
+       vectors are arguments without SSE enabled.
+       (ix86_function_arg_boundary): Without SSE enabled, the use of what
+       would be SSE register modes does no longer influence the alignment.
+
 2004-07-09  Richard Henderson  <rth@redhat.com>
 
        * builtins.c (std_gimplify_va_arg_expr): Deny ARGS_GROW_DOWNWARD.
index a9ebf21..7d7312c 100644 (file)
@@ -1921,8 +1921,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum,  /* Argument info to initialize */
     cum->nregs = ix86_function_regparm (fntype, fndecl);
   else
     cum->nregs = ix86_regparm;
-  cum->sse_nregs = SSE_REGPARM_MAX;
-  cum->mmx_nregs = MMX_REGPARM_MAX;
+  if (TARGET_SSE)
+    cum->sse_nregs = SSE_REGPARM_MAX;
+  if (TARGET_MMX)
+    cum->mmx_nregs = MMX_REGPARM_MAX;
   cum->warn_sse = true;
   cum->warn_mmx = true;
   cum->maybe_vaarg = false;
@@ -1937,13 +1939,12 @@ init_cumulative_args (CUMULATIVE_ARGS *cum,  /* Argument info to initialize */
        }
     }
 
-
   /* Determine if this function has variable arguments.  This is
      indicated by the last argument being 'void_type_mode' if there
      are no variable arguments.  If there are variable arguments, then
-     we won't pass anything in registers */
+     we won't pass anything in registers in 32-bit mode. */
 
-  if (cum->nregs || !TARGET_MMX || !TARGET_SSE)
+  if (cum->nregs || cum->mmx_nregs || cum->sse_nregs)
     {
       for (param = (fntype) ? TYPE_ARG_TYPES (fntype) : 0;
           param != 0; param = next_param)
@@ -2692,7 +2693,7 @@ function_arg (CUMULATIVE_ARGS *cum,       /* current arg information */
       case V2DFmode:
        if (!type || !AGGREGATE_TYPE_P (type))
          {
-           if (!TARGET_SSE && !warnedmmx && cum->warn_sse)
+           if (!TARGET_SSE && !warnedsse && cum->warn_sse)
              {
                warnedsse = true;
                warning ("SSE vector argument without SSE enabled "
@@ -2839,7 +2840,9 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type)
         The handling here differs from field_alignment.  ICC aligns MMX
         arguments to 4 byte boundaries, while structure fields are aligned
         to 8 byte boundaries.  */
-      if (!type)
+      if (!TARGET_SSE)
+       align = PARM_BOUNDARY;
+      else if (!type)
        {
          if (!SSE_REG_MODE_P (mode))
            align = PARM_BOUNDARY;