OSDN Git Service

* config/i386/i386.c (ix86_autovectorize_vector_sizes): Return 0
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 May 2011 20:51:19 +0000 (20:51 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 May 2011 20:51:19 +0000 (20:51 +0000)
for !flag_prefer_avx128.
(ix86_preferred_simd_mode): Return word_mode for DFmode without SSE2.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173591 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c

index 3a94b94..7a60980 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-09  Uros Bizjak  <ubizjak@gmail.com>
+
+       * 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  <ebotcazou@adacore.com>
 
        * fold-const.c (fold_range_test): Pass LOC to build_range_check.
 2011-05-09  Eric Botcazou  <ebotcazou@adacore.com>
 
        * fold-const.c (fold_range_test): Pass LOC to build_range_check.
index 7b0afb1..afba1a7 100644 (file)
@@ -35118,32 +35118,38 @@ has_dispatch (rtx insn, int action)
 static enum machine_mode
 ix86_preferred_simd_mode (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 word_mode;
-
-  if (!TARGET_AVX && !TARGET_SSE)
+  if (!TARGET_SSE)
     return word_mode;
 
   switch (mode)
     {
     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 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
 }
 
 /* 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)
 {
 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.  */
 }
 
 /* Initialize the GCC target structure.  */