diff options
author | Richard Guenther <rguenther@suse.de> | 2010-10-07 14:34:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-10-07 14:34:44 +0000 |
commit | cc4b51708785f9482c6b2874daafa4fcc121d5d1 (patch) | |
tree | e369542c279196e8b7be20440bc887cf9eed16f3 /gcc/config/i386/i386.c | |
parent | 65dcb9012117bf260ab72b9703e659685e9877e4 (diff) | |
download | gcc-cc4b51708785f9482c6b2874daafa4fcc121d5d1.zip gcc-cc4b51708785f9482c6b2874daafa4fcc121d5d1.tar.gz gcc-cc4b51708785f9482c6b2874daafa4fcc121d5d1.tar.bz2 |
target.def (units_per_simd_word): Rename to ...
2010-10-07 Richard Guenther <rguenther@suse.de>
* target.def (units_per_simd_word): Rename to ...
(preferred_simd_mode): ... this. Return mode instead of size.
* targhooks.c (default_units_per_simd_word): Rename to ...
(default_preferred_simd_mode): ... this. Return word_mode.
* targhooks.h (default_preferred_simd_mode): Declare.
* config/arm/arm.c (arm_units_per_simd_word): Rename to ...
(arm_preferred_simd_mode): ... this. Re-implement.
* config/i386/i386.c (ix86_units_per_simd_word): Rename to ...
(ix86_preferred_simd_mode): ... this. Re-implement.
* config/sparc/sparc.c (sparc_units_per_simd_word): Rename to ...
(sparc_preferred_simd_mode): ... this. Re-implement.
* config/mips/mips.c (mips_units_per_simd_word): Rename to ...
(mips_preferred_simd_mode): ... this. Re-implement.
* config/rs6000/rs6000.c (rs6000_units_per_simd_word): Rename to ...
(rs6000_preferred_simd_mode): ... this. Re-implement.
* tree-vect-stmts.c (get_vectype_for_scalar_type): Adjust.
* doc/tm.texi.in (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Remove.
(TARGET_VECTORIZE_PREFERRED_SIMD_MODE): Document.
* doc/tm.texi: Update.
From-SVN: r165114
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r-- | gcc/config/i386/i386.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7fe654a..74ded78 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -32962,23 +32962,35 @@ has_dispatch (rtx insn, int action) /* ??? No autovectorization into MMX or 3DNOW until we can reliably place emms and femms instructions. */ -static unsigned int -ix86_units_per_simd_word (enum machine_mode mode) +static enum machine_mode +ix86_preferred_simd_mode (enum machine_mode mode) { /* Disable double precision vectorizer if needed. */ if (mode == DFmode && !TARGET_VECTORIZE_DOUBLE) - return UNITS_PER_WORD; + return word_mode; -#if 0 - /* FIXME: AVX has 32byte floating point vector operations and 16byte - integer vector operations. But vectorizer doesn't support - different sizes for integer and floating point vectors. We limit - vector size to 16byte. */ - if (TARGET_AVX) - return (mode == DFmode || mode == SFmode) ? 32 : 16; - else -#endif - return TARGET_SSE ? 16 : UNITS_PER_WORD; + if (!TARGET_AVX && !TARGET_SSE) + return word_mode; + + switch (mode) + { + case SFmode: + return TARGET_AVX ? V8SFmode : V4SFmode; + case DFmode: + return TARGET_AVX ? V4DFmode : V2DFmode; + case DImode: + return V2DImode; + case SImode: + return V4SImode; + case HImode: + return V8HImode; + case QImode: + return V16QImode; + + default:; + } + + return word_mode; } /* Initialize the GCC target structure. */ @@ -33238,9 +33250,9 @@ ix86_units_per_simd_word (enum machine_mode mode) #undef TARGET_VECTORIZE_BUILTIN_VEC_PERM_OK #define TARGET_VECTORIZE_BUILTIN_VEC_PERM_OK \ ix86_vectorize_builtin_vec_perm_ok -#undef TARGET_VECTORIZE_UNITS_PER_SIMD_WORD -#define TARGET_VECTORIZE_UNITS_PER_SIMD_WORD \ - ix86_units_per_simd_word +#undef TARGET_VECTORIZE_PREFERRED_SIMD_MODE +#define TARGET_VECTORIZE_PREFERRED_SIMD_MODE \ + ix86_preferred_simd_mode #undef TARGET_SET_CURRENT_FUNCTION #define TARGET_SET_CURRENT_FUNCTION ix86_set_current_function |