From 90d5887b530c43b85c68c067fd01124a74ea521e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 26 Jul 2004 21:45:57 +0000 Subject: [PATCH] i386.c (function_arg): Always treat 8- and 16-byte wide vectors the same, even if MMX/SSE are disabled. * config/i386/i386.c (function_arg): Always treat 8- and 16-byte wide vectors the same, even if MMX/SSE are disabled. (contains_128bit_aligned_vector_p): Add comment. From-SVN: r85207 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 24 +++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 37f22c8c27e..c7e9705e3bf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-07-22 Paolo Bonzini + + * config/i386/i386.c (function_arg): Always treat 8- + and 16-byte wide vectors the same, even if MMX/SSE + are disabled. + (contains_128bit_aligned_vector_p): Add comment. + 2004-07-26 J"orn Rennecke * ra.h (enum node_type): Rename to: diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index de3edbe2274..797f7c33204 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2672,6 +2672,28 @@ function_arg (CUMULATIVE_ARGS *cum, /* current arg information */ int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; static bool warnedsse, warnedmmx; + /* To simplify the code below, represent vector types with a vector mode + even if MMX/SSE are not active. */ + if (type + && TREE_CODE (type) == VECTOR_TYPE + && (bytes == 8 || bytes == 16) + && GET_MODE_CLASS (TYPE_MODE (type)) != MODE_VECTOR_INT + && GET_MODE_CLASS (TYPE_MODE (type)) != MODE_VECTOR_FLOAT) + { + enum machine_mode innermode = TYPE_MODE (TREE_TYPE (type)); + mode = TREE_CODE (TREE_TYPE (type)) == REAL_TYPE + ? MIN_MODE_VECTOR_FLOAT : MIN_MODE_VECTOR_INT; + + /* Get the mode which has this inner mode and number of units. */ + while (GET_MODE_NUNITS (mode) != TYPE_VECTOR_SUBPARTS (type) + || GET_MODE_INNER (mode) != innermode) + { + mode = GET_MODE_WIDER_MODE (mode); + if (mode == VOIDmode) + abort (); + } + } + /* Handle a hidden AL argument containing number of registers for varargs x86-64 functions. For i386 ABI just return constm1_rtx to avoid any AL settings. */ @@ -2802,7 +2824,7 @@ ix86_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, } /* Return true when TYPE should be 128bit aligned for 32bit argument passing - ABI */ + ABI. Only called if TARGET_SSE. */ static bool contains_128bit_aligned_vector_p (tree type) { -- 2.30.2