From patchwork Fri Jan 21 17:31:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 50326 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C95B385781B for ; Fri, 21 Jan 2022 17:34:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C95B385781B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1642786462; bh=uZEFnjBvT8VJ+5ZXTMNwmsLTIEV3NW93Dh0u+fEFuLs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=HJw6iaDFiM0V8PE9VAl4yJzXH+3ShwaxkR3YYtlsFjsfAwm2T4cnOYBuBSNyAao6w jL9peVioFAiUri7swKQ6I1d1wDNPzM30CdzSO/un0yKKmllFRkB6I98LMWNrOKe0kq kak7stxZLp7x+tt7y9odA0Jps29m87r41UjHiRq4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id ABE673857836 for ; Fri, 21 Jan 2022 17:31:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ABE673857836 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20LHDpeX030978; Fri, 21 Jan 2022 17:31:39 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dqw2cpan9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jan 2022 17:31:39 +0000 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20LHUFpI015508; Fri, 21 Jan 2022 17:31:38 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dqw2cpamj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jan 2022 17:31:38 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20LHCAS4014484; Fri, 21 Jan 2022 17:31:37 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma01wdc.us.ibm.com with ESMTP id 3dqjuqxxgh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jan 2022 17:31:37 +0000 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 20LHVZRb40894858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jan 2022 17:31:35 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A38CF124055; Fri, 21 Jan 2022 17:31:35 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18870124054; Fri, 21 Jan 2022 17:31:35 +0000 (GMT) Received: from [9.211.104.235] (unknown [9.211.104.235]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 21 Jan 2022 17:31:34 +0000 (GMT) Message-ID: Date: Fri, 21 Jan 2022 11:31:34 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: GCC Patches Subject: [PATCH] rs6000: Support vector float/double for vec_sldw X-TM-AS-GCONF: 00 X-Proofpoint-GUID: rA1ZjAk9BgfJsU7RFF8gQnbK-aIM8BnZ X-Proofpoint-ORIG-GUID: uapNzFGKcKnsKnWG3U1eIyrX4UCIPrpA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-21_09,2022-01-21_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201210114 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Bill Schmidt via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: wschmidt@linux.ibm.com Cc: David Edelsohn , Segher Boessenkool Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, It was recently discovered that Clang supports a couple of variants of vec_sldw that GCC does not. After some discussion, we decided that these variants are reasonable, and GCC will also support them. This patch adds that support. I updated an existing test and discovered it wasn't actually checking for generation of the xxsldwi instruction, so I added that check as well. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this okay for trunk? Thanks! Bill 2022-01-21 Bill Schmidt gcc/ * config/rs6000/rs6000-overload.def (VEC_SLDW): Add instances for vector float and vector double. gcc/testsuite/ * gcc.target/powerpc/builtins-4.c: Add two test variants. Adjust assembler counts. --- gcc/config/rs6000/rs6000-overload.def | 4 +++ gcc/testsuite/gcc.target/powerpc/builtins-4.c | 34 +++++++++++++------ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/gcc/config/rs6000/rs6000-overload.def b/gcc/config/rs6000/rs6000-overload.def index dea6f5d4258..cdc703e9764 100644 --- a/gcc/config/rs6000/rs6000-overload.def +++ b/gcc/config/rs6000/rs6000-overload.def @@ -3405,6 +3405,10 @@ XXSLDWI_2DI XXSLDWI_VSLL vull __builtin_vec_sldw (vull, vull, const int); XXSLDWI_2DI XXSLDWI_VULL + vf __builtin_vec_sldw (vf, vf, const int); + XXSLDWI_4SF XXSLDWI_VF + vd __builtin_vec_sldw (vd, vd, const int); + XXSLDWI_2DF XXSLDWI_VD [VEC_SLL, vec_sll, __builtin_vec_sll] vsc __builtin_vec_sll (vsc, vuc); diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-4.c b/gcc/testsuite/gcc.target/powerpc/builtins-4.c index 4e3b543f242..df012e9b7d6 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-4.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-4.c @@ -119,6 +119,18 @@ test_vul_sldw_vul_vul (vector unsigned long long x, return vec_sldw (x, y, 3); } +vector float +test_vf_sldw_vf_vf (vector float x, vector float y) +{ + return vec_sldw (x, y, 3); +} + +vector double +test_vd_sldw_vd_vd (vector double x, vector double y) +{ + return vec_sldw (x, y, 1); +} + vector signed int long long test_sll_vsill_vsill_vuc (vector signed long long int x, vector unsigned char y) @@ -146,14 +158,16 @@ test_sll_vuill_vuill_vuc (vector unsigned long long int x, test_slo_vsll_slo_vsll_vuc 1 vslo test_slo_vull_slo_vull_vsc 1 vslo test_slo_vull_slo_vull_vuc 1 vslo - test_vsc_sldw_vsc_vsc 1 xxlor - test_vuc_sldw_vuc_vuc 1 xxlor - test_vssi_sldw_vssi_vssi 1 xxlor - test_vusi_sldw_vusi_vusi 1 xxlor - test_vsi_sldw_vsi_vsi 1 xxlor - test_vui_sldw_vui_vui 1 xxlor - test_vsl_sldw_vsl_vsl 1 xxlor - test_vul_sldw_vul_vul 1 xxlor + test_vsc_sldw_vsc_vsc 1 xxlor, 1 xxsldwi + test_vuc_sldw_vuc_vuc 1 xxlor, 1 xxsldwi + test_vssi_sldw_vssi_vssi 1 xxlor, 1 xxsldwi + test_vusi_sldw_vusi_vusi 1 xxlor, 1 xxsldwi + test_vsi_sldw_vsi_vsi 1 xxlor, 1 xxsldwi + test_vui_sldw_vui_vui 1 xxlor, 1 xxsldwi + test_vsl_sldw_vsl_vsl 1 xxlor, 1 xxsldwi + test_vul_sldw_vul_vul 1 xxlor, 1 xxsldwi + test_vf_sldw_vf_vf 1 xxlor, 1 xxsldwi + test_vd_sldw_vd_vd 1 xxlor, 1 xxsldwi test_sll_vsill_vsill_vuc 1 vsl test_sll_vuill_vuill_vuc 1 vsl */ @@ -161,6 +175,6 @@ test_sll_vuill_vuill_vuc (vector unsigned long long int x, /* { dg-final { scan-assembler-times "xvnabssp" 1 } } */ /* { dg-final { scan-assembler-times "xvnabsdp" 1 } } */ /* { dg-final { scan-assembler-times "vslo" 4 } } */ -/* { dg-final { scan-assembler-times "xxlor" 30 } } */ +/* { dg-final { scan-assembler-times "xxlor" 32 } } */ /* { dg-final { scan-assembler-times {\mvsl\M} 5 } } */ - +/* { dg-final { scan-assembler-times "xxsldwi" 10 } } */