In general, vectorization tests whose expectations on x86 depend on
whather AVX is available should only consider AVX available if
-mprefer-avx128 is not enabled.  Some of the effective-target
functions in target-supports.exp handle this properly, but
check_effective_target_vect_sizes_32B_16B does not do so, resulting in
various test failures in configurations with -mprefer-avx128.

This patch makes check_effective_target_vect_sizes_32B_16B follow
other functions in checking check_prefer_avx128.  It fixes the
following failures for x86_64-linux-gnu --with-arch=bdver3
--with-tune=bdver3.  OK to commit?

FAIL: gcc.dg/vect/vect-over-widen-1.c scan-tree-dump-times vect 
"vect_recog_over_widening_pattern: detected" 8
FAIL: gcc.dg/vect/vect-over-widen-4.c scan-tree-dump-times vect 
"vect_recog_over_widening_pattern: detected" 8
FAIL: gcc.dg/vect/slp-perm-9.c scan-tree-dump-times vect "vectorized 1 loops" 2
FAIL: gcc.dg/vect/slp-perm-9.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 1
FAIL: gcc.dg/vect/vect-over-widen-1.c -flto -ffat-lto-objects  
scan-tree-dump-times vect "vect_recog_over_widening_pattern: detected" 8
FAIL: gcc.dg/vect/vect-over-widen-4.c -flto -ffat-lto-objects  
scan-tree-dump-times vect "vect_recog_over_widening_pattern: detected" 8
FAIL: gcc.dg/vect/slp-perm-9.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorized 1 loops" 2
FAIL: gcc.dg/vect/slp-perm-9.c -flto -ffat-lto-objects  scan-tree-dump-times 
vect "vectorizing stmts using SLP" 1

(I still see some gcc.dg/vect/costmodel/ failures that are unchanged
by this patch: costmodel-vect-31.c, costmodel-vect-68.c and
costmodel-fast-math-vect-pr29925.c.)

2014-05-10  Joseph Myers  <jos...@codesourcery.com>

        * lib/target-supports.exp
        (check_effective_target_vect_sizes_32B_16B): Return false if
        128-bit AVX vectors preferred.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp       (revision 210270)
+++ gcc/testsuite/lib/target-supports.exp       (working copy)
@@ -5257,7 +5257,11 @@
 # Return true if 32- and 16-bytes vectors are available.
 
 proc check_effective_target_vect_sizes_32B_16B { } {
-  return [check_avx_available];
+  if { [check_avx_available] && ![check_prefer_avx128] } {
+     return 1;
+  } else {
+    return 0;
+  }
 }
 
 # Return true if 128-bits vectors are preferred even if 256-bits vectors

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to