diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2007-06-17 09:20:21 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2007-06-17 09:20:21 +0200 |
commit | b92d0c71266b06e5b95023bb36b18062429a48bd (patch) | |
tree | 8e05008f87e3a4a7167e4827a102130c9670fd53 | |
parent | 6e34d7b8a6de70db9c6a65610fd394c440ba5061 (diff) | |
download | gcc-b92d0c71266b06e5b95023bb36b18062429a48bd.zip gcc-b92d0c71266b06e5b95023bb36b18062429a48bd.tar.gz gcc-b92d0c71266b06e5b95023bb36b18062429a48bd.tar.bz2 |
sse-recip-vec.c: Add file, missing from my previous commit.
* gcc.target/i386/sse-recip-vec.c: Add file, missing from my
previous commit.
From-SVN: r125767
-rw-r--r-- | gcc/testsuite/ChangeLog | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/recip-divf.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/recip-sqrtf.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/recip-vec-divf.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/recip-vec-sqrtf.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/sse-recip-vec.c | 51 |
6 files changed, 57 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc98594..8386434 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -6,6 +6,7 @@ * gcc.target/i386/recip-vec-divf.c: Ditto. * gcc.target/i386/recip-vec-sqrtf.c: Ditto. * gcc.target/i386/sse-recip.c: Ditto. + * gcc.target/i386/sse-recip-vec.c: Ditto. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> diff --git a/gcc/testsuite/gcc.target/i386/recip-divf.c b/gcc/testsuite/gcc.target/i386/recip-divf.c index 0a2e9c8..3b6f575 100644 --- a/gcc/testsuite/gcc.target/i386/recip-divf.c +++ b/gcc/testsuite/gcc.target/i386/recip-divf.c @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O2 -ffast-math -msse2 -mfpmath=sse -mrecip" } */ +/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */ float t1(float a, float b) { diff --git a/gcc/testsuite/gcc.target/i386/recip-sqrtf.c b/gcc/testsuite/gcc.target/i386/recip-sqrtf.c index c387077..b6c298f 100644 --- a/gcc/testsuite/gcc.target/i386/recip-sqrtf.c +++ b/gcc/testsuite/gcc.target/i386/recip-sqrtf.c @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O2 -ffast-math -msse2 -mfpmath=sse -mrecip" } */ +/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */ extern float sqrtf (float); @@ -8,7 +8,7 @@ float t1(float a, float b) return a/sqrtf(b); } -float t2(float x, float a, float b) +float t2(float a, float b) { return sqrtf(a/b); } diff --git a/gcc/testsuite/gcc.target/i386/recip-vec-divf.c b/gcc/testsuite/gcc.target/i386/recip-vec-divf.c index bf41e6c..e4af992 100644 --- a/gcc/testsuite/gcc.target/i386/recip-vec-divf.c +++ b/gcc/testsuite/gcc.target/i386/recip-vec-divf.c @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse2 -mfpmath=sse -mrecip" } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */ float a[16]; float b[16]; diff --git a/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf.c b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf.c index 2eb3f86..af444cf 100644 --- a/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf.c +++ b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf.c @@ -1,5 +1,5 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ -/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse2 -mfpmath=sse -mrecip" } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */ float a[16]; float b[16]; diff --git a/gcc/testsuite/gcc.target/i386/sse-recip-vec.c b/gcc/testsuite/gcc.target/i386/sse-recip-vec.c new file mode 100644 index 0000000..d142aa0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse-recip-vec.c @@ -0,0 +1,51 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -msse -mfpmath=sse -mrecip" } */ + +#include "../../gcc.dg/i386-cpuid.h" + +extern float sqrtf (float); +extern void abort (void); + +#define N 8 + +int __attribute__((noinline)) +main1 () +{ + float a[N] = { 0.f, 18.f, 108.f, 324.f, 720.f, 1944.f, 3087.f, 5832.f }; + float b[N] = { 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f }; + float r[N]; + + float rc[N] = { 0.f, 3.f, 6.f, 9.f, 12.f, 18.f, 21.f, 27.f }; + + int i; + + for (i = 0; i < N; i++) + { + r[i] = sqrtf (a[i] / b[i]); + } + + /* check results: */ + for (i = 0; i < N; i++) + { + if (r[i] != rc[i]) + abort(); + } + + return 0; +} + +int +main () +{ + unsigned long cpu_facilities; + + cpu_facilities = i386_cpuid (); + + if ((cpu_facilities & (bit_MMX | bit_SSE | bit_CMOV)) + != (bit_MMX | bit_SSE | bit_CMOV)) + /* If host has no vector support, pass. */ + return 0; + + main1 (); + return 0; +} |