From 78fbfc4bd9e492f69591978f4b15a869b3fa2c9e Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Sat, 10 Jul 2004 01:59:12 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/i386/i386.c | 17 ++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d99487d7213..a9ce92c7edb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2004-07-09 Jan Beulich + + * 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 * builtins.c (std_gimplify_va_arg_expr): Deny ARGS_GROW_DOWNWARD. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a9ebf210910..7d7312ca6d0 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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; -- 2.30.2