[PATCH] Merging Cilk Plus to GCC (2 of approximately 22)

2012-09-05 Thread Iyer, Balaji V
Hello Everyone,
Attached, please find a patch that will add regression test cases for 
elemental function implementation in C. 

Here are the Changelog entries:
===
gcc/testsuite/ChangeLog
2012-09-05  Balaji V. Iyer  balaji.v.i...@intel.com

* gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c: New test.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test7.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test8.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/32bit/test9.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow2.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/switch_stmt.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test1.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test13.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test14.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test15.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test16.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test17.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test18.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test2.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test3.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test4.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test5.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/64bit/test6.c: Likewise.
* gcc.dg/cilk-plus/elem_fn_tests/elem_fn.exp: New script.

==

Thanking You,

Yours Sincerely,

Balaji V. Iyer.
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c 
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c
new file mode 100644
index 000..a33ea3b
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test1.c
@@ -0,0 +1,30 @@
+/* { dg-final { scan-assembler simdsimd  } } */
+
+/* This test will insert the clone for the function ef_add inside the function
+ * main (the non-masked version).
+ */
+
+#include stdlib.h
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), processor (pentium_4), uniform 
(x,y My_Type ef_add (My_Type x, My_Type y);
+
+My_Type vhx2[10];
+int
+main (int argc, char **argv)
+{
+  My_Type vhx[10];
+  int ii = 9;
+
+  if (argc == 1) 
+for (ii = 0; ii  10; ii++) 
+  vhx[ii] = argc;
+
+  for (ii = 0; ii  10; ii++)
+vhx2[ii] = ef_add(vhx[ii], vhx[ii]);
+ 
+  for (ii = 0; ii  10; ii++)
+if (vhx2[ii] != (argc + argc))
+  abort ();
+  return 0;
+}
+
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c 
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c
new file mode 100644
index 000..477369e
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test10.c
@@ -0,0 +1,12 @@
+/* { dg-final { scan-assembler simdsimd  } } */
+
+/* This test will create 2 clones of the function below,
+ * for the pentium4 with sse3 processor.
+ */
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), processor (pentium_4_sse3), linear(y), 
uniform (x
+My_Type ef_add (My_Type x, My_Type y) 
+
+{
+  return x + y;
+}
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c 
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c
new file mode 100644
index 000..197064b
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test11.c
@@ -0,0 +1,12 @@
+/* { dg-final { scan-assembler simdsimd  } } */
+
+/* This test will create 1 clones of the function below, just mask 
+ * for the pentium4 processor.
+ */
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), mask, processor (pentium_4_sse3), 
linear(y), uniform (x
+My_Type ef_add (My_Type x, My_Type y) 
+
+{
+  return x + y;
+}
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c 
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c
new file mode 100644
index 000..1c78356
--- /dev/null
+++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test12.c
@@ -0,0 +1,12 @@
+/* { dg-final { scan-assembler simdsimd  } } */
+
+/* This test will create 1 clones of the function below, just no mask 
+ * for the pentium4 with sse3 processor.
+ */
+#define My_Type float
+__attribute__ ((vector(vectorlength(4), nomask, processor (pentium_4_sse3), 
linear(y), uniform (x
+My_Type ef_add (My_Type x, My_Type y) 
+
+{
+  return x + y;
+}
diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test7.c 
gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test7.c
new file mode 100644
index 000..6720a8c
--- /dev/null

Re: [PATCH] Merging Cilk Plus to GCC (2 of approximately 22)

2012-09-05 Thread Joseph S. Myers
On Wed, 5 Sep 2012, Iyer, Balaji V wrote:

 Hello Everyone,
   Attached, please find a patch that will add regression test cases 
 for elemental function implementation in C.

Can the tests be arranged so that all functionality that isn't 
intrinsically target-specific is tested for all targets - or at least, so 
it's easy for testsuite support for extra targets to be added without 
needing to duplicate lots of tests?

You do:

# For 64 bit architectures, we can run both 32 bit and 64 bit tests. 
if { [istarget x86_64-*-*] } then {

This is the wrong approach.  i?86-*-* targets can also support 64-bit 
while defaulting to 32-bit.  Instead, leave it up to the user to specify 
the multilib options with which to test - if they wish to run both 32-bit 
and 64-bit tests, they can run the whole testsuite in both modes.

Again, there may be more issues; in particular I'll need to review whether 
the entirety of the actual implementation is sufficiently covered by 
testcases once a revised implementation patch is available.

-- 
Joseph S. Myers
jos...@codesourcery.com