diff options
author | Richard Guenther <rguenther@suse.de> | 2010-10-07 14:35:38 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-10-07 14:35:38 +0000 |
commit | 767f865fb828fba54459911661d15289e1a42930 (patch) | |
tree | 6f561e813aa0ca8ad15d3002a912e9e02e3da749 /gcc/config/i386/i386.c | |
parent | cc4b51708785f9482c6b2874daafa4fcc121d5d1 (diff) | |
download | gcc-767f865fb828fba54459911661d15289e1a42930.zip gcc-767f865fb828fba54459911661d15289e1a42930.tar.gz gcc-767f865fb828fba54459911661d15289e1a42930.tar.bz2 |
target.def (autovectorize_vector_sizes): New target hook.
2010-10-07 Richard Guenther <rguenther@suse.de>
* target.def (autovectorize_vector_sizes): New target hook.
* targhooks.c (default_autovectorize_vector_sizes): New function.
* targhooks.h (default_autovectorize_vector_sizes): Declare.
* doc/tm.texi.in (TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES):
Document.
* doc/tm.texi: Update.
* config/i386/i386.c (ix86_autovectorize_vector_sizes): New function.
(TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES): Define.
From-SVN: r165115
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r-- | gcc/config/i386/i386.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 74ded78..39308cf 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -32993,6 +32993,15 @@ ix86_preferred_simd_mode (enum machine_mode mode) return word_mode; } +/* If AVX is enabled then try vectorizing with both 256bit and 128bit + vectors. */ + +static unsigned int +ix86_autovectorize_vector_sizes (void) +{ + return TARGET_AVX ? 32 | 16 : 0; +} + /* Initialize the GCC target structure. */ #undef TARGET_RETURN_IN_MEMORY #define TARGET_RETURN_IN_MEMORY ix86_return_in_memory @@ -33253,6 +33262,9 @@ ix86_preferred_simd_mode (enum machine_mode mode) #undef TARGET_VECTORIZE_PREFERRED_SIMD_MODE #define TARGET_VECTORIZE_PREFERRED_SIMD_MODE \ ix86_preferred_simd_mode +#undef TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES +#define TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES \ + ix86_autovectorize_vector_sizes #undef TARGET_SET_CURRENT_FUNCTION #define TARGET_SET_CURRENT_FUNCTION ix86_set_current_function |