From patchwork Wed Jan 4 06:17:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HAO CHEN GUI X-Patchwork-Id: 38751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4992280wrt; Tue, 3 Jan 2023 22:18:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXsP+8e2A3Xx5gdRbLqokQelU500/DSFpmEdKu18OEP2rOQ6KHM4iNFADuhQ1C6pDiLUSvun X-Received: by 2002:a05:6402:1caa:b0:46c:72fb:3810 with SMTP id cz10-20020a0564021caa00b0046c72fb3810mr47325450edb.41.1672813099899; Tue, 03 Jan 2023 22:18:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672813099; cv=none; d=google.com; s=arc-20160816; b=OzRzmQagYsr9w15EbG4eFzKhUSH0Kw0qA1bouG9o0Vissijb0etO+17xlxkkLdfR1N AXiDMB9YQck9gMB85hG7svs7R1VhOqyeSC0A7PMqyGHgQRBTW+fPzrb/dbF/gpwV11ll T0A2v0UksXOA9NhEeEz/ZlvWYMSyjKuMR4tERf9zPQ3wSFx2MKS5thSQTROkMuVwnl0d jn5Iylm6+pFeeMKSAqhGEJ2VY7dYnlP/CI0lCU5i5x490hT2yW6aMGEBotEyD3B7bYot /c6bVjet9tHkNgoOfthZ7dD35iseUCQe/hZbQyhc6cQoCbTImKrzmvmb6kTmgFpr5jRd WwQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:cc:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=X2J/OqGEryNsFYSW1PgFfbCm0E4GmSZlRWcGuDylYbs=; b=IK9u8agcnrOpS3+CDiZxMB0KdmiKrUhgICLH05m8YL1QEUh082YOToGOU3NDwFEg77 bqs6QndxEHHT9icR7wBV3oMbkgj5b9IJEhwtQ0+bahpHW3NV3MKxU2yp10oTy2IhVokb ceUl+TAg7+yxV1sXVTGjxEU+1kJ2e6+OAz7Qr2630PMZ53LOO1hTXEXDwKX58a1v+YQr 5N5N9BitvnRVwj9R89z3bGicBB3JvHkyDPaHmquCqLfsEjkrh0SA7HQvXGbA/E839o2r BFa+SgTD1XQKzZaWGLvmQKoJpdz33i6HqOvBrGkt8zm2DgaDHXsXphLotyMbNraSN5kY pBNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DB7kWyap; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q26-20020aa7da9a000000b004839aa62712si23584037eds.21.2023.01.03.22.18.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 22:18:19 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DB7kWyap; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A6D8A385B505 for ; Wed, 4 Jan 2023 06:17:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6D8A385B505 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672813077; bh=X2J/OqGEryNsFYSW1PgFfbCm0E4GmSZlRWcGuDylYbs=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=DB7kWyapi9AA4p2vGcAYsKwct922h7NbAFQJ9v0TRe/E4d2GazHSQT9VJnAQ7Id/J ih2+0JoN8H5KA11RJdI4TMDXCjh9igatRy3lf5NmQsx9cR7w/LxY4cuq4NGBZn9Owu hSUNpynWHb30ssxdqNDbZHdN5YEZlXxt32tDqVFY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 68AC03858C2D for ; Wed, 4 Jan 2023 06:17:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68AC03858C2D Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3042pPZq009191; Wed, 4 Jan 2023 06:17:12 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3mvmb84jhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Jan 2023 06:17:11 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3046HBKc022441; Wed, 4 Jan 2023 06:17:11 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3mvmb84jgk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Jan 2023 06:17:11 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 303EDQNx021191; Wed, 4 Jan 2023 06:17:09 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3mtcq6kgf1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Jan 2023 06:17:09 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3046H5wd40960482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jan 2023 06:17:05 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 62DE92004E; Wed, 4 Jan 2023 06:17:05 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AD7ED20043; Wed, 4 Jan 2023 06:17:02 +0000 (GMT) Received: from [9.200.36.180] (unknown [9.200.36.180]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 4 Jan 2023 06:17:02 +0000 (GMT) Message-ID: Date: Wed, 4 Jan 2023 14:17:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: gcc-patches Cc: Segher Boessenkool , David , "Kewen.Lin" , Peter Bergner Subject: [PATCH-3, rs6000] Change mode and insn condition for scalar insert exp instruction X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: bNUnuUcu4SGcXfOug_Qeb0a8ahIhamzl X-Proofpoint-GUID: zJJWbnBxkW8UJjsaaqOS0j8Zjck-s2qT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-04_02,2023-01-03_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 spamscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301040050 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: HAO CHEN GUI via Gcc-patches From: HAO CHEN GUI Reply-To: HAO CHEN GUI Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754071669060800739?= X-GMAIL-MSGID: =?utf-8?q?1754071669060800739?= Hi, This patch changes the mode of exponent to GPR in scalar insert exp pattern, as the exponent can be put into a 32-bit register. Also the condition check is changed from TARGET_64BIT to TARGET_POWERPC64. The test cases are modified according to the changes of expand pattern. Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. Is this okay for trunk? Any recommendations? Thanks a lot. Gui Haochen ChangeLog 2023-01-03 Haochen Gui gcc/ * config/rs6000/rs6000-builtins.def (__builtin_vsx_scalar_insert_exp): Replace bif-pattern from xsiexpdp to xsiexpdp_di. (__builtin_vsx_scalar_insert_exp_dp): Replace bif-pattern from xsiexpdpf to xsiexpdpf_di. * config/rs6000/vsx.md (xsiexpdp): Rename to... (xsiexpdp_): ..., set the mode of second operand to GPR and replace TARGET_64BIT with TARGET_POWERPC64. (xsiexpdpf): Rename to... (xsiexpdpf_): ..., set the mode of second operand to GPR and replace TARGET_64BIT with TARGET_POWERPC64. gcc/testsuite/ * gcc.target/powerpc/bfp/scalar-insert-exp-0.c: Replace lp64 check with has_arch_ppc64. * gcc.target/powerpc/bfp/scalar-insert-exp-1.c: Likewise. * gcc.target/powerpc/bfp/scalar-insert-exp-12.c: Likewise. * gcc.target/powerpc/bfp/scalar-insert-exp-13.c: Likewise. * gcc.target/powerpc/bfp/scalar-insert-exp-3.c: Likewise. * gcc.target/powerpc/bfp/scalar-insert-exp-4.c: Likewise. patch.diff diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def index 25647b7bdd2..b1b5002d7d9 100644 --- a/gcc/config/rs6000/rs6000-builtins.def +++ b/gcc/config/rs6000/rs6000-builtins.def @@ -2854,10 +2854,10 @@ const double __builtin_vsx_scalar_insert_exp (unsigned long long, \ unsigned long long); - VSIEDP xsiexpdp {} + VSIEDP xsiexpdp_di {} const double __builtin_vsx_scalar_insert_exp_dp (double, unsigned long long); - VSIEDPF xsiexpdpf {} + VSIEDPF xsiexpdpf_di {} pure vsc __builtin_vsx_xl_len_r (void *, signed long); XL_LEN_R xl_len_r {} diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 27e03a4cf6c..3376090cc6f 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -5137,22 +5137,22 @@ (define_insn "xsiexpqp_" [(set_attr "type" "vecmove")]) ;; VSX Scalar Insert Exponent Double-Precision -(define_insn "xsiexpdp" +(define_insn "xsiexpdp_" [(set (match_operand:DF 0 "vsx_register_operand" "=wa") (unspec:DF [(match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "register_operand" "r")] + (match_operand:GPR 2 "register_operand" "r")] UNSPEC_VSX_SIEXPDP))] - "TARGET_P9_VECTOR && TARGET_64BIT" + "TARGET_P9_VECTOR && TARGET_POWERPC64" "xsiexpdp %x0,%1,%2" [(set_attr "type" "fpsimple")]) ;; VSX Scalar Insert Exponent Double-Precision Floating Point Argument -(define_insn "xsiexpdpf" +(define_insn "xsiexpdpf_" [(set (match_operand:DF 0 "vsx_register_operand" "=wa") (unspec:DF [(match_operand:DF 1 "register_operand" "r") - (match_operand:DI 2 "register_operand" "r")] + (match_operand:GPR 2 "register_operand" "r")] UNSPEC_VSX_SIEXPDP))] - "TARGET_P9_VECTOR && TARGET_64BIT" + "TARGET_P9_VECTOR && TARGET_POWERPC64" "xsiexpdp %x0,%1,%2" [(set_attr "type" "fpsimple")]) diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c index d8243258a67..88d77564158 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-0.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9" } */ +/* { dg-require-effective-target has_arch_ppc64 } */ /* This test should succeed only on 64-bit configurations. */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c index 8260b107178..2f219ddc83a 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-1.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power8" } */ +/* { dg-require-effective-target has_arch_ppc64 } */ /* This test should succeed only on 64-bit configurations. */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c index 384fc9cc675..9eade34d9ad 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c @@ -1,7 +1,7 @@ /* { dg-do run { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target p9vector_hw } */ /* { dg-options "-mdejagnu-cpu=power9" } */ +/* { dg-require-effective-target has_arch_ppc64 } */ /* This test should succeed only on 64-bit configurations. */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c index 0e004224277..674fba951ae 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c @@ -1,7 +1,7 @@ /* { dg-do run { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target p9vector_hw } */ /* { dg-options "-mdejagnu-cpu=power9" } */ +/* { dg-require-effective-target has_arch_ppc64 } */ /* This test should succeed only on 64-bit configurations. */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c index 3ecbe3318e8..afa2b83f2d2 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-3.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9" } */ +/* { dg-require-effective-target has_arch_ppc64 } */ /* This test should succeed only on 64-bit configurations. */ #include diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c index 1699c67a2f1..6dc06dd34ea 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-4.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power8" } */ +/* { dg-require-effective-target has_arch_ppc64 } */ /* This test should succeed only on 64-bit configurations. */ #include