]> gcc.gnu.org Git - gcc.git/commitdiff
sse-recip-vec.c: Add file, missing from my previous commit.
authorUros Bizjak <ubizjak@gmail.com>
Sun, 17 Jun 2007 07:20:21 +0000 (09:20 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 17 Jun 2007 07:20:21 +0000 (09:20 +0200)
* gcc.target/i386/sse-recip-vec.c: Add file, missing from my
previous commit.

From-SVN: r125767

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/recip-divf.c
gcc/testsuite/gcc.target/i386/recip-sqrtf.c
gcc/testsuite/gcc.target/i386/recip-vec-divf.c
gcc/testsuite/gcc.target/i386/recip-vec-sqrtf.c
gcc/testsuite/gcc.target/i386/sse-recip-vec.c [new file with mode: 0644]

index cc98594c016fe5888a021ba94e7fbc503e8312f9..83864348f78f67b95c382aa133ffdf5a2dba1752 100644 (file)
@@ -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>
 
index 0a2e9c8bd81c2fa2122290dabf82b892ef290663..3b6f5757a6bc4850a3c16b8312ba5d534035ed41 100644 (file)
@@ -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)
 {
index c387077aae26a7005c7a0bb03a313916bf2bf479..b6c298feba709d5167e8da62dd37f048a7f3955e 100644 (file)
@@ -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);
 }
index bf41e6c4fde6da25457117b309c8e22d88541c7c..e4af992d5bf20266695b937e7b0e8a4bde52a5e4 100644 (file)
@@ -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];
index 2eb3f861f425b2f0f9ad756500ca0228db800b67..af444cf55dd78c61d0627d2300d4f0cb85a1ec40 100644 (file)
@@ -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 (file)
index 0000000..d142aa0
--- /dev/null
@@ -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;
+}
This page took 0.121406 seconds and 5 git commands to generate.