This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Add more 256bit AVX testcases


Hi,

I checked in this patch to add more 256bit AVX testcases.

H.J.
---
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.

--- /dev/null	2010-10-13 10:21:15.312298381 -0700
+++ gcc/gcc/testsuite/gcc.target/i386/recip-vec-divf-avx.c	2010-10-13 19:38:16.655141276 -0700
@@ -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" } } */
--- /dev/null	2010-10-13 10:21:15.312298381 -0700
+++ gcc/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c	2010-10-13 19:38:16.639149579 -0700
@@ -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 } } */
--- /dev/null	2010-10-13 10:21:15.312298381 -0700
+++ gcc/gcc/testsuite/gcc.target/i386/vectorize4-avx.c	2010-10-13 19:38:16.647141174 -0700
@@ -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" } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]