Commit 78fbfc4b by Jan Beulich Committed by Richard Henderson

i386.c (init_cumulative_args): Set mmx/sse registers available for use only when…

i386.c (init_cumulative_args): Set mmx/sse registers available for use only when TARGET_MMX/_SSE is set...

        * 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.

From-SVN: r84431
parent e4d3eef1
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> 2004-07-09 Richard Henderson <rth@redhat.com>
* builtins.c (std_gimplify_va_arg_expr): Deny ARGS_GROW_DOWNWARD. * builtins.c (std_gimplify_va_arg_expr): Deny ARGS_GROW_DOWNWARD.
......
...@@ -1921,8 +1921,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ ...@@ -1921,8 +1921,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
cum->nregs = ix86_function_regparm (fntype, fndecl); cum->nregs = ix86_function_regparm (fntype, fndecl);
else else
cum->nregs = ix86_regparm; cum->nregs = ix86_regparm;
cum->sse_nregs = SSE_REGPARM_MAX; if (TARGET_SSE)
cum->mmx_nregs = MMX_REGPARM_MAX; cum->sse_nregs = SSE_REGPARM_MAX;
if (TARGET_MMX)
cum->mmx_nregs = MMX_REGPARM_MAX;
cum->warn_sse = true; cum->warn_sse = true;
cum->warn_mmx = true; cum->warn_mmx = true;
cum->maybe_vaarg = false; cum->maybe_vaarg = false;
...@@ -1937,13 +1939,12 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ ...@@ -1937,13 +1939,12 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
} }
} }
/* Determine if this function has variable arguments. This is /* Determine if this function has variable arguments. This is
indicated by the last argument being 'void_type_mode' if there indicated by the last argument being 'void_type_mode' if there
are no variable arguments. If there are variable arguments, then 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; for (param = (fntype) ? TYPE_ARG_TYPES (fntype) : 0;
param != 0; param = next_param) param != 0; param = next_param)
...@@ -2692,7 +2693,7 @@ function_arg (CUMULATIVE_ARGS *cum, /* current arg information */ ...@@ -2692,7 +2693,7 @@ function_arg (CUMULATIVE_ARGS *cum, /* current arg information */
case V2DFmode: case V2DFmode:
if (!type || !AGGREGATE_TYPE_P (type)) if (!type || !AGGREGATE_TYPE_P (type))
{ {
if (!TARGET_SSE && !warnedmmx && cum->warn_sse) if (!TARGET_SSE && !warnedsse && cum->warn_sse)
{ {
warnedsse = true; warnedsse = true;
warning ("SSE vector argument without SSE enabled " warning ("SSE vector argument without SSE enabled "
...@@ -2839,7 +2840,9 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type) ...@@ -2839,7 +2840,9 @@ ix86_function_arg_boundary (enum machine_mode mode, tree type)
The handling here differs from field_alignment. ICC aligns MMX The handling here differs from field_alignment. ICC aligns MMX
arguments to 4 byte boundaries, while structure fields are aligned arguments to 4 byte boundaries, while structure fields are aligned
to 8 byte boundaries. */ to 8 byte boundaries. */
if (!type) if (!TARGET_SSE)
align = PARM_BOUNDARY;
else if (!type)
{ {
if (!SSE_REG_MODE_P (mode)) if (!SSE_REG_MODE_P (mode))
align = PARM_BOUNDARY; align = PARM_BOUNDARY;
......
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