i386.c (ix86_preferred_simd_mode): Even for TARGET_AVX if not TARGET_PREFER_AVX128 return 32-byte integer vectors.

* config/i386/i386.c (ix86_preferred_simd_mode): Even for TARGET_AVX
	if not TARGET_PREFER_AVX128 return 32-byte integer vectors.

	* 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.

From-SVN: r181170
This commit is contained in:
Jakub Jelinek 2011-11-08 17:29:51 +01:00 committed by Jakub Jelinek
parent 3d3b05ff4f
commit 8ebe5133dc
5 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2011-11-08 Jakub Jelinek <jakub@redhat.com>
* 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 <rguenther@suse.de>
PR tree-optimization/51012

View File

@ -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)

View File

@ -1,3 +1,9 @@
2011-11-08 Jakub Jelinek <jakub@redhat.com>
* 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 <rguenther@suse.de>
PR tree-optimization/51012

View File

@ -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" } } */

View File

@ -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" } } */