OSDN Git Service

Check preferred vector mode for vector type in estimate_move_cost.
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Nov 2010 20:08:27 +0000 (20:08 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Nov 2010 20:08:27 +0000 (20:08 +0000)
gcc/

2010-11-10  H.J. Lu  <hongjiu.lu@intel.com>

PR tree-optimization/46414
* tree-inline.c (estimate_move_cost): Check preferred vector
mode for vector type.

gcc/testsuite/

2010-11-10  H.J. Lu  <hongjiu.lu@intel.com>

PR tree-optimization/46414
* gcc.target/i386/recip-vec-sqrtf-avx.c: Updated for loop
unrolling.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c
gcc/tree-inline.c

index cad8716..1bb3d88 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR tree-optimization/46414
+       * tree-inline.c (estimate_move_cost): Check preferred vector
+       mode for vector type.
+
 2010-11-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/alpha/osf5.h (ASM_SPEC): Remove -nocpp.
index ba0a4c1..b00c673 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR tree-optimization/46414
+       * gcc.target/i386/recip-vec-sqrtf-avx.c: Updated for loop
+       unrolling.
+
 2010-11-10  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/46411
index 506df88..5a8e696 100644 (file)
@@ -32,4 +32,4 @@ void t3(void)
 }
 
 /* Last loop is small enough to be fully unrolled.  */
-/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 4 } } */
+/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 6 } } */
index fc470a7..2c05835 100644 (file)
@@ -3249,6 +3249,16 @@ estimate_move_cost (tree type)
 
   gcc_assert (!VOID_TYPE_P (type));
 
+  if (TREE_CODE (type) == VECTOR_TYPE)
+    {
+      enum machine_mode inner = TYPE_MODE (TREE_TYPE (type));
+      enum machine_mode simd
+       = targetm.vectorize.preferred_simd_mode (inner);
+      int simd_mode_size = GET_MODE_SIZE (simd);
+      return ((GET_MODE_SIZE (TYPE_MODE (type)) + simd_mode_size - 1)
+             / simd_mode_size);
+    }
+
   size = int_size_in_bytes (type);
 
   if (size < 0 || size > MOVE_MAX_PIECES * MOVE_RATIO (!optimize_size))