From patchwork Thu May 31 19:57:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923573 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478862-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qPrXA2lG"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdY331n3z9s16 for ; Fri, 1 Jun 2018 05:57:42 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=SqYK+yCHl0svlOGc27qyC0lQezG8GvBr7JMVALXpQ0TubGkyq2 8itEVTNygEU6Xws2+sWsKbEyQyv8SFdXSjI0VmriV0bwDtRmFp0gl+VnN/AEuzLU CozoP25erP8PwoD7rs0gA0pQ3NjsAASIUxvB3L8Ibp285LeqII27z8XeA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=/thND3xWI4IfiPI9O2aoq1YDHoU=; b=qPrXA2lGTh3FK9ViXOpp EgY9Vjz2wPVICWGtx0LO7ro8MW6DDlbbqf0xK6GXe8b+9vfI/BDX1klydLEnKIgH OuQuzXl8lILrb6hUKEsZHqUe6ArYLz92A4dzTkqKEvGErRGen0C7UreIn7JW88/j p/JwKin7bxM0y4ZGYDLMQZQ= Received: (qmail 63276 invoked by alias); 31 May 2018 19:57:33 -0000 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 Received: (qmail 63249 invoked by uid 89); 31 May 2018 19:57:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:1527794, H*i:sk:1527794, schmidt, Schmidt X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:57:29 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnGCN146071 for ; Thu, 31 May 2018 15:57:28 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jamx0xrda-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:57:27 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 15:57:26 -0400 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 15:57:23 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJvMR114942560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 19:57:22 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B528AC041; Thu, 31 May 2018 15:58:49 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 04E21AC03A; Thu, 31 May 2018 15:58:48 -0400 (EDT) Subject: [PATCH, rs6000 1/9] Testcase coverage for vec_xl() instrinsics From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:57:21 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-0048-0000-0000-000002738CEB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040444; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:57:25 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-0049-0000-0000-000045498C1A Message-Id: <1527796641.15912.25.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=859 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Add testcase coverage for variations of the vec_xl() intrinsic. Regtest clean across assorted Linux systems (p6-p9). OK for trunk? Thanks, -Will [testsuite] 2018-05-31 Will Schmidt * gcc.target/powerpc/fold-vec-load-vec_xl-char.c * gcc.target/powerpc/fold-vec-load-vec_xl-double.c * gcc.target/powerpc/fold-vec-load-vec_xl-float.c * gcc.target/powerpc/fold-vec-load-vec_xl-int.c * gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c * gcc.target/powerpc/fold-vec-load-vec_xl-short.c diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-char.c new file mode 100644 index 0000000..2f60a71 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-char.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xl with char + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed char, signed long long, vector signed char); +BUILD_VAR_TEST( test2, vector signed char, signed int, vector signed char); +BUILD_CST_TEST( test3, vector signed char, 12, vector signed char); +BUILD_VAR_TEST( test4, vector unsigned char, signed long long, vector unsigned char); +BUILD_VAR_TEST( test5, vector unsigned char, signed int, vector unsigned char); +BUILD_CST_TEST( test6, vector unsigned char, 12, vector unsigned char); + +BUILD_VAR_TEST( test7, vector signed char, signed long long, signed char); +BUILD_VAR_TEST( test8, vector signed char, signed int, signed char); +BUILD_CST_TEST( test9, vector signed char, 12, signed char); +BUILD_VAR_TEST( test10, vector unsigned char, signed long long, unsigned char); +BUILD_VAR_TEST( test11, vector unsigned char, signed int, unsigned char); +BUILD_CST_TEST( test12, vector unsigned char, 12, unsigned char); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-double.c new file mode 100644 index 0000000..d99662a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-double.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_xl with double + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector double, signed long long, vector double); +BUILD_VAR_TEST( test2, vector double, signed int, vector double); +BUILD_CST_TEST( test3, vector double, 12, vector double); +BUILD_VAR_TEST( test4, vector double, signed long long, double); +BUILD_VAR_TEST( test5, vector double, signed int, double); +BUILD_CST_TEST( test6, vector double, 12, double); + +/* { dg-final { scan-assembler-times "lxvd2x|lxvx|lvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-float.c new file mode 100644 index 0000000..365961c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-float.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_xl with float + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector float, signed long long, float); +BUILD_VAR_TEST( test2, vector float, signed int, float); +BUILD_CST_TEST( test3, vector float, 12, float); + +BUILD_VAR_TEST( test4, vector float, signed long long, vector float); +BUILD_VAR_TEST( test5, vector float, signed int, vector float); +BUILD_CST_TEST( test6, vector float, 12, vector float); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-int.c new file mode 100644 index 0000000..bf5f1f8 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-int.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xl with int + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector int, signed long long, int); +BUILD_VAR_TEST( test2, vector int, signed int, int); +BUILD_CST_TEST( test3, vector int, 12, int); +BUILD_VAR_TEST( test4, vector int, signed long long, vector int); +BUILD_VAR_TEST( test5, vector int, signed int, vector int); +BUILD_CST_TEST( test6, vector int, 12, vector int); + +BUILD_VAR_TEST( test7, vector unsigned int, signed long long, unsigned int); +BUILD_VAR_TEST( test8, vector unsigned int, signed int, unsigned int); +BUILD_CST_TEST( test9, vector unsigned int, 12, unsigned int); +BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int); +BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int); +BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c new file mode 100644 index 0000000..6441b6d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-longlong.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xl with long long + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector long long, signed long long, long long); +BUILD_VAR_TEST( test2, vector long long, signed int, long long); +BUILD_CST_TEST( test3, vector long long, 12, long long); +BUILD_VAR_TEST( test4, vector long long, signed long long, vector long long); +BUILD_VAR_TEST( test5, vector long long, signed int, vector long long); +BUILD_CST_TEST( test6, vector long long, 12, vector long long); + +BUILD_VAR_TEST( test7, vector unsigned long long, signed long long, unsigned long long); +BUILD_VAR_TEST( test8, vector unsigned long long, signed int, unsigned long long); +BUILD_CST_TEST( test9, vector unsigned long long, 12, unsigned long long); +BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long); +BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long); +BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long); + +/* { dg-final { scan-assembler-times "lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-short.c new file mode 100644 index 0000000..8bd6647 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_xl-short.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xl with short + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector short, signed long long, short); +BUILD_VAR_TEST( test2, vector short, signed int, short); +BUILD_CST_TEST( test3, vector short, 12, short); +BUILD_VAR_TEST( test4, vector short, signed long long, vector short); +BUILD_VAR_TEST( test5, vector short, signed int, vector short); +BUILD_CST_TEST( test6, vector short, 12, vector short); + +BUILD_VAR_TEST( test7, vector unsigned short, signed long long, unsigned short); +BUILD_VAR_TEST( test8, vector unsigned short, signed int, unsigned short); +BUILD_CST_TEST( test9, vector unsigned short, 12, unsigned short); +BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short); +BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short); +BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ From patchwork Thu May 31 19:57:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478863-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Pd1MAweN"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdYL1P7hz9s16 for ; Fri, 1 Jun 2018 05:57:58 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=imeULpOlETUAELMDxYpzCR17bj3jYoJg2ESFObuxM93blvykFF NY0z0Nmcn1dBy+3rBpmp9dGm5voWD/guxMVJydHCCcW+cPHD2RnBSpEqaUMAlP+l 0OwM5ntJS0PgGzPuDWIMksFrxLlTbEIwKHEnfE3QVhashpyMIqTchpQ78= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=PfJE52sZYDyQAYgfMQAQQAvmInk=; b=Pd1MAweNwJbHw2m8OHm0 DFkM8+HT2tCl84x9rpwvioldBFOchrKeYiV0faMSpxD7gkPmKNw84uC4vjbAfJil Wy742bLvarclHzvSVQ5OrAxwYQtYA/uGWbxpkO3Bi/j9McMnmExaR2hfA2qkqRQD qlOlj7Ed68cDxdZxLS5nOXo= Received: (qmail 64578 invoked by alias); 31 May 2018 19:57:46 -0000 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 Received: (qmail 64409 invoked by uid 89); 31 May 2018 19:57:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:57:41 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnGim146040 for ; Thu, 31 May 2018 15:57:40 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jamx0xrm0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:57:39 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 13:57:39 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 13:57:36 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJvZ3210289494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 12:57:35 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 828DB6E059; Thu, 31 May 2018 13:57:35 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C3DE6E04C; Thu, 31 May 2018 13:57:35 -0600 (MDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 31 May 2018 13:57:34 -0600 (MDT) Subject: [PATCH, rs6000 2/9] Testcase coverage for builtin_vec_xl() instrinsics From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:57:34 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-8235-0000-0000-00000D9FCDA8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040445; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:57:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-8236-0000-0000-000041451DF3 Message-Id: <1527796654.15912.26.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=835 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Add testcase coverage for variations of the builtin_vec_xl() intrinsic. Regtest clean across assorted Linux systems (p6-p9). OK for trunk? Thanks, -Will [testsuite] 2018-05-31 Will Schmidt * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-char.c: New. * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-double.c: New. * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-float.c: New. * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-int.c: New. * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-longlong.c: New. * gcc.target/powerpc/fold-vec-load-builtin_vec_xl-short.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-char.c new file mode 100644 index 0000000..1fc5f16 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-char.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for __builtin_vec_xl with char + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed char, signed long long, signed char); +BUILD_VAR_TEST( test2, vector signed char, signed int, signed char); +BUILD_CST_TEST( test3, vector signed char, 2, signed char); +BUILD_VAR_TEST( test4, vector unsigned char, signed long long, unsigned char); +BUILD_VAR_TEST( test5 ,vector unsigned char, signed int, unsigned char); +BUILD_CST_TEST( test6, vector unsigned char, 4, unsigned char); + +BUILD_VAR_TEST( test7, vector signed char, signed long long, vector signed char); +BUILD_VAR_TEST( test8, vector signed char, signed int, vector signed char); +BUILD_CST_TEST( test9, vector signed char, 6, vector signed char); +BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned char); +BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char); +BUILD_CST_TEST( test12, vector unsigned char, 8, vector unsigned char); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-double.c new file mode 100644 index 0000000..7fbc65d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-double.c @@ -0,0 +1,32 @@ +/* Verify that overloaded built-ins for __builtin_vec_xl with double + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector double, signed long long, double); +BUILD_VAR_TEST( test2, vector double, signed int, double); +BUILD_CST_TEST( test3, vector double, 12, double); + +BUILD_VAR_TEST( test4, vector double, signed long long, vector double); +BUILD_VAR_TEST( test5, vector double, signed int, vector double); +BUILD_CST_TEST( test6, vector double, 12, vector double); + +/* { dg-final { scan-assembler-times "lxvd2x|lxvx|lvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-float.c new file mode 100644 index 0000000..0743b0e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-float.c @@ -0,0 +1,32 @@ +/* Verify that overloaded built-ins for __builtin_vec_xl with float + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector float, signed long long, float); +BUILD_VAR_TEST( test2, vector float, signed int, float); +BUILD_CST_TEST( test3, vector float, 12, float); + +BUILD_VAR_TEST( test4, vector float, signed long long, vector float); +BUILD_VAR_TEST( test5, vector float, signed int, vector float); +BUILD_CST_TEST( test6, vector float, 12, vector float); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-int.c new file mode 100644 index 0000000..5e868f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-int.c @@ -0,0 +1,40 @@ +/* Verify that overloaded built-ins for __builtin_vec_xl with int + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed int, signed long long, signed int); +BUILD_VAR_TEST( test2, vector signed int, signed int, signed int); +BUILD_CST_TEST( test3, vector signed int, 12, signed int); + +BUILD_VAR_TEST( test4, vector unsigned int, signed long long, unsigned int); +BUILD_VAR_TEST( test5, vector unsigned int, signed int, unsigned int); +BUILD_CST_TEST( test6, vector unsigned int, 12, unsigned int); + +BUILD_VAR_TEST( test7, vector signed int, signed long long, vector signed int); +BUILD_VAR_TEST( test8, vector signed int, signed int, vector signed int); +BUILD_CST_TEST( test9, vector signed int, 12, vector signed int); + +BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int); +BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int); +BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-longlong.c new file mode 100644 index 0000000..3f08de4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-longlong.c @@ -0,0 +1,40 @@ +/* Verify that overloaded built-ins for __builtin_vec_xl with long long + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed long long, signed long long, signed long long); +BUILD_VAR_TEST( test2, vector signed long long, signed int, signed long long); +BUILD_CST_TEST( test3, vector signed long long, 12, signed long long); + +BUILD_VAR_TEST( test4, vector unsigned long long, signed long long, unsigned long long); +BUILD_VAR_TEST( test5, vector unsigned long long, signed int, unsigned long long); +BUILD_CST_TEST( test6, vector unsigned long long, 12, unsigned long long); + +BUILD_VAR_TEST( test7, vector signed long long, signed long long, vector signed long long); +BUILD_VAR_TEST( test8, vector signed long long, signed int, vector signed long long); +BUILD_CST_TEST( test9, vector signed long long, 12, vector signed long long); + +BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long); +BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long); +BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long); + +/* { dg-final { scan-assembler-times "lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-short.c new file mode 100644 index 0000000..231a151 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-builtin_vec_xl-short.c @@ -0,0 +1,40 @@ +/* Verify that overloaded built-ins for __builtin_vec_xl with short + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM)\ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return __builtin_vec_xl (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed short, signed long long, signed short); +BUILD_VAR_TEST( test2, vector signed short, signed int, signed short); +BUILD_CST_TEST( test3, vector signed short, 12, signed short); + +BUILD_VAR_TEST( test4, vector unsigned short, signed long long, unsigned short); +BUILD_VAR_TEST( test5, vector unsigned short, signed int, unsigned short); +BUILD_CST_TEST( test6, vector unsigned short, 12, unsigned short); + +BUILD_VAR_TEST( test7, vector signed short, signed long long, vector signed short); +BUILD_VAR_TEST( test8, vector signed short, signed int, vector signed short); +BUILD_CST_TEST( test9, vector signed short, 12, vector signed short); + +BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short); +BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short); +BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ From patchwork Thu May 31 19:57:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478864-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="lOu7YgLO"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdYg2jVFz9s0y for ; Fri, 1 Jun 2018 05:58:15 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=YvcENZPQbZdaeq4+/XeE721Z79ZMAiOG7734ThVeDBUm69lHf1 ed2o1HZYgwzOKYiQ6R8Byy1zlptYlLoBYpyXGW0WbE0uJTuFnrEd5lq9d7B+iXTy MFdS6lUdxSRH0hAk+AY6FOUYgWZbA6fk1uuLkCJiSdafS0AD3WILvbASo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=6uhGe3BxGGbUMH7Xo8fbxJji8Yk=; b=lOu7YgLOGnLpoyqtPen5 5te3yqomqcme6d16y1DNuPIUzNIL6kp0RRNGzGcBB43qV//f8WP+2OKx3hoSaDNU 5hfQQOQx9BrTTAtmQqTAgTUklyosjR06/IfvY845RtzdV+tr6NwA+w54lbAaabEZ cvT8G/uh0gwSEQENRgHwook= Received: (qmail 65686 invoked by alias); 31 May 2018 19:57:59 -0000 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 Received: (qmail 65570 invoked by uid 89); 31 May 2018 19:57:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:57:54 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnFB1082777 for ; Thu, 31 May 2018 15:57:53 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jam1t95gc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:57:53 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 13:57:52 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 13:57:50 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJvncQ4063672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 12:57:49 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17FF413604F; Thu, 31 May 2018 13:57:49 -0600 (MDT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B3F54136053; Thu, 31 May 2018 13:57:48 -0600 (MDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 31 May 2018 13:57:48 -0600 (MDT) Subject: [PATCH, rs6000 3/9] Testcase coverage for vec_vsx_ld() instrinsics From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:57:48 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-0016-0000-0000-000008DA0453 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040444; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:57:51 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-0017-0000-0000-00003F079C76 Message-Id: <1527796668.15912.27.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=856 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Add testcase coverage for variations of the vec_vsx_ld() intrinsic. Regtest clean across assorted Linux systems (p6-p9). OK for trunk? Thanks, -Will [testsuite] 2018-05-31 Will Schmidt * gcc.target/powerpc/fold-vec-load-vec_vsx_ld-char.c : New. * gcc.target/powerpc/fold-vec-load-vec_vsx_ld-double.c : New. * gcc.target/powerpc/fold-vec-load-vec_vsx_ld-float.c : New. * gcc.target/powerpc/fold-vec-load-vec_vsx_ld-int.c : New. * gcc.target/powerpc/fold-vec-load-vec_vsx_ld-longlong.c : New. * gcc.target/powerpc/fold-vec-load-vec_vsx_ld-short.c : New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-char.c new file mode 100644 index 0000000..19b0968 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-char.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for vec_vsx_ld* with char + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed char, signed long long, signed char); +BUILD_VAR_TEST( test2, vector signed char, signed int, signed char); +BUILD_CST_TEST( test3, vector signed char, 12, signed char); +BUILD_VAR_TEST( test4, vector unsigned char, signed long long, unsigned char); +BUILD_VAR_TEST( test5, vector unsigned char, signed int, unsigned char); +BUILD_CST_TEST( test6, vector unsigned char, 12, unsigned char); + +BUILD_VAR_TEST( test7, vector signed char, signed long long, vector signed char); +BUILD_VAR_TEST( test8, vector signed char, signed int, vector signed char); +BUILD_CST_TEST( test9, vector signed char, 12, vector signed char); +BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned char); +BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char); +BUILD_CST_TEST( test12, vector unsigned char, 12, vector unsigned char); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-double.c new file mode 100644 index 0000000..f01d0bd --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-double.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_vsx_ld* with double + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector double, long long, double); +BUILD_VAR_TEST( test2, vector double, int, double); +BUILD_CST_TEST( test3, vector double, 12, double); + +BUILD_VAR_TEST( test4, vector double, int, vector double); +BUILD_VAR_TEST( test5, vector double, long long, vector double); +BUILD_CST_TEST( test6, vector double, 12, vector double); + +/* { dg-final { scan-assembler-times "lxvd2x|lxvx|lvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-float.c new file mode 100644 index 0000000..8236d8b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-float.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_vsx_ld with float + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector float, signed long long, float); +BUILD_VAR_TEST( test3, vector float, signed int, float); +BUILD_CST_TEST( test4, vector float, 12, float); + +BUILD_VAR_TEST( test5, vector float, signed long long, vector float); +BUILD_VAR_TEST( test7, vector float, signed int, vector float); +BUILD_CST_TEST( test8, vector float, 12, vector float); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-int.c new file mode 100644 index 0000000..70033e5 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-int.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_vsx_ld with int + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed int, signed long long, signed int); +BUILD_VAR_TEST( test2, vector signed int, signed int, signed int); +BUILD_CST_TEST( test3, vector signed int, 12, signed int); +BUILD_VAR_TEST( test4, vector unsigned int, signed long long, unsigned int); +BUILD_VAR_TEST( test5, vector unsigned int, signed int, unsigned int); +BUILD_CST_TEST( test6, vector unsigned int, 12, unsigned int); + +BUILD_VAR_TEST( test7, vector signed int, signed long long, vector signed int); +BUILD_VAR_TEST( test8, vector signed int, signed int, vector signed int); +BUILD_CST_TEST( test9, vector signed int, 12, vector signed int); +BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int); +BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int); +BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-longlong.c new file mode 100644 index 0000000..7df8340 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-longlong.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_vsx_ld with long long + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed long long, signed long long, signed long long); +BUILD_VAR_TEST( test2, vector signed long long, signed int, signed long long); +BUILD_CST_TEST( test3, vector signed long long, 12, signed long long); +BUILD_VAR_TEST( test4, vector unsigned long long, signed long long, unsigned long long); +BUILD_VAR_TEST( test5, vector unsigned long long, signed int, unsigned long long); +BUILD_CST_TEST( test6, vector unsigned long long, 12, unsigned long long); + +BUILD_VAR_TEST( test7, vector signed long long, signed long long, vector signed long long); +BUILD_VAR_TEST( test8, vector signed long long, signed int, vector signed long long); +BUILD_CST_TEST( test9, vector signed long long, 12, vector signed long long); +BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long); +BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long); +BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long); + +/* { dg-final { scan-assembler-times "lxvd2x|lxvx|lvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-short.c new file mode 100644 index 0000000..031d03a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-load-vec_vsx_ld-short.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_vsx_ld with short + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, RETTYPE, VAR_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _var (VAR_OFFSET offset, LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (offset, loadfrom); \ +} + +#define BUILD_CST_TEST(TESTNAME1, RETTYPE, CST_OFFSET, LOADFROM) \ +RETTYPE \ +TESTNAME1 ## _cst (LOADFROM * loadfrom) \ +{ \ + return vec_vsx_ld (CST_OFFSET, loadfrom); \ +} + +BUILD_VAR_TEST( test1, vector signed short, signed long long, signed short); +BUILD_VAR_TEST( test2, vector signed short, signed int, signed short); +BUILD_CST_TEST( test3, vector signed short, 12, signed short); +BUILD_VAR_TEST( test4, vector unsigned short, signed long long, unsigned short); +BUILD_VAR_TEST( test5, vector unsigned short, signed int, unsigned short); +BUILD_CST_TEST( test6, vector unsigned short, 12, unsigned short); + +BUILD_VAR_TEST( test7, vector signed short, signed long long, vector signed short); +BUILD_VAR_TEST( test8, vector signed short, signed int, vector signed short); +BUILD_CST_TEST( test9, vector signed short, 12, vector signed short); +BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short); +BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short); +BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short); + +/* { dg-final { scan-assembler-times "lxvw4x|lxvd2x|lxvx|lvx" 12 } } */ From patchwork Thu May 31 19:57:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923579 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478868-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="VSsCN+GX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdbL3Fz7z9s1B for ; Fri, 1 Jun 2018 05:59:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=Oak/5PjTDhkOpTiRaGeJVuCb7k/f2hvOtAQC0OW1kgmj5+4JqT RPKY+EoPAFFViXsk6ZgWqY9r5MnY04tu0ScjzLGJHK60aihgBKhZ/NPoap4DDu2Z 4LwxxbPAwRKoIGBfXwrEcSRQl44nUbvXXVLNwIG3/cm2KUCvOZhjlndTk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=YNFm8EhEEp3/iH2gdOwroioIaKU=; b=VSsCN+GXZ2Thhc1p2QBI smxSGuRE/7iNpJ84Cvz5minc0bN6/JxLpV9hbJ1zlXkR5V7LbKP8R+qeZy02pd8I dB1MZq82fs1JQUt5kc1AQD5/kYct3r9GLpiakuQ2Wq1VplSBYS6hXcBCjgExNTHQ g6U8FPd7+K9KGKHrTtCtx9I= Received: (qmail 72757 invoked by alias); 31 May 2018 19:59:24 -0000 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 Received: (qmail 72601 invoked by uid 89); 31 May 2018 19:59:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:59:20 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnHbt037791 for ; Thu, 31 May 2018 15:59:18 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0b-001b2d01.pphosted.com with ESMTP id 2janm850cj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:59:18 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 13:59:17 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 13:59:14 -0600 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJvweN14483922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 12:57:58 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 89CC66A04F; Thu, 31 May 2018 13:57:58 -0600 (MDT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D5466A047; Thu, 31 May 2018 13:57:58 -0600 (MDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 31 May 2018 13:57:58 -0600 (MDT) Subject: [PATCH, rs6000 4/9] Testcase coverage for vec_xst() instrinsics From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:57:57 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-0004-0000-0000-00001435B96B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040445; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:59:15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-0005-0000-0000-0000877DB774 Message-Id: <1527796677.15912.28.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Testcase coverage for variations of the vec_xst() intrinsic. Regtest clean across assorted Linux systems (p6-p9). OK for trunk? Thanks, -Will [testsuite] 2018-05-31 Will Schmidt * gcc.target/powerpc/fold-vec-store-vec_xst-char.c : New. * gcc.target/powerpc/fold-vec-store-vec_xst-double.c : New. * gcc.target/powerpc/fold-vec-store-vec_xst-float.c : New. * gcc.target/powerpc/fold-vec-store-vec_xst-int.c : New. * gcc.target/powerpc/fold-vec-store-vec_xst-longlong.c : New. * gcc.target/powerpc/fold-vec-store-vec_xst-short.c : New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-char.c new file mode 100644 index 0000000..76dacf5 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-char.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xst with char + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed char, signed long long, signed char ); +BUILD_VAR_TEST( test2, vector signed char, signed int, signed char ); +BUILD_CST_TEST( test3, vector signed char, 12, signed char ); +BUILD_VAR_TEST( test4, vector unsigned char, signed long long, unsigned char ); +BUILD_VAR_TEST( test5, vector unsigned char, signed int, unsigned char ); +BUILD_CST_TEST( test6, vector unsigned char, 12, unsigned char ); + +BUILD_VAR_TEST( test7, vector signed char, signed long long, vector signed char ); +BUILD_VAR_TEST( test8, vector signed char, signed int, vector signed char ); +BUILD_CST_TEST( test9, vector signed char, 12, vector signed char ); +BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned char ); +BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char ); +BUILD_CST_TEST( test12, vector unsigned char, 12, vector unsigned char ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-double.c new file mode 100644 index 0000000..a9cf409 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-double.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_xst with double + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector double, signed long long, double ); +BUILD_VAR_TEST( test2, vector double, signed int, double ); +BUILD_CST_TEST( test3, vector double, 12, double ); + +BUILD_VAR_TEST( test7, vector double, signed long long, vector double ); +BUILD_VAR_TEST( test8, vector double, signed int, vector double ); +BUILD_CST_TEST( test9, vector double, 12, vector double ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-float.c new file mode 100644 index 0000000..a5c805b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-float.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_xst with float + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector float, signed long long, float ); +BUILD_VAR_TEST( test2, vector float, signed int, float ); +BUILD_CST_TEST( test3, vector float, 12, float ); + +BUILD_VAR_TEST( test7, vector float, signed long long, vector float ); +BUILD_VAR_TEST( test8, vector float, signed int, vector float ); +BUILD_CST_TEST( test9, vector float, 12, vector float ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-int.c new file mode 100644 index 0000000..99230b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-int.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xst with int + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed int, signed long long, signed int ); +BUILD_VAR_TEST( test2, vector signed int, signed int, signed int ); +BUILD_CST_TEST( test3, vector signed int, 12, signed int ); +BUILD_VAR_TEST( test4, vector unsigned int, signed long long, unsigned int ); +BUILD_VAR_TEST( test5, vector unsigned int, signed int, unsigned int ); +BUILD_CST_TEST( test6, vector unsigned int, 12, unsigned int ); + +BUILD_VAR_TEST( test7, vector signed int, signed long long, vector signed int ); +BUILD_VAR_TEST( test8, vector signed int, signed int, vector signed int ); +BUILD_CST_TEST( test9, vector signed int, 12, vector signed int ); +BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int ); +BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int ); +BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-longlong.c new file mode 100644 index 0000000..80c5ec1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-longlong.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xst with long long + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed long long, signed long long, signed long long ); +BUILD_VAR_TEST( test2, vector signed long long, signed int, signed long long ); +BUILD_CST_TEST( test3, vector signed long long, 12, signed long long ); +BUILD_VAR_TEST( test4, vector unsigned long long, signed long long, unsigned long long ); +BUILD_VAR_TEST( test5, vector unsigned long long, signed int, unsigned long long ); +BUILD_CST_TEST( test6, vector unsigned long long, 12, unsigned long long ); + +BUILD_VAR_TEST( test7, vector signed long long, signed long long, vector signed long long ); +BUILD_VAR_TEST( test8, vector signed long long, signed int, vector signed long long ); +BUILD_CST_TEST( test9, vector signed long long, 12, vector signed long long ); +BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long ); +BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long ); +BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-short.c new file mode 100644 index 0000000..b4631c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_xst-short.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_xst with short + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed short, signed long long, signed short ); +BUILD_VAR_TEST( test2, vector signed short, signed int, signed short ); +BUILD_CST_TEST( test3, vector signed short, 12, signed short ); +BUILD_VAR_TEST( test4, vector unsigned short, signed long long, unsigned short ); +BUILD_VAR_TEST( test5, vector unsigned short, signed int, unsigned short ); +BUILD_CST_TEST( test6, vector unsigned short, 12, unsigned short ); + +BUILD_VAR_TEST( test7, vector signed short, signed long long, vector signed short ); +BUILD_VAR_TEST( test8, vector signed short, signed int, vector signed short ); +BUILD_CST_TEST( test9, vector signed short, 12, vector signed short ); +BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short ); +BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short ); +BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ From patchwork Thu May 31 19:58:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478865-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="e64X3L92"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdZ25dBgz9s0y for ; Fri, 1 Jun 2018 05:58:34 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=Lt+SnlvFBdSllmihVQxemM+IqFaG2ezqc9I4CU7Zvf56+rUaNk kP8dSXEF2XzscWcXV/d3973LQpqODNlk+i0ZMwx6PJJfO0xITsTVS9045K2fZZ3/ hltFdQbWu9UqT5wpLxjVP3wYC5+J7IwExvYccIZ5GFLEgLV8nZcnu5R3M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=SPSgLGfv5Gah2TnS/8fUrqeVcqY=; b=e64X3L92BHxN6l6P+Zqp EL3o7J8suyfMFHKWgJ77jKTBxQ25jopo7DI75MtNMgyblscWJRW7Bke2MxBGP4Yf NJpS+qzDKMmDg+WCK38X4VYb3DQACZSd3uGrOKiWPwGyTI3c2SKROrMvuBkJzSPw Z2noXHUwtC/Ery+clhdjDU4= Received: (qmail 67772 invoked by alias); 31 May 2018 19:58:22 -0000 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 Received: (qmail 67692 invoked by uid 89); 31 May 2018 19:58:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:58:17 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnfjN005917 for ; Thu, 31 May 2018 15:58:16 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jap70ugf5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:58:16 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 13:58:15 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 13:58:13 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJwCrs1966436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 12:58:12 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F86B7803F; Thu, 31 May 2018 13:58:12 -0600 (MDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 23B3578057; Thu, 31 May 2018 13:58:12 -0600 (MDT) Subject: [PATCH, rs6000 5/9] Testcase coverage for builtin_vec_xst() instrinsics From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:58:11 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-8235-0000-0000-00000D9FCDDD X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040445; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:58:14 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-8236-0000-0000-000041451E61 Message-Id: <1527796691.15912.29.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Add testcase coverage for variations of the builtin_vec_xst() intrinsic. Regtest clean across assorted Linux systems (p6-p9). OK for trunk? Thanks, -Will [testsuite] 2018-05-31 Will Schmidt * gcc.target/powerpc/fold-vec-store-builtin_vec_xst-char.c: New. * gcc.target/powerpc/fold-vec-store-builtin_vec_xst-double.c: New. * gcc.target/powerpc/fold-vec-store-builtin_vec_xst-float.c: New. * gcc.target/powerpc/fold-vec-store-builtin_vec_xst-int.c: New. * gcc.target/powerpc/fold-vec-store-builtin_vec_xst-longlong.c: New. * gcc.target/powerpc/fold-vec-store-builtin_vec_xst-short.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-char.c new file mode 100644 index 0000000..6bfbb0b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-char.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for ____builtin_vec_xst with char + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed char, signed long long, signed char ); +BUILD_VAR_TEST( test2, vector signed char, signed int, signed char ); +BUILD_CST_TEST( test3, vector signed char, 12, signed char ); +BUILD_VAR_TEST( test4, vector unsigned char, signed long long, unsigned char ); +BUILD_VAR_TEST( test5, vector unsigned char, signed int, unsigned char ); +BUILD_CST_TEST( test6, vector unsigned char, 12, unsigned char ); + +BUILD_VAR_TEST( test7, vector signed char, signed long long, vector signed char ); +BUILD_VAR_TEST( test8, vector signed char, signed int, vector signed char ); +BUILD_CST_TEST( test9, vector signed char, 12, vector signed char ); +BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned char ); +BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char ); +BUILD_CST_TEST( test12, vector unsigned char, 12, vector unsigned char ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-double.c new file mode 100644 index 0000000..a64558c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-double.c @@ -0,0 +1,32 @@ +/* Verify that overloaded built-ins for __builtin_vec_xst with double + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, CST_OFFSET, saveto); \ +} + +#include + +BUILD_VAR_TEST( test1, vector double, signed long long, vector double ); +BUILD_VAR_TEST( test2, vector double, signed int, vector double ); +BUILD_CST_TEST( test3, vector double, 12, vector double ); + +BUILD_VAR_TEST( testvld, vector double, signed long long, double ); +BUILD_VAR_TEST( testvid, vector double, signed int, double ); +BUILD_CST_TEST( testcd, vector double, 12, double ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-float.c new file mode 100644 index 0000000..82a1e20 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-float.c @@ -0,0 +1,32 @@ +/* Verify that overloaded built-ins for __builtin_vec_xst with float + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector float, signed long long, float ); +BUILD_VAR_TEST( test2, vector float, signed int, float ); +BUILD_CST_TEST( test3, vector float, 12, float ); + +BUILD_VAR_TEST( test4, vector float, signed long long, vector float ); +BUILD_VAR_TEST( test5, vector float, signed int, vector float ); +BUILD_CST_TEST( test6, vector float, 12, vector float ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-int.c new file mode 100644 index 0000000..4c3ea4f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-int.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for __builtin_vec_xst with int + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed int, signed long long, signed int ); +BUILD_VAR_TEST( test2, vector signed int, signed int, signed int ); +BUILD_CST_TEST( test3, vector signed int, 12, signed int ); +BUILD_VAR_TEST( test4, vector unsigned int, signed long long, unsigned int ); +BUILD_VAR_TEST( test5, vector unsigned int, signed int, unsigned int ); +BUILD_CST_TEST( test6, vector unsigned int, 12, unsigned int ); + +BUILD_VAR_TEST( test7, vector signed int, signed long long, vector signed int ); +BUILD_VAR_TEST( test8, vector signed int, signed int, vector signed int ); +BUILD_CST_TEST( test9, vector signed int, 12, vector signed int ); +BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int ); +BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int ); +BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-longlong.c new file mode 100644 index 0000000..9bd45f3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-longlong.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for __builtin_vec_xst with long long + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mvsx -O2 -mcpu=power8" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed long long, signed long long, signed long long ); +BUILD_VAR_TEST( test2, vector signed long long, signed int, signed long long ); +BUILD_CST_TEST( test3, vector signed long long, 12, signed long long ); +BUILD_VAR_TEST( test4, vector unsigned long long, signed long long, unsigned long long ); +BUILD_VAR_TEST( test5, vector unsigned long long, signed int, unsigned long long ); +BUILD_CST_TEST( test6, vector unsigned long long, 12, unsigned long long ); + +BUILD_VAR_TEST( test7, vector signed long long, signed long long, vector signed long long ); +BUILD_VAR_TEST( test8, vector signed long long, signed int, vector signed long long ); +BUILD_CST_TEST( test9, vector signed long long, 12, vector signed long long ); +BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long ); +BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long ); +BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-short.c new file mode 100644 index 0000000..2c6d0c1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-builtin_vec_xst-short.c @@ -0,0 +1,38 @@ +/* Verify that overloaded built-ins for __builtin_vec_xst with short + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include + +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + __builtin_vec_xst (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed short, signed long long, signed short ); +BUILD_VAR_TEST( test2, vector signed short, signed int, signed short ); +BUILD_CST_TEST( test3, vector signed short, 12, signed short ); +BUILD_VAR_TEST( test4, vector unsigned short, signed long long, unsigned short ); +BUILD_VAR_TEST( test5, vector unsigned short, signed int, unsigned short ); +BUILD_CST_TEST( test6, vector unsigned short, 12, unsigned short ); + +BUILD_VAR_TEST( test7, vector signed short, signed long long, vector signed short ); +BUILD_VAR_TEST( test8, vector signed short, signed int, vector signed short ); +BUILD_CST_TEST( test9, vector signed short, 12, vector signed short ); +BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short ); +BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short ); +BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ From patchwork Thu May 31 19:58:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478866-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QnGef4gA"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdZR0G3Lz9s0y for ; Fri, 1 Jun 2018 05:58:54 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=NEwj/kmdhr5jRCdu+L8foMvkfnPtVcAzAQiGr3+r7pbbKst413 xurfBCMgYNrgHoXldwaQXajWqqpokSlKQsNmYnDLX8vajiTZmeRd86dPNsWiB6zd WMGZLH4auoi4Pr5AaHl4BdBsfP5czPq1dn2ckUwJKs3e1MaCFtySn6tPI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=q/soeZgcvxqjQTpV3rqc2f19YCA=; b=QnGef4gAVo6gDGR4okAZ b8ycCCGADq4gxFNSXLVn6/+Si+s1OPgulLXvHlUgig5YAmzsZTXwbZQH2LT2qQkH Cpd4RqJQ93DySdB91ZNPVZ2bne34xWeNbOjP55p+0KVTNyQqhvPbdNW1okmr/SGq nFOY4eJIsn2N0xIxDF/5Bas= Received: (qmail 69249 invoked by alias); 31 May 2018 19:58:40 -0000 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 Received: (qmail 69029 invoked by uid 89); 31 May 2018 19:58:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:58:35 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnG7v082846 for ; Thu, 31 May 2018 15:58:33 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jam1t961w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:58:33 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 13:58:32 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 13:58:31 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJwUq611796802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 12:58:30 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 139DDBE03B; Thu, 31 May 2018 13:58:30 -0600 (MDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 9DD24BE042; Thu, 31 May 2018 13:58:29 -0600 (MDT) Subject: [PATCH, rs6000 6/9] Testcase coverage for vec_vsx_st() intrinsics From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:58:29 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-0012-0000-0000-0000165CF005 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040445; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:58:32 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-0013-0000-0000-00005310E4EC Message-Id: <1527796709.15912.30.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, New testcases to cover variations of the vec_vsx_st() intrinsic. Regtest clean across assorted Linux systems (p6-p9). OK for trunk? Thanks, -Will [testsuite] 2018-05-31 Will Schmidt * gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c: New. * gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c: New. * gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c: New. * gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c: New. * gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c: New. * gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c new file mode 100644 index 0000000..e512c43 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-char.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_vsx_st with char + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed char, signed long long, signed char ); +BUILD_VAR_TEST( test2, vector signed char, signed int, signed char ); +BUILD_CST_TEST( test3, vector signed char, 12, signed char ); +BUILD_VAR_TEST( test4, vector unsigned char, signed long long, unsigned char ); +BUILD_VAR_TEST( test5, vector unsigned char, signed int, unsigned char ); +BUILD_CST_TEST( test6, vector unsigned char, 12, unsigned char ); + +BUILD_VAR_TEST( test7, vector signed char, signed long long, vector signed char ); +BUILD_VAR_TEST( test8, vector signed char, signed int, vector signed char ); +BUILD_CST_TEST( test9, vector signed char, 12, vector signed char ); +BUILD_VAR_TEST( test10, vector unsigned char, signed long long, vector unsigned char ); +BUILD_VAR_TEST( test11, vector unsigned char, signed int, vector unsigned char ); +BUILD_CST_TEST( test12, vector unsigned char, 12, vector unsigned char ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c new file mode 100644 index 0000000..7755860 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-double.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_vsx_st with double + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector double, signed long long, double ); +BUILD_VAR_TEST( test2, vector double, signed int, double ); +BUILD_CST_TEST( test3, vector double, 12, double ); + +BUILD_VAR_TEST( test7, vector double, signed long long, vector double ); +BUILD_VAR_TEST( test8, vector double, signed int, vector double ); +BUILD_CST_TEST( test9, vector double, 12, vector double ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c new file mode 100644 index 0000000..f8f2d82 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-float.c @@ -0,0 +1,31 @@ +/* Verify that overloaded built-ins for vec_vsx_st with float + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector float, signed long long, float ); +BUILD_VAR_TEST( test2, vector float, signed int, float ); +BUILD_CST_TEST( test3, vector float, 12, float ); + +BUILD_VAR_TEST( test7, vector float, signed long long, vector float ); +BUILD_VAR_TEST( test8, vector float, signed int, vector float ); +BUILD_CST_TEST( test9, vector float, 12, vector float ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 6 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c new file mode 100644 index 0000000..06324d21 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-int.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_vsx_st with int + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed int, signed long long, signed int ); +BUILD_VAR_TEST( test2, vector signed int, signed int, signed int ); +BUILD_CST_TEST( test3, vector signed int, 12, signed int ); +BUILD_VAR_TEST( test4, vector unsigned int, signed long long, unsigned int ); +BUILD_VAR_TEST( test5, vector unsigned int, signed int, unsigned int ); +BUILD_CST_TEST( test6, vector unsigned int, 12, unsigned int ); + +BUILD_VAR_TEST( test7, vector signed int, signed long long, vector signed int ); +BUILD_VAR_TEST( test8, vector signed int, signed int, vector signed int ); +BUILD_CST_TEST( test9, vector signed int, 12, vector signed int ); +BUILD_VAR_TEST( test10, vector unsigned int, signed long long, vector unsigned int ); +BUILD_VAR_TEST( test11, vector unsigned int, signed int, vector unsigned int ); +BUILD_CST_TEST( test12, vector unsigned int, 12, vector unsigned int ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c new file mode 100644 index 0000000..59eea6e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-longlong.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_vsx_st with long long + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed long long, signed long long, signed long long ); +BUILD_VAR_TEST( test2, vector signed long long, signed int, signed long long ); +BUILD_CST_TEST( test3, vector signed long long, 12, signed long long ); +BUILD_VAR_TEST( test4, vector unsigned long long, signed long long, unsigned long long ); +BUILD_VAR_TEST( test5, vector unsigned long long, signed int, unsigned long long ); +BUILD_CST_TEST( test6, vector unsigned long long, 12, unsigned long long ); + +BUILD_VAR_TEST( test7, vector signed long long, signed long long, vector signed long long ); +BUILD_VAR_TEST( test8, vector signed long long, signed int, vector signed long long ); +BUILD_CST_TEST( test9, vector signed long long, 12, vector signed long long ); +BUILD_VAR_TEST( test10, vector unsigned long long, signed long long, vector unsigned long long ); +BUILD_VAR_TEST( test11, vector unsigned long long, signed int, vector unsigned long long ); +BUILD_CST_TEST( test12, vector unsigned long long, 12, vector unsigned long long ); + +/* { dg-final { scan-assembler-times "stxvd2x|stxvx|stvx" 12 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c new file mode 100644 index 0000000..a62dae0 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-store-vec_vsx_st-short.c @@ -0,0 +1,37 @@ +/* Verify that overloaded built-ins for vec_vsx_st with short + inputs produce the right code. */ + +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mvsx -O2" } */ + +#include +#define BUILD_VAR_TEST(TESTNAME1, VALUE, VAR_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _var (VALUE value, VAR_OFFSET offset, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, offset, saveto); \ +} + +#define BUILD_CST_TEST(TESTNAME1, VALUE, CST_OFFSET, SAVETO) \ +void \ +TESTNAME1 ## _cst (VALUE value, SAVETO * saveto) \ +{ \ + vec_vsx_st (value, CST_OFFSET, saveto); \ +} + +BUILD_VAR_TEST( test1, vector signed short, signed long long, signed short ); +BUILD_VAR_TEST( test2, vector signed short, signed int, signed short ); +BUILD_CST_TEST( test3, vector signed short, 12, signed short ); +BUILD_VAR_TEST( test4, vector unsigned short, signed long long, unsigned short ); +BUILD_VAR_TEST( test5, vector unsigned short, signed int, unsigned short ); +BUILD_CST_TEST( test6, vector unsigned short, 12, unsigned short ); + +BUILD_VAR_TEST( test7, vector signed short, signed long long, vector signed short ); +BUILD_VAR_TEST( test8, vector signed short, signed int, vector signed short ); +BUILD_CST_TEST( test9, vector signed short, 12, vector signed short ); +BUILD_VAR_TEST( test10, vector unsigned short, signed long long, vector unsigned short ); +BUILD_VAR_TEST( test11, vector unsigned short, signed int, vector unsigned short ); +BUILD_CST_TEST( test12, vector unsigned short, 12, vector unsigned short ); + +/* { dg-final { scan-assembler-times "stxvw4x|stxvd2x|stxvx|stvx" 12 } } */ From patchwork Thu May 31 19:58:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923578 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478867-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rYqz3WiT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdb03WFvz9s0y for ; Fri, 1 Jun 2018 05:59:24 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=b5kWr7G4PTOeyKu6F77/sGQXVeI8lSilRG+3Fig6AERCORe5Z6 Xz2cdHGHlslxGWdjEM+uAGne9xbxFKU0tZ3X4ZtJo8NoNTsN9mRDOVdv3HXvGX+l 0TOKQPVPG8lRMPk13WWmeXTadEdME34y3GQ2UGhX/jWTMYOiYOGXmCh64= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=PgUoGNQZunXa6TKUaDpa0LTcrAo=; b=rYqz3WiTy0ESLxav0c2F ICISV5bT/3rypUJqpU3AAJUUXY0lZRVdOO9G7aFYnPz1L1FpeQmAfIKqV9Wxz+Zm V/G1pM0wpJqBgTJTa7uUFzc0bUJn1InJYuFDuGxBtPzXujhDBUgLtx5JEO6gcuwu ElQeQw3PoRxBcmubABZ96bM= Received: (qmail 70116 invoked by alias); 31 May 2018 19:58:50 -0000 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 Received: (qmail 70017 invoked by uid 89); 31 May 2018 19:58:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=foot, compensate X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:58:47 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnOKd074029 for ; Thu, 31 May 2018 15:58:45 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2jap7c3he3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:58:45 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 13:58:44 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 13:58:42 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJwfGR12255574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 12:58:41 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 954AEC6053; Thu, 31 May 2018 13:58:41 -0600 (MDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP id 53350C6042; Thu, 31 May 2018 13:58:41 -0600 (MDT) Subject: [PATCH, rs6000 7/9] testcase updates for unaligned loads/stores From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:58:40 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-0012-0000-0000-0000165CF014 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040445; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:58:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-0013-0000-0000-00005310E509 Message-Id: <1527796720.15912.31.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Assorted updates to existing tests to compensate for codegen changes introduced with the gimple-folding of unaligned vector loads and stores. Regtest clean across assorted Linux systems (p6-p9). OK for trunk? Thanks, -Will [testsuite] 2018-05-31 Will Schmidt * gcc.target/powerpc/p8-vec-xl-xst-v2.c: New. * gcc.target/powerpc/p8-vec-xl-xst.c: Disable gimple-folding. * gcc.target/powerpc/swaps-p8-17.c: Same. diff --git a/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst-v2.c b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst-v2.c new file mode 100644 index 0000000..3315c5f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst-v2.c @@ -0,0 +1,64 @@ +/* { dg-do compile { target { powerpc64le-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2" } */ + +/* Verify fix for problem where vec_xl and vec_xst are not recognized + for the vector char and vector short cases on P8 only. + This test duplicates p8-vec-xl-xst.c , except that it allows gimple-folding, + which changes the expected codegen. */ + +#include + +vector unsigned char +foo (unsigned char * address) +{ + return __builtin_vec_xl (0, address); +} + +void +bar (vector unsigned char x, unsigned char * address) +{ + __builtin_vec_xst (x, 0, address); +} + +vector unsigned short +foot (unsigned short * address) +{ + return __builtin_vec_xl (0, address); +} + +void +bart (vector unsigned short x, unsigned short * address) +{ + __builtin_vec_xst (x, 0, address); +} + +vector unsigned char +fool (unsigned char * address) +{ + return vec_xl (0, address); +} + +void +barl (vector unsigned char x, unsigned char * address) +{ + vec_xst (x, 0, address); +} + +vector unsigned short +footle (unsigned short * address) +{ + return vec_xl (0, address); +} + +void +bartle (vector unsigned short x, unsigned short * address) +{ + vec_xst (x, 0, address); +} + +/* { dg-final { scan-assembler-times "lvx" 4 } } */ +/* { dg-final { scan-assembler-times "stvx" 4 } } */ +/* { dg-final { scan-assembler-times "xxpermdi" 0 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c index bbf7d91..06f3457 100644 --- a/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c +++ b/gcc/testsuite/gcc.target/powerpc/p8-vec-xl-xst.c @@ -1,10 +1,11 @@ /* { dg-do compile { target { powerpc64le-*-* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } } */ /* { dg-require-effective-target powerpc_p8vector_ok } */ /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O2" } */ +/* { dg-options "-mcpu=power8 -O2 -mno-fold-gimple" } */ +/* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } */ /* Verify fix for problem where vec_xl and vec_xst are not recognized for the vector char and vector short cases on P8 only. */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c b/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c index 7a9cfbf..889bbf7 100644 --- a/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c +++ b/gcc/testsuite/gcc.target/powerpc/swaps-p8-17.c @@ -1,8 +1,9 @@ /* { dg-do compile { target { powerpc64le-*-* } } } */ /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ -/* { dg-options "-mcpu=power8 -O1" } */ +/* { dg-options "-mcpu=power8 -O1 -mno-fold-gimple" } */ +/* { dg-prune-output "gimple folding of rs6000 builtins has been disabled." } */ /* { dg-final { scan-assembler "lxvd2x" } } */ /* { dg-final { scan-assembler "xxpermdi" } } */ /* Verify that we don't try to do permute removal in the presence of vec_ste. This used to ICE. */ From patchwork Thu May 31 19:59:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478869-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="nLqye0uL"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdbf6sRtz9s16 for ; Fri, 1 Jun 2018 05:59:58 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=QucjvPlwUb8QUiZkVXQnTln+NRuJBhMufVIElEYYDsp5gdSyT2 eCfjoIAF8EjZBsGNzQGDGARAMfk81E4ohqQHqhGuA7lKEwgogpZLphWeaa/9iViL eqroXDKRb2Evs/nU+p96qMO62UkBsbt1DX6ir5QYGWSRZnIeCt2hrfy6Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=Byeq46tvo9Wi09pIrSUPFqoDSOY=; b=nLqye0uLG2uc24ONvyKk YRzLYNQWmLwXlUZEy3/IZ1Qr64HNKXVwy9WPddpZS/xKsDzCbu9TPKA7565RG1n8 dZIyxx20inBKwuHujus+aBac6J+6qRtAO9+NHIsQaHhCBAbbAWSl+i9J5kPxhzkR RLcKsK2ToQ6uZlOBSmWTbB8= Received: (qmail 75771 invoked by alias); 31 May 2018 19:59:51 -0000 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 Received: (qmail 74964 invoked by uid 89); 31 May 2018 19:59:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:59:46 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnGfm037585 for ; Thu, 31 May 2018 15:59:44 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2janm850rj-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:59:44 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 15:59:43 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 15:59:41 -0400 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJxe0p11731326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 19:59:40 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B9FE2805A; Thu, 31 May 2018 15:59:36 -0400 (EDT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4559D28059; Thu, 31 May 2018 15:59:36 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 31 May 2018 15:59:36 -0400 (EDT) Subject: [PATCH, rs6000 8/9] enable gimple folding for vec_xl, vec_xst From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool , Richard Biener Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:59:40 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-0036-0000-0000-000002FEA3D6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040445; UDB=6.00530848; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:59:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-0037-0000-0000-00004484A0E9 Message-Id: <1527796780.15912.32.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Add support for gimple folding for unaligned vector loads and stores. testcases posted separately in this thread. Regtest completed across variety of systems, P6,P7,P8,P9. OK for trunk? Thanks, -Will [gcc] 2018-05-31 Will Schmidt * config/rs6000/rs6000.c: (rs6000_builtin_valid_without_lhs) Add vec_xst variants to the list. (rs6000_gimple_fold_builtin) Add support for folding unaligned vector loads and stores. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d62abdf..54b7de2 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -15360,10 +15360,16 @@ rs6000_builtin_valid_without_lhs (enum rs6000_builtins fn_code) case ALTIVEC_BUILTIN_STVX_V8HI: case ALTIVEC_BUILTIN_STVX_V4SI: case ALTIVEC_BUILTIN_STVX_V4SF: case ALTIVEC_BUILTIN_STVX_V2DI: case ALTIVEC_BUILTIN_STVX_V2DF: + case VSX_BUILTIN_STXVW4X_V16QI: + case VSX_BUILTIN_STXVW4X_V8HI: + case VSX_BUILTIN_STXVW4X_V4SF: + case VSX_BUILTIN_STXVW4X_V4SI: + case VSX_BUILTIN_STXVD2X_V2DF: + case VSX_BUILTIN_STXVD2X_V2DI: return true; default: return false; } } @@ -15869,10 +15875,77 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi) gimple_set_location (g, loc); gsi_replace (gsi, g, true); return true; } + /* unaligned Vector loads. */ + case VSX_BUILTIN_LXVW4X_V16QI: + case VSX_BUILTIN_LXVW4X_V8HI: + case VSX_BUILTIN_LXVW4X_V4SF: + case VSX_BUILTIN_LXVW4X_V4SI: + case VSX_BUILTIN_LXVD2X_V2DF: + case VSX_BUILTIN_LXVD2X_V2DI: + { + arg0 = gimple_call_arg (stmt, 0); // offset + arg1 = gimple_call_arg (stmt, 1); // address + lhs = gimple_call_lhs (stmt); + location_t loc = gimple_location (stmt); + /* Since arg1 may be cast to a different type, just use ptr_type_node + here instead of trying to enforce TBAA on pointer types. */ + tree arg1_type = ptr_type_node; + tree lhs_type = TREE_TYPE (lhs); + /* POINTER_PLUS_EXPR wants the offset to be of type 'sizetype'. Create + the tree using the value from arg0. The resulting type will match + the type of arg1. */ + gimple_seq stmts = NULL; + tree temp_offset = gimple_convert (&stmts, loc, sizetype, arg0); + tree temp_addr = gimple_build (&stmts, loc, POINTER_PLUS_EXPR, + arg1_type, arg1, temp_offset); + gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT); + /* Use the build2 helper to set up the mem_ref. The MEM_REF could also + take an offset, but since we've already incorporated the offset + above, here we just pass in a zero. */ + gimple *g; + g = gimple_build_assign (lhs, build2 (MEM_REF, lhs_type, temp_addr, + build_int_cst (arg1_type, 0))); + gimple_set_location (g, loc); + gsi_replace (gsi, g, true); + return true; + } + + /* unaligned Vector stores. */ + case VSX_BUILTIN_STXVW4X_V16QI: + case VSX_BUILTIN_STXVW4X_V8HI: + case VSX_BUILTIN_STXVW4X_V4SF: + case VSX_BUILTIN_STXVW4X_V4SI: + case VSX_BUILTIN_STXVD2X_V2DF: + case VSX_BUILTIN_STXVD2X_V2DI: + { + arg0 = gimple_call_arg (stmt, 0); /* Value to be stored. */ + arg1 = gimple_call_arg (stmt, 1); /* Offset. */ + tree arg2 = gimple_call_arg (stmt, 2); /* Store-to address. */ + location_t loc = gimple_location (stmt); + tree arg0_type = TREE_TYPE (arg0); + /* Use ptr_type_node (no TBAA) for the arg2_type. */ + tree arg2_type = ptr_type_node; + /* POINTER_PLUS_EXPR wants the offset to be of type 'sizetype'. Create + the tree using the value from arg0. The resulting type will match + the type of arg2. */ + gimple_seq stmts = NULL; + tree temp_offset = gimple_convert (&stmts, loc, sizetype, arg1); + tree temp_addr = gimple_build (&stmts, loc, POINTER_PLUS_EXPR, + arg2_type, arg2, temp_offset); + /* Mask off any lower bits from the address. */ + gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT); + gimple *g; + g = gimple_build_assign (build2 (MEM_REF, arg0_type, temp_addr, + build_int_cst (arg2_type, 0)), arg0); + gimple_set_location (g, loc); + gsi_replace (gsi, g, true); + return true; + } + /* Vector Fused multiply-add (fma). */ case ALTIVEC_BUILTIN_VMADDFP: case VSX_BUILTIN_XVMADDDP: case ALTIVEC_BUILTIN_VMLADDUHM: { From patchwork Thu May 31 19:59:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 923581 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-478870-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="V9VvC6fw"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40xdbt67s5z9s0y for ; Fri, 1 Jun 2018 06:00:10 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; q=dns; s=default; b=sJkIMvhKIzHP0el6qCJnYLUkkr/B7P6ZUlVf19EsEsWwTS8DNJ G0EGE0GmtvSA4M980lJ6AxGJb0PxJp9oH21yjPTJ1zngyCMU5Qfc62WFGozN0fby EeJfNnfdKQrHp5jxQBFYXAWwd2aOze5dzm6VubLNbhBZqReJf97Miy9w0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:mime-version:content-transfer-encoding:message-id; s= default; bh=BFfeAyiNn0UeTBLr57jWbDV0xBU=; b=V9VvC6fwJPdZ+VeFV1Dp yTY2CKcNT6EMSQxRlcRIW/g1TcUTTQC+6Um+TppQKkCOlSM5rJFqNyLNwC3SA4Yc MLUsqhHhOeLwQ3AX6dnQWbWkjcUKWj+w9mlWkGWVIrI0dPpOZo3VSt9im5juGpy5 oOLyLJUF+BIn+7OrE1GNGoQ= Received: (qmail 77263 invoked by alias); 31 May 2018 20:00:02 -0000 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 Received: (qmail 77066 invoked by uid 89); 31 May 2018 20:00:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2237 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 19:59:59 +0000 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VJnFU7139128 for ; Thu, 31 May 2018 15:59:58 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2jaqc18r11-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 15:59:57 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 15:59:57 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 15:59:54 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4VJxrEN17891684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 19:59:53 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25B74124053; Thu, 31 May 2018 17:01:27 -0400 (EDT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D9DF9124052; Thu, 31 May 2018 17:01:26 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 31 May 2018 17:01:26 -0400 (EDT) Subject: [PATCH, rs6000 9/9] Enable some additional combinations for builtin_vec_xst From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool Cc: Bill Schmidt , David Edelsohn , GCC Patches In-Reply-To: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> References: <1527794851.6620.20.camel@brimstone.rchland.ibm.com> Date: Thu, 31 May 2018 14:59:52 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18053119-0048-0000-0000-000002738D32 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009104; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000264; SDB=6.01040445; UDB=6.00532598; IPR=6.00819574; MB=3.00021398; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-31 19:59:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053119-0049-0000-0000-000045498D5B Message-Id: <1527796792.15912.33.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-31_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310220 X-IsSubscribed: yes Hi, Enable some variations of the _builtin_vec_xst() instrinsic. For most data types (char,short,int,...) the _builtin_vec_xst() intrinsic accepts either a pointer to , or a pointer to a vector of elements of . We currently do not accept pointer-to-type for the long long or double data types. This adds the combinations to accept *double and both signed and unsigned *long long for the instrinsic. Testcases coverage is provided by the fold-vec-load-* and fold-vec-store-* series of tests, posted separately. Regtest is clean across P6-P9 Linux platforms. OK for trunk? Thanks, -Will [gcc] 2018-05-31 Will Schmidt * config/rs6000/rs6000-c.c: Add BUILTIN_VEC_XST entries for *double and *long long. diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 98a812e..61ff4e2 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -4079,13 +4079,19 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = { RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI }, { ALTIVEC_BUILTIN_VEC_STVRXL, ALTIVEC_BUILTIN_STVRXL, RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, { VSX_BUILTIN_VEC_XST, VSX_BUILTIN_STXVD2X_V2DF, RS6000_BTI_void, RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF }, + { VSX_BUILTIN_VEC_XST, VSX_BUILTIN_STXVD2X_V2DF, + RS6000_BTI_void, RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_double }, { VSX_BUILTIN_VEC_XST, VSX_BUILTIN_STXVD2X_V2DI, RS6000_BTI_void, RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI }, { VSX_BUILTIN_VEC_XST, VSX_BUILTIN_STXVD2X_V2DI, + RS6000_BTI_void, RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_long_long }, + { VSX_BUILTIN_VEC_XST, VSX_BUILTIN_STXVD2X_V2DI, RS6000_BTI_void, + RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long_long }, + { VSX_BUILTIN_VEC_XST, VSX_BUILTIN_STXVD2X_V2DI, RS6000_BTI_void, RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V2DI }, { VSX_BUILTIN_VEC_XST, VSX_BUILTIN_STXVD2X_V2DI, RS6000_BTI_void, RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V2DI },