From patchwork Tue Aug 8 21:24:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 799444 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-460071-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="VzS42KUF"; 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 3xRnVc4LDpz9s1h for ; Wed, 9 Aug 2017 07:25:12 +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:content-type:date:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=FEyKW clJEMYE2AJObUUg16UyoH2Mll4d+lKSG7AjcFDWeN+lvtv63ELMF/OuQhcTPDABU b88sPfl4bRT0h52Iwle/4C/vAcWpywv+VL+PboAXlMKiyICEXNS/T+S1oDcChONH 8W29MKCEua111hR+0vJAuDKVABn/Zi/dhNBgg4= 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:content-type:date:mime-version :content-transfer-encoding:message-id; s=default; bh=nWfkRb+6ZrJ 8lXKY0CuQbIu2eBc=; b=VzS42KUFoD6Qyqce9Ai4Q4XvRzy/HBSnymAnEqzVUdP IOCc0KAOsPrtvhXWRxaNK+yGYq/8JvbOchFwooioTDYM9GN50SCiWB+Am78S/lZ2 SrI+f/vHaaKxSHefclVt5p9JayE+lxo/vN9SGBkUMIh4P4gzBFPjH6W1Jvnckr2k = Received: (qmail 25124 invoked by alias); 8 Aug 2017 21:25:00 -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 24511 invoked by uid 89); 8 Aug 2017 21:24:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 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; Tue, 08 Aug 2017 21:24:32 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v78LNkdK093787 for ; Tue, 8 Aug 2017 17:24:30 -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 2c7k46ems7-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 08 Aug 2017 17:24:30 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Aug 2017 17:24:29 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Aug 2017 17:24:27 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v78LOR5722085800; Tue, 8 Aug 2017 21:24:27 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B405D12403F; Tue, 8 Aug 2017 17:21:50 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id 6C34012403D; Tue, 8 Aug 2017 17:21:50 -0400 (EDT) Subject: [PATCH, rs6000] testcase coverage for vec_pack builtin From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: GCC Patches Cc: "Carl E. Love" , Segher Boessenkool , David Edelsohn , Bill Schmidt Date: Tue, 08 Aug 2017 16:24:26 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17080821-0048-0000-0000-000001D08CBA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007509; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000217; SDB=6.00899501; UDB=6.00450236; IPR=6.00679707; BA=6.00005519; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016601; XFM=3.00000015; UTC=2017-08-08 21:24:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080821-0049-0000-0000-0000422A740E Message-Id: <1502227466.6577.23.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-08_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708080351 X-IsSubscribed: yes Hi, [PATCH, rs6000] testcase coverage for vec_pack builtin Add some testcase coverage for the vec_pack built-in. Tested across power platforms (p6 and newer). OK for trunk? Thanks, -Will [gcc/testsuite] |-------2017-08-08 Will Schmidt * fold-vec-pack-double.c: New. * fold-vec-pack-int.c: New. * fold-vec-pack-longlong.c: New. * fold-vec-pack-short.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-double.c new file mode 100644 index 0000000..29d049a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-double.c @@ -0,0 +1,18 @@ +/* Verify that overloaded built-ins for vec_pack with + double inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mvsx -mpower8-vector -O2" } */ + +#include + +// vector float vec_pack (vector double, vector double); + +vector float +test_pack (vector double vd2, vector double vd3) +{ + return vec_pack (vd2, vd3); +} + +/* { dg-final { scan-assembler-times "vpkudum" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-int.c new file mode 100644 index 0000000..940faf3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-int.c @@ -0,0 +1,28 @@ +/* Verify that overloaded built-ins for vec_pack with int + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector bool short +testbi_h (vector bool int vbi2, vector bool int vbi3) +{ + return vec_pack (vbi2, vbi3); +} + +vector signed short +testsi_h (vector signed int vsi2, vector signed int vsi3) +{ + return vec_pack (vsi2, vsi3); +} + +vector unsigned short +testui_h (vector unsigned int vui2, vector unsigned int vui3) +{ + return vec_pack (vui2, vui3); +} + +/* { dg-final { scan-assembler-times "vpkuwum" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-longlong.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-longlong.c new file mode 100644 index 0000000..d8acc3c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-longlong.c @@ -0,0 +1,28 @@ +/* Verify that overloaded built-ins for vec_pack with long long + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mvsx -mpower8-vector -O2" } */ + +#include + +vector bool int +testbl_h (vector bool long long vbl2, vector bool long long vbl3) +{ + return vec_pack (vbl2, vbl3); +} + +vector signed int +testsl_h (vector signed long long vsl2, vector signed long long vsl3) +{ + return vec_pack (vsl2, vsl3); +} + +vector unsigned int +testul_h (vector unsigned long vul2, vector unsigned long vul3) +{ + return vec_pack (vul2, vul3); +} + +/* { dg-final { scan-assembler-times "vpkudum" 3 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-short.c new file mode 100644 index 0000000..37cd191 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-pack-short.c @@ -0,0 +1,28 @@ +/* Verify that overloaded built-ins for vec_pack with short + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector bool char +testbi_eh (vector bool short vbs2, vector bool short vbs3) +{ + return vec_pack (vbs2, vbs3); +} + +vector signed char +testsi_eh (vector signed short vss2, vector signed short vss3) +{ + return vec_pack (vss2, vss3); +} + +vector unsigned char +testui_eh (vector unsigned short vus2, vector unsigned short vus3) +{ + return vec_pack (vus2, vus3); +} + +/* { dg-final { scan-assembler-times "vpkuhum" 3 } } */