From patchwork Wed Sep 5 23:05:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 181977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 821AF2C008A for ; Thu, 6 Sep 2012 09:06:04 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1347491165; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:CC:Subject:Date:Message-ID:Content-Type: MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=epZsb6i pvvZgIvMUhSNUZGZpmuE=; b=PufKI201J0tloyJXnBfdebmaDzaybLOTEtclb/t uQmrvf/8F1VbPPnZ7GFDf3UuEcORPiewSKwfD563pOZK+H1rVBgfVylXVgw9ZttG h2q8pvT4WbWmrrsTcSlmz9oPp98PuyLuZJCPupg3GWEJGbjM3/oxQ4KNpXlBlYsf voRY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-ExtLoop1:Received:Received:From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=kA76zGfxIwh5zT5Xlpu+Y3nOWRqQAIEseA2Co94os0wcNGghCLBV9EbfVO8Eea z13nXoev0aqBXosGTLssuYO5G7q56hDhlUzkSyhlihSav+aPVtN26Jl90w6KYWcI 85sRVps7bp0Xwt6F0kidO37xs3oRNGqzrJ93FzemOuH88=; Received: (qmail 21698 invoked by alias); 5 Sep 2012 23:06:00 -0000 Received: (qmail 21684 invoked by uid 22791); 5 Sep 2012 23:05:57 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Sep 2012 23:05:35 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 05 Sep 2012 16:05:34 -0700 X-ExtLoop1: 1 Received: from fmsmsx103.amr.corp.intel.com ([10.19.9.34]) by orsmga002.jf.intel.com with ESMTP; 05 Sep 2012 16:05:33 -0700 Received: from fmsmsx102.amr.corp.intel.com ([169.254.2.223]) by FMSMSX103.amr.corp.intel.com ([169.254.3.13]) with mapi id 14.01.0355.002; Wed, 5 Sep 2012 16:05:33 -0700 From: "Iyer, Balaji V" To: "gcc-patches@gcc.gnu.org" CC: "Aldy Hernandez (aldyh@redhat.com)" , Jeff Law , "rth@redhat.com" Subject: [PATCH] Merging Cilk Plus to GCC (2 of approximately 22) Date: Wed, 5 Sep 2012 23:05:33 +0000 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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 0000000..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 +#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 0000000..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 0000000..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 0000000..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 0000000..6720a8c --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test7.c @@ -0,0 +1,12 @@ + +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 1 clone of the function below, just one for mask + * for the pentium4 processor. + */ +#define My_Type float +__attribute__ ((vector(vectorlength(4), mask, processor (pentium_4), 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/test8.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test8.c new file mode 100644 index 0000000..7f40220 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test8.c @@ -0,0 +1,12 @@ + +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 1 clone of the function below, just one for nomask + * for the pentium4 processor. + */ +#define My_Type float +__attribute__ ((vector(vectorlength(4), nomask, processor (pentium_4), 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/test9.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test9.c new file mode 100644 index 0000000..0a5caf8 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/32bit/test9.c @@ -0,0 +1,12 @@ + +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 2 clones of the function below, + * for the pentium4 processor. + */ +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (pentium_4), 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/64bit/ctrl_flow.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow.c new file mode 100644 index 0000000..8df372a --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow.c @@ -0,0 +1,15 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 2 clones of the function below, one for mask and one + without the mask + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (core_i7_sse4_2), uniform (x,y)))) +My_Type ef_add (My_Type x, My_Type y) + +{ + if (x > 0) + return x + y; + else + return (x-y); +} diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow2.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow2.c new file mode 100644 index 0000000..30e710f --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/ctrl_flow2.c @@ -0,0 +1,22 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ + +/* This test will create 2 clones of the function below, one for mask and one + without the mask + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (core_i7_sse4_2), uniform (x,y)))) +My_Type ef_add (My_Type x, My_Type y) + +{ + if (x > 0) { + if (y > 0) { + return x + y; + } + else + return (x-y); + } + else + return 0; +} + diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/switch_stmt.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/switch_stmt.c new file mode 100644 index 0000000..0d9db6f --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/switch_stmt.c @@ -0,0 +1,25 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 2 clones of the function below, one for mask and one + without the mask + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (core_i7_sse4_2), uniform (x,y)))) +My_Type ef_add (My_Type x, My_Type y) + +{ + switch ((int)x) { + case 0: + case 1: + x = x + 1; + return x+y; + case 2: + y = y + 2; + return x-y; + default: + return 0; + } + return 0; + +} + diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test1.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test1.c new file mode 100644 index 0000000..576821a --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/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 +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (core_i7_sse4_2), 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/64bit/test13.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test13.c new file mode 100644 index 0000000..18c8844 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test13.c @@ -0,0 +1,13 @@ +/* { 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 (core2_duo_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/64bit/test14.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test14.c new file mode 100644 index 0000000..f154d49 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test14.c @@ -0,0 +1,14 @@ + +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 1 clones of the function below, just the mask + * for the pentium4 with sse3 processor. + */ + +#define My_Type float +__attribute__ ((vector(mask, vectorlength(4), processor (core2_duo_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/64bit/test15.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test15.c new file mode 100644 index 0000000..8a458fc --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test15.c @@ -0,0 +1,14 @@ + +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 1 clones of the function below, just the mask + * for the pentium4 with sse3 processor. + */ + +#define My_Type float +__attribute__ ((vector(nomask, vectorlength(4), processor (core2_duo_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/64bit/test16.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test16.c new file mode 100644 index 0000000..fcfc5c0 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test16.c @@ -0,0 +1,14 @@ +/* { 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 (core_2_duo_sse_4_1), 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/64bit/test17.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test17.c new file mode 100644 index 0000000..847c219 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test17.c @@ -0,0 +1,14 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ + +/* This test will create 2 clones of the function below, + * for the core2_duo with sse 4.1 processor. + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (core_2_duo_sse_4_1), linear(y), uniform (x), nomask))) +My_Type ef_add (My_Type x, My_Type y) + +{ + return x + y; +} + diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test18.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test18.c new file mode 100644 index 0000000..daa1546 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test18.c @@ -0,0 +1,14 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ + +/* This test will create 1 clones of the function below, just mask + * for the core2_duo with sse 4.1 processor. + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (core_2_duo_sse_4_1), linear(y), mask, 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/64bit/test2.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test2.c new file mode 100644 index 0000000..a515c53 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test2.c @@ -0,0 +1,14 @@ + +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 2 clones of the function below, one for mask and one + without the mask + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), processor (core_i7_sse4_2), uniform (x,y)))) +My_Type ef_add (My_Type x, My_Type y) + +{ + return x + y; +} + diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test3.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test3.c new file mode 100644 index 0000000..d9e3fe1 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test3.c @@ -0,0 +1,13 @@ + +/* { dg-final { scan-assembler "simdsimd" } } */ +/* This test will create 1 clone of the function below, just one for mask + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), mask, processor (core_i7_sse4_2), uniform (x,y)))) +My_Type ef_add (My_Type x, My_Type y) + +{ + return x + y; +} + diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test4.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test4.c new file mode 100644 index 0000000..9aa36cc --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test4.c @@ -0,0 +1,13 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ + +/* This test will create 1 clone of the function below, just one for nomask + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), nomask, processor (core_i7_sse4_2), uniform (x,y)))) +My_Type ef_add (My_Type x, My_Type y) + +{ + return x + y; +} + diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test5.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test5.c new file mode 100644 index 0000000..6688980 --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test5.c @@ -0,0 +1,14 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ + +/* This test will create 1 clone of the function below, just one for nomask and + do a linear for y variable + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), nomask, processor (core_i7_sse4_2), uniform (x), linear(y)))) +My_Type ef_add (My_Type x, My_Type y) + +{ + return x + y; +} + diff --git gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test6.c gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test6.c new file mode 100644 index 0000000..4ec317f --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/64bit/test6.c @@ -0,0 +1,13 @@ +/* { dg-final { scan-assembler "simdsimd" } } */ + +/* This test will create 1 clone of the function below, just one for mask + */ + +#define My_Type float +__attribute__ ((vector(vectorlength(4), mask, processor (core_i7_sse4_2), 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/elem_fn.exp gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/elem_fn.exp new file mode 100644 index 0000000..50a27ba --- /dev/null +++ gcc/testsuite/gcc.dg/cilk-plus/elem_fn_tests/elem_fn.exp @@ -0,0 +1,50 @@ +# Copyright (C) 2012 +# Free Software Foundation, Inc. + +# Contributed by Balaji V. Iyer +# Intel Corporation. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + + +# Exit immediately if this isn't a x86 target. +if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then { + return +} + +# Load support procs. +load_lib gcc-dg.exp +set tests_32bit [lsort [glob -nocomplain $srcdir/$subdir/32bit/*.\[cS\]]] +set tests_64bit [lsort [glob -nocomplain $srcdir/$subdir/64bit/*.\[cS\]]] + +if { [istarget i?86*-*-*] } then { + +# Main loop. +dg-runtest $tests_32bit " -O3 -ftree-vectorize -fcilkplus" " " +# All done. +dg-finish +} + +# For 64 bit architectures, we can run both 32 bit and 64 bit tests. +if { [istarget x86_64-*-*] } then { + +# Main loop. +dg-runtest $tests_32bit "-m32 -O3 -ftree-vectorize -fcilkplus" " " +# All done. +dg-finish +# Main loop. +dg-runtest $tests_64bit " -O3 -ftree-vectorize -fcilkplus" " " +# All done. +dg-finish +}