From patchwork Thu May 11 15:51:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 761221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wNyKW2Pklz9s7j for ; Fri, 12 May 2017 01:52:14 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="dCgFRttB"; dkim-atps=neutral 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=b6Ws6 DxdX4igGRh4LAiVzRsnR3sLQMZg6P6QBHDcxSbnK1MQfi9zgdrh/5N2cF2kRWDa9 1sLj5YhErIj3y4e09uFk3snub4otbaTR0R4qqlCVPeitCPV5lGGuFc1U6/wY1lWw gT6AGPMixF03LIBK54C6Xvv+peIB1jqkKG1A14= 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=C2+feVENS9P JtJoLVVKqSO41414=; b=dCgFRttB7fvOY8tHlKCIRvAgGgFtbvwBedChBb1YcVs x1tkC6BDoiwK0BdrsNNAa9sVbxK8yqNr16FtLelgxOLNZ9sXKfuJ9OgVV3OluG+n cXJzSQ67/kkMGbsj2UWf3Ja7IuC/J+g20k3j5r3TleaFN6VFQIpRZDf7fL7xMNCE = Received: (qmail 83078 invoked by alias); 11 May 2017 15:52:01 -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 83059 invoked by uid 89); 11 May 2017 15:52:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.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=mule 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, 11 May 2017 15:51:59 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4BFdNWh036483 for ; Thu, 11 May 2017 11:52:01 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ac5r719ut-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 11 May 2017 11:52:01 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 May 2017 09:51:58 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 May 2017 09:51:56 -0600 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4BFpucX15597990; Thu, 11 May 2017 08:51:56 -0700 Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DAE54BE038; Thu, 11 May 2017 09:51:55 -0600 (MDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 88FACBE044; Thu, 11 May 2017 09:51:55 -0600 (MDT) Subject: [PATCH, rs6000] Fold vector multiplies in GIMPLE From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: GCC Patches , Segher Boessenkool , David Edelsohn Cc: Bill Schmidt , Will Schmidt Date: Thu, 11 May 2017 10:51:54 -0500 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17051115-0028-0000-0000-00000791A2A7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007047; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000211; SDB=6.00859194; UDB=6.00425806; IPR=6.00638670; BA=6.00005345; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015413; XFM=3.00000015; UTC=2017-05-11 15:51:58 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17051115-0029-0000-0000-000035B59C4F Message-Id: <1494517914.15163.33.camel@brimstone.rchland.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-11_12:, , 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-1703280000 definitions=main-1705110082 X-IsSubscribed: yes Hi, Add support for some of the vector multiply (sp,dp) operations in the gimple folding. I missed these during an earlier pass that added the other (mule, mulo) multiply operations. This change is covered by the existing testcases for vector folding (gcc.target/powerpc/fold-vec-mul-*.c). Bootstrapped and tested on powerpc64le-unknown-linux-gnu, and powerpc-unknown-linux, (p7,p8le,p8be) with no regressions. Is this OK for trunk? [gcc] 2017-05-10 Will Schmidt * config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add handling for early GIMPLE expansion of vector multiplies. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a1b58e2..c4e03b4 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -16860,6 +16860,17 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi) gsi_replace (gsi, g, true); return true; } + case VSX_BUILTIN_XVMULSP: + case VSX_BUILTIN_XVMULDP: + { + arg0 = gimple_call_arg (stmt, 0); + arg1 = gimple_call_arg (stmt, 1); + lhs = gimple_call_lhs (stmt); + gimple *g = gimple_build_assign (lhs, MULT_EXPR, arg0, arg1); + gimple_set_location (g, gimple_location (stmt)); + gsi_replace (gsi, g, true); + return true; + } /* Even element flavors of vec_mul (signed). */ case ALTIVEC_BUILTIN_VMULESB: case ALTIVEC_BUILTIN_VMULESH: