diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7db3a37a442..3062032ee46 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-11-08 Jakub Jelinek + + * config/i386/i386.c (ix86_preferred_simd_mode): Even for TARGET_AVX + if not TARGET_PREFER_AVX128 return 32-byte integer vectors. + 2011-11-08 Richard Guenther PR tree-optimization/51012 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 799e12b2b14..acf9ad8a0ea 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -38076,13 +38076,13 @@ ix86_preferred_simd_mode (enum machine_mode mode) switch (mode) { case QImode: - return TARGET_AVX2 ? V32QImode : V16QImode; + return (TARGET_AVX && !TARGET_PREFER_AVX128) ? V32QImode : V16QImode; case HImode: - return TARGET_AVX2 ? V16HImode : V8HImode; + return (TARGET_AVX && !TARGET_PREFER_AVX128) ? V16HImode : V8HImode; case SImode: - return TARGET_AVX2 ? V8SImode : V4SImode; + return (TARGET_AVX && !TARGET_PREFER_AVX128) ? V8SImode : V4SImode; case DImode: - return TARGET_AVX2 ? V4DImode : V2DImode; + return (TARGET_AVX && !TARGET_PREFER_AVX128) ? V4DImode : V2DImode; case SFmode: if (TARGET_AVX && !TARGET_PREFER_AVX128) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1a7528a74e2..da0063417ac 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-11-08 Jakub Jelinek + + * gcc.target/i386/avx-cvt-2.c: Adjust for 32-byte integer vectors + being prefered even for -mavx. + * gcc.target/i386/avx-cvt-3.c: New test. + 2011-11-08 Richard Guenther PR tree-optimization/51012 diff --git a/gcc/testsuite/gcc.target/i386/avx-cvt-2.c b/gcc/testsuite/gcc.target/i386/avx-cvt-2.c index 68206f5a0e7..de1afeccafd 100644 --- a/gcc/testsuite/gcc.target/i386/avx-cvt-2.c +++ b/gcc/testsuite/gcc.target/i386/avx-cvt-2.c @@ -5,9 +5,9 @@ /* { dg-final { scan-tree-dump-times "note: vectorized 1 loops in function" 6 "vect" } } */ /* { dg-final { scan-assembler "vcvttpd2dq(y\[^\n\r\]*%xmm|\[^\n\r\]*xmm\[^\n\r\]*YMMWORD PTR)" } } */ -/* { dg-final { scan-assembler "vcvtdq2ps\[^\n\r\]*xmm" } } */ +/* { dg-final { scan-assembler "vcvtdq2ps\[^\n\r\]*ymm" } } */ /* { dg-final { scan-assembler "vcvtps2pd\[^\n\r\]*(%xmm\[^\n\r\]*%ymm|ymm\[^\n\r\]*xmm)" } } */ /* { dg-final { scan-assembler "vcvttps2dq\[^\n\r\]*ymm" } } */ -/* { dg-final { scan-assembler "vcvtdq2pd\[^\n\r\]*xmm\[^\n\r\]*xmm" } } */ +/* { dg-final { scan-assembler "vcvtdq2pd\[^\n\r\]*(%xmm\[^\n\r\]*%ymm|ymm\[^\n\r\]*xmm)" } } */ /* { dg-final { scan-assembler "vcvtpd2ps(y\[^\n\r\]*%xmm|\[^\n\r\]*xmm\[^\n\r\]*YMMWORD PTR)" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx-cvt-3.c b/gcc/testsuite/gcc.target/i386/avx-cvt-3.c new file mode 100644 index 00000000000..a9b898a95a9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx-cvt-3.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mavx -mno-avx2 -mtune=generic -mprefer-avx128 -fdump-tree-vect-details" } */ + +#include "avx-cvt-1.c" + +/* { dg-final { scan-tree-dump-times "note: vectorized 1 loops in function" 6 "vect" } } */ +/* { dg-final { scan-assembler "vcvttpd2dq(x\[^\n\r\]*%xmm|\[^\n\r\]*xmm\[^\n\r\]*XMMWORD PTR)" } } */ +/* { dg-final { scan-assembler "vcvtdq2ps\[^\n\r\]*xmm" } } */ +/* { dg-final { scan-assembler "vcvtps2pd\[^\n\r\]*(%xmm\[^\n\r\]*%xmm|xmm\[^\n\r\]*xmm)" } } */ +/* { dg-final { scan-assembler "vcvttps2dq\[^\n\r\]*xmm" } } */ +/* { dg-final { scan-assembler "vcvtdq2pd\[^\n\r\]*xmm\[^\n\r\]*xmm" } } */ +/* { dg-final { scan-assembler "vcvtpd2ps(x\[^\n\r\]*%xmm|\[^\n\r\]*xmm\[^\n\r\]*XMMWORD PTR)" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */