From patchwork Thu Sep 28 11:50:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 819547 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-463103-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="hC4NNRqy"; 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 3y2tNw5fytz9t3v for ; Thu, 28 Sep 2017 21:53:04 +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:from :to:subject:date:in-reply-to:references:message-id; q=dns; s= default; b=SjB1AbTehH3r7n1tqSi/XBvoa5yh49TBQhMRyZF0qOjEOHlVEKO0W gfZIaGAepYA6y+y2Nyic7DlaVR03JR34XEtph86hVEQBUIxEydLvErE7YK0tdQ1P xgXj7cfOjwtQCT/reccpmzHT4SMZ8NJFaVVgeDsU3O7tJkZwsk+qL8= 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:from :to:subject:date:in-reply-to:references:message-id; s=default; bh=WwvvD8e66YYh0Wo9BDGWb/qQwIc=; b=hC4NNRqy2V1ldV+VmnfYOu6YW299 H7F7WjXQmrYXNAB5An/ZPDOhT8yvaLSXE08In9PpyheYLPt9QJ8XAZKD2wN+I2EU lPhpvTF5++pFUYC64qZ75ia5yJPzNTxY+0j32B5VQI94D1Bix5pe82809K3dKLI1 yUUbPZGdXx9MEq8= Received: (qmail 113063 invoked by alias); 28 Sep 2017 11:52:55 -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 113054 invoked by uid 89); 28 Sep 2017 11:52:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW 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, 28 Sep 2017 11:52:53 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8SBne3X050225 for ; Thu, 28 Sep 2017 07:52:52 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2d8yxrt4u2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 28 Sep 2017 07:52:52 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Sep 2017 12:52:50 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 28 Sep 2017 12:52:48 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8SBqmPb13762770 for ; Thu, 28 Sep 2017 11:52:48 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF15D11C054 for ; Thu, 28 Sep 2017 12:48:39 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9513711C04A for ; Thu, 28 Sep 2017 12:48:39 +0100 (BST) Received: from maggie.boeblingen.de.ibm.com (unknown [9.152.212.134]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Thu, 28 Sep 2017 12:48:39 +0100 (BST) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/5] New target check: vect_long_mult Date: Thu, 28 Sep 2017 13:50:02 +0200 In-Reply-To: <20170928115044.21422-1-krebbel@linux.vnet.ibm.com> References: <20170928115044.21422-1-krebbel@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17092811-0012-0000-0000-0000057CF43B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17092811-0013-0000-0000-000018F6485B Message-Id: <20170928115044.21422-4-krebbel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-28_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709280177 X-IsSubscribed: yes We don't have a 64 bit vector integer multiply on z. Add a specific check for that. gcc/ChangeLog: 2017-09-28 Andreas Krebbel * doc/sourcebuild.texi: Document vect_long_mult. gcc/testsuite/ChangeLog: 2017-09-28 Andreas Krebbel * gcc.dg/vect/pr60656.c: Check vect_long_mult. * lib/target-supports.exp (check_effective_target_vect_long_mult): New proc. --- gcc/doc/sourcebuild.texi | 3 +++ gcc/testsuite/gcc.dg/vect/pr60656.c | 3 ++- gcc/testsuite/lib/target-supports.exp | 24 ++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 56e1b4e..4f25268 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1422,6 +1422,9 @@ Target supports @code{vector short} multiplication. @item vect_int_mult Target supports @code{vector int} multiplication. +@item vect_long_mult +Target supports 64 bit @code{vector long} multiplication. + @item vect_extract_even_odd Target supports vector even/odd element extraction. diff --git a/gcc/testsuite/gcc.dg/vect/pr60656.c b/gcc/testsuite/gcc.dg/vect/pr60656.c index d9e30bb..70ec0f6 100644 --- a/gcc/testsuite/gcc.dg/vect/pr60656.c +++ b/gcc/testsuite/gcc.dg/vect/pr60656.c @@ -43,4 +43,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_si_to_di_pattern } } } */ +/* P * P * P requires a widening multiplication first as well as a longxlong->long after that. */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_si_to_di_pattern && vect_long_mult } } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 5949da4..539aaaf 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6299,6 +6299,30 @@ proc check_effective_target_vect_int_mult { } { return $et_vect_int_mult_saved($et_index) } +# Return 1 if the target supports 64 bit hardware vector +# multiplication of long operands with a long result, 0 otherwise. +# +# This can change for different subtargets so do not cache the result. + +proc check_effective_target_vect_long_mult { } { + if { [istarget i?86-*-*] || [istarget x86_64-*-*] + || (([istarget powerpc*-*-*] + && ![istarget powerpc-*-linux*paired*]) + && [check_effective_target_ilp32]) + || [is-effective-target arm_neon] + || ([istarget sparc*-*-*] && [check_effective_target_ilp32]) + || [istarget aarch64*-*-*] + || ([istarget mips*-*-*] + && [et-is-effective-target mips_msa]) } { + set answer 1 + } else { + set answer 0 + } + + verbose "check_effective_target_vect_long_mult: returning $answer" 2 + return $answer +} + # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise. proc check_effective_target_vect_extract_even_odd { } {