Patchwork PATCH: Add more 256bit AVX testcases

login
register
mail settings
Submitter H.J. Lu
Date Oct. 14, 2010, 2:44 a.m.
Message ID <20101014024400.GA13709@intel.com>
Download mbox | patch
Permalink /patch/67778/
State New
Headers show

Comments

H.J. Lu - Oct. 14, 2010, 2:44 a.m.
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.

Patch

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