diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2010-10-14 02:42:50 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2010-10-13 19:42:50 -0700 |
commit | 0d16f46289b7dba6d45325c83609f48b18749204 (patch) | |
tree | 2fe1e68b76e3dfbf52d39ae3d46b06192f0795c1 /gcc | |
parent | 7f82d2aef8d222e9223d65c6c282f10fe67b4178 (diff) | |
download | gcc-0d16f46289b7dba6d45325c83609f48b18749204.zip gcc-0d16f46289b7dba6d45325c83609f48b18749204.tar.gz gcc-0d16f46289b7dba6d45325c83609f48b18749204.tar.bz2 |
Add more 256bit AVX testcases.
2010-10-13 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/recip-vec-sqrtf-avx.c: New.
* gcc.target/i386/recip-vec-divf-avx.c: Likewise.
* gcc.target/i386/vectorize4-avx.c: Likewise.
From-SVN: r165449
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/recip-vec-divf-avx.c | 16 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c | 34 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/vectorize4-avx.c | 14 |
4 files changed, 70 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 84e2669..5dda0f5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2010-10-13 H.J. Lu <hongjiu.lu@intel.com> + * gcc.target/i386/recip-vec-sqrtf-avx.c: New. + * gcc.target/i386/recip-vec-divf-avx.c: Likewise. + * gcc.target/i386/vectorize4-avx.c: Likewise. + +2010-10-13 H.J. Lu <hongjiu.lu@intel.com> + * gcc.target/i386/avx-copysign-vec.c: New. * gcc.target/i386/avx-copysignf-vec.c: Likewise. diff --git a/gcc/testsuite/gcc.target/i386/recip-vec-divf-avx.c b/gcc/testsuite/gcc.target/i386/recip-vec-divf-avx.c new file mode 100644 index 0000000..29ed276 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/recip-vec-divf-avx.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx -mfpmath=sse -mrecip" } */ + +float a[16]; +float b[16]; +float r[16]; + +void t1(void) +{ + int i; + + for (i = 0; i < 16; i++) + r[i] = a[i] / b[i]; +} + +/* { dg-final { scan-assembler "vrcpps" } } */ diff --git a/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c new file mode 100644 index 0000000..6caa3c0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx -mfpmath=sse -mrecip" } */ + +float a[16]; +float b[16]; +float r[16]; + +extern float sqrtf (float); + +void t1(void) +{ + int i; + + for (i = 0; i < 16; i++) + r[i] = a[i] / sqrtf (b[i]); +} + +void t2(void) +{ + int i; + + for (i = 0; i < 16; i++) + r[i] = sqrtf (a[i] / b[i]); +} + +void t3(void) +{ + int i; + + for (i = 0; i < 16; i++) + r[i] = sqrtf (a[i]); +} + +/* { dg-final { scan-assembler-times "vrsqrtps" 3 } } */ diff --git a/gcc/testsuite/gcc.target/i386/vectorize4-avx.c b/gcc/testsuite/gcc.target/i386/vectorize4-avx.c new file mode 100644 index 0000000..d121f6a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vectorize4-avx.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx" } */ + + +extern double sqrt (double __x); +calc_freq (int *dest) +{ + float tmp_out[257]; + int i; + for (i = 0; i < 256; i++) + dest[i] = sqrt (tmp_out[i]); +} + +/* { dg-final { scan-assembler "vsqrtpd" } } */ |