From: Uros Bizjak Date: Mon, 9 May 2011 20:51:19 +0000 (+0200) Subject: i386.c (ix86_autovectorize_vector_sizes): Return 0 for !flag_prefer_avx128. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fca132b919af8aea928f672ac58c0370c8a38f79;p=gcc.git i386.c (ix86_autovectorize_vector_sizes): Return 0 for !flag_prefer_avx128. * config/i386/i386.c (ix86_autovectorize_vector_sizes): Return 0 for !flag_prefer_avx128. (ix86_preferred_simd_mode): Return word_mode for DFmode without SSE2. From-SVN: r173591 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a94b94328f..7a6098047ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-05-09 Uros Bizjak + + * config/i386/i386.c (ix86_autovectorize_vector_sizes): Return 0 + for !flag_prefer_avx128. + (ix86_preferred_simd_mode): Return word_mode for DFmode without SSE2. + 2011-05-09 Eric Botcazou * fold-const.c (fold_range_test): Pass LOC to build_range_check. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7b0afb1cec0..afba1a7049d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -35118,32 +35118,38 @@ has_dispatch (rtx insn, int action) 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 word_mode; - - if (!TARGET_AVX && !TARGET_SSE) + if (!TARGET_SSE) return word_mode; switch (mode) { - case SFmode: - return (TARGET_AVX && !flag_prefer_avx128) ? V8SFmode : V4SFmode; - case DFmode: - return (TARGET_AVX && !flag_prefer_avx128) ? V4DFmode : V2DFmode; - case DImode: - return V2DImode; - case SImode: - return V4SImode; - case HImode: - return V8HImode; case QImode: return V16QImode; + case HImode: + return V8HImode; + case SImode: + return V4SImode; + case DImode: + return V2DImode; - default:; - } + case SFmode: + if (TARGET_AVX && !flag_prefer_avx128) + return V8SFmode; + else + return V4SFmode; + + case DFmode: + if (!TARGET_VECTORIZE_DOUBLE) + return word_mode; + else if (TARGET_AVX && !flag_prefer_avx128) + return V4DFmode; + else if (TARGET_SSE2) + return V2DFmode; + /* FALLTHRU */ - return word_mode; + default: + return word_mode; + } } /* If AVX is enabled then try vectorizing with both 256bit and 128bit @@ -35152,7 +35158,7 @@ ix86_preferred_simd_mode (enum machine_mode mode) static unsigned int ix86_autovectorize_vector_sizes (void) { - return TARGET_AVX ? 32 | 16 : 0; + return (TARGET_AVX && !flag_prefer_avx128) ? 32 | 16 : 0; } /* Initialize the GCC target structure. */