From patchwork Tue Aug 8 21:22:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 799443 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-460070-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="JO9SZnYC"; 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 3xRnS16Lc6z9s1h for ; Wed, 9 Aug 2017 07:22:56 +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=mhQ50 ABmRrIKN47mKS9g/GKvYgQg6W4brlCjgM5EHBeA6zsDjIQ4a0m5UYiMbrkQR/OIF k5y/SadAXhhLzFxWqhlW/Krx2+XYnfepcBMIWXHxrODLRHWua/NI2ZdNr1KE640T IcviUhYqTDh+tqLcyYGAav9kK5FzD5v2G1tG8I= 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=eD/mucDMH33 IGsYKtE3/t9ooEXE=; b=JO9SZnYCxkfD4vdFPtPhU6kyAsapJNidhmuAvuP+9/H LSGRl2RpXEKzhLamLrTLgo5JFquA8im180RXG9gRo6kJTQx85ek4GHDkCgT5Moiz ptdzlziT6cH+oEtGdmEgqTM4xFy/gJKChn3/fdyHgQ69L1GZpTUUvENo+Wa633bY = Received: (qmail 20974 invoked by alias); 8 Aug 2017 21:22:49 -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 20960 invoked by uid 89); 8 Aug 2017 21:22:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 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:22:47 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v78LIdT1022324 for ; Tue, 8 Aug 2017 17:22:45 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 2c7kay5yt6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 08 Aug 2017 17:22:45 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Aug 2017 17:22:44 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Aug 2017 17:22:41 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v78LMfxx24838276; Tue, 8 Aug 2017 21:22:41 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36BEDAC03A; Tue, 8 Aug 2017 17:22:58 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id DFAEEAC043; Tue, 8 Aug 2017 17:22:57 -0400 (EDT) Subject: [PATCH, rs6000] Add testcase coverage for vec_msum built-in 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:22:40 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17080821-2213-0000-0000-000002068AFE 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.00679706; 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:22:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080821-2214-0000-0000-000057276D04 Message-Id: <1502227360.6577.21.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-1708080350 X-IsSubscribed: yes Hi, [PATCH, rs6000] Add testcase coverage for vec_msum built-in Add testcase coverage for vec_msum built-in. Tested across power platforms (p6 and newer). OK for trunk? Thanks, -Will [gcc/testsuite] 2017-08-08 Will Schmidt * fold-vec-msum-char.c: New. * fold-vec-msum-short.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c new file mode 100644 index 0000000..53519d5 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-char.c @@ -0,0 +1,25 @@ +/* Verify that overloaded built-ins for vec_msum() with char inputs + produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector unsigned int +test_msum_ui_uc_uc_ui (vector unsigned char vuc2, vector unsigned char vuc3, + vector unsigned int vui2) +{ + return vec_msum (vuc2, vuc3, vui2); +} + +vector signed int +test_msum_si_sc_uc_si (vector signed char vsc2, vector unsigned char vuc3, + vector signed int vsi2) +{ + return vec_msum (vsc2, vuc3, vsi2); +} + +/* { dg-final { scan-assembler-times "vmsumubm" 1 } } */ +/* { dg-final { scan-assembler-times "vmsummbm" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c new file mode 100644 index 0000000..61e1d35 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-msum-short.c @@ -0,0 +1,25 @@ +/* Verify that overloaded built-ins for vec_msum with int + inputs produce the right results. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector signed int +test_msum_si (vector signed short vss2, vector signed short vss3, + vector signed int vsi2) +{ + return vec_msum (vss2, vss3, vsi2); +} + +vector unsigned int +test_msum)ui (vector unsigned short vus2, vector unsigned short vus3, + vector unsigned int vui2) +{ + return vec_msum (vus2, vus3, vui2); +} + +/* { dg-final { scan-assembler-times "vmsumshm" 1 } } */ +/* { dg-final { scan-assembler-times "vmsumuhm" 1 } } */