From patchwork Thu Jul 28 04:54:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp41952pxt; Wed, 27 Jul 2022 21:55:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1svmBfVpv9/I6B5HC8xP1kwH9rEdSxuua+7EPj1PjBacYfrAQC0mgdaqLsX5Xnq+Qkxn+Yr X-Received: by 2002:a17:907:94d0:b0:72f:269c:3aa3 with SMTP id dn16-20020a17090794d000b0072f269c3aa3mr19497025ejc.695.1658984112856; Wed, 27 Jul 2022 21:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658984112; cv=none; d=google.com; s=arc-20160816; b=ELgDHtgFC3JjBmiVvN1FvkM04PPJUT6Mt98HUmDsQ/ilsZDJRGgHCTgZ3xhu6wCnWS //9qX8MOkK7azuDAgg+42kWCqgfXGWXQlBO9dn94+lb9tnArNgx3IC7VmAbmukpzjuZ9 AJEa0EJ02d96v1ZVSVa/Mfbrwgh/PIquu/58nsb2IslZbA9jSd+2z0l0W66I2L8vQaip J5+esauMUY1HjklVgSBpJrX7IB8fGL7W5lKJYNUyl+D7PpzMwhDuJgtESdkKpdrAnmDj k2IG30c4RVZVX1gTfUqSwZ9oDlND0M1j+Uy9zjMPPRQ3rfbLNVtCt4qSInOvtv5dKiIj msjA== 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:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=o3gmm0KuPOgyp0XU1l5fNL+vHwlQRIPFmAZfBY7sJ6k=; b=fJL7xiRgP46JeGAxnSY47OK4WddRhCv6mB6vM6ByQ7Klu2Jr1t9f4v3p1UR6ynAtlw v5Urpb5EYuqVofyiD80QxWdziAiovOLdM8gl71z33zGqWVnFWVMB4gkyLc1miyvmpbjh H2FBH5AWlodVZ5mYdsoLR51ldqONukgEnx4GkX+4AF8QLZvK3jTOzlYhMYXs0cr70OdZ TG9mIF0n6bRQccMiFgw15hwjsgBpxdRkHUcxS3Ua3FMWB9rENvx92WnnN2iuRQpkseN5 rqXNOPzhZgSXVVnR46N2I/lFIjklP2dlFhszSG4WCVA/06xFnDbALtZUfcb2UuiOuoC7 +fqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=IlmKT365; 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 fj4-20020a1709069c8400b0072fc5a78f82si14078598ejc.202.2022.07.27.21.55.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 21:55:12 -0700 (PDT) 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=IlmKT365; 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 7F7C33858031 for ; Thu, 28 Jul 2022 04:55:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F7C33858031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1658984111; bh=o3gmm0KuPOgyp0XU1l5fNL+vHwlQRIPFmAZfBY7sJ6k=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IlmKT365gpD5ff07AdcTQXvxfSLitiyJfLTWSJqoAZYar7WIV3+dU+lGDOECc6BFt 17AK8/q6IBF3ShvFrMwfrutIL5/MaErKhZvE8gwejfuUYhofh6BqXGMJTGjWU1YIQt 0/9x+jGpSnxcinE11Ux4DXWWrrcfIlLys3wac378= 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 53AB13858295 for ; Thu, 28 Jul 2022 04:54:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53AB13858295 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26S4fsSC028793; Thu, 28 Jul 2022 04:54:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hkknc8b2c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Jul 2022 04:54:26 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 26S4hF0a003367; Thu, 28 Jul 2022 04:54:26 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hkknc8b1t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Jul 2022 04:54:26 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26S4pEwF008515; Thu, 28 Jul 2022 04:54:25 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01dal.us.ibm.com with ESMTP id 3hg98scmbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Jul 2022 04:54:25 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26S4sOWx3211822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Jul 2022 04:54:24 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E03CF112065; Thu, 28 Jul 2022 04:54:23 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92DBD11206E; Thu, 28 Jul 2022 04:54:23 +0000 (GMT) Received: from toto.the-meissners.org (unknown [9.65.225.181]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTPS; Thu, 28 Jul 2022 04:54:23 +0000 (GMT) Date: Thu, 28 Jul 2022 00:54:15 -0400 To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , David Edelsohn , Peter Bergner , Will Schmidt Subject: [PATCH 5/5] Support IEEE 128-bit overload test data built-in functions. Message-ID: Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , "Kewen.Lin" , David Edelsohn , Peter Bergner , Will Schmidt References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: RRbud9O11xkCC5h1BGLNO9TIjsLoY50R X-Proofpoint-ORIG-GUID: j0FjVEErq6SmYeFKGqWrRCKa6E6wY8nV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-27_08,2022-07-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 malwarescore=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 adultscore=0 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207280019 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, 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: Michael Meissner via Gcc-patches From: Michael Meissner Reply-To: Michael Meissner 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?1739570925174852169?= X-GMAIL-MSGID: =?utf-8?q?1739570925174852169?= [PATCH 5/5] Support IEEE 128-bit overload test data built-in functions. This patch adds support for overloading the IEEE 128-bit test data and test data negate built-in functions bewteeen KFmode and TFmode arguments. I have tested these patches on a power10 that is running Fedora 36, which defaults to using long doubles that are IEEE 128-bit. I have built two parallel GCC compilers, one that defaults to using IEEE 128-bit long doubles and one that defaults to using IBM 128-bit long doubles. I have compared the test results to the original compiler results, comparing a modified GCC to the original compiler using an IEEE 128-bit long double default, and also comparing a modified GCC to the original compiler using an IBM 128-bit long double default. In both cases, the results are the same. I have also compared the compilers with the future patch in progress that does switch the internal type handling. Once those patches are installed, the overload mechanism will insure the correct built-in is used. Can I install this patch to the trunk, assuming I have installed the first four patches in the series? 2022-07-27 Michael Meissner gcc/ * config/rs6000/rs6000-builtins.def (__builtin_vsx_scalar_test_data_class_qp_kf): Rename KFmode IEEE 128-bit test data built-in functions to have a KF suffix to allow overloading. (__builtin_vsx_scalar_test_neg_qp_kf): Likewise. (__builtin_vsx_scalar_test_data_class_qp_tf): Add TFmode variants for IEEE 128-bit insert and extract support. (__builtin_vsx_scalar_test_neg_qp_tf): Likewise. * config/rs6000/rs6000-overload.def (__builtin_vec_scalar_test_data_class): Add TFmode overloads. (__builtin_vec_scalar_test_neg): Likewise. (__builtin_vec_scalar_test_neg_qp): Likewise. (__builtin_vec_scalar_test_data_class_qp): Likewise. gcc/testsuite/ * gcc.target/powerpc/bfp/scalar-test-data-class-11.c: Update the expected error message. * gcc.target/powerpc/bfp/scalar-test-neg-5.c: Likewise. --- gcc/config/rs6000/rs6000-builtins.def | 17 ++++++++++++----- gcc/config/rs6000/rs6000-overload.def | 18 +++++++++++++----- .../powerpc/bfp/scalar-test-data-class-11.c | 2 +- .../gcc.target/powerpc/bfp/scalar-test-neg-5.c | 2 +- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def index 2ac66b39975..e12efc95965 100644 --- a/gcc/config/rs6000/rs6000-builtins.def +++ b/gcc/config/rs6000/rs6000-builtins.def @@ -2918,12 +2918,12 @@ unsigned long long); VSIEQPF_KF xsiexpqpf_kf {} - const signed int __builtin_vsx_scalar_test_data_class_qp (_Float128, \ - const int<7>); - VSTDCQP xststdcqp_kf {} + const signed int __builtin_vsx_scalar_test_data_class_qp_kf (_Float128, \ + const int<7>); + VSTDCQP_KF xststdcqp_kf {} - const signed int __builtin_vsx_scalar_test_neg_qp (_Float128); - VSTDCNQP xststdcnegqp_kf {} + const signed int __builtin_vsx_scalar_test_neg_qp_kf (_Float128); + VSTDCNQP_KF xststdcnegqp_kf {} ; Builtins requiring hardware support for IEEE-128 floating-point. Long double @@ -2980,6 +2980,13 @@ unsigned long long); VSIEQPF_TF xsiexpqpf_tf {ieeeld} + const signed int __builtin_vsx_scalar_test_data_class_qp_tf (_Float128, \ + const int<7>); + VSTDCQP_TF xststdcqp_tf {ieeeld} + + const signed int __builtin_vsx_scalar_test_neg_qp_tf (_Float128); + VSTDCNQP_TF xststdcnegqp_tf {ieeeld} + ; Decimal floating-point builtins. [dfp] diff --git a/gcc/config/rs6000/rs6000-overload.def b/gcc/config/rs6000/rs6000-overload.def index 546883ece19..572e3510360 100644 --- a/gcc/config/rs6000/rs6000-overload.def +++ b/gcc/config/rs6000/rs6000-overload.def @@ -4536,7 +4536,9 @@ unsigned int __builtin_vec_scalar_test_data_class (double, const int); VSTDCDP unsigned int __builtin_vec_scalar_test_data_class (_Float128, const int); - VSTDCQP + VSTDCQP_KF + unsigned int __builtin_vec_scalar_test_data_class (long double, const int); + VSTDCQP_TF [VEC_VSTDCN, scalar_test_neg, __builtin_vec_scalar_test_neg] unsigned int __builtin_vec_scalar_test_neg (float); @@ -4544,7 +4546,9 @@ unsigned int __builtin_vec_scalar_test_neg (double); VSTDCNDP unsigned int __builtin_vec_scalar_test_neg (_Float128); - VSTDCNQP + VSTDCNQP_KF + unsigned int __builtin_vec_scalar_test_neg (long double); + VSTDCNQP_TF [VEC_VTDC, vec_test_data_class, __builtin_vec_test_data_class] vbi __builtin_vec_test_data_class (vf, const int); @@ -5928,9 +5932,11 @@ unsigned int __builtin_vec_scalar_test_neg_dp (double); VSTDCNDP VSTDCNDP_DEPR1 -[VEC_VSTDCNQP, scalar_test_neg_qp, __builtin_vec_scalar_test_neg_qp] +[VEC_VSTDCNQP_KF, scalar_test_neg_qp, __builtin_vec_scalar_test_neg_qp] unsigned int __builtin_vec_scalar_test_neg_qp (_Float128); - VSTDCNQP VSTDCNQP_DEPR1 + VSTDCNQP_KF VSTDCNQP_KF_DEPR1 + unsigned int __builtin_vec_scalar_test_neg_qp (long double); + VSTDCNQP_TF VSTDCNQP_TF_DEPR1 [VEC_VSTDCNSP, scalar_test_neg_sp, __builtin_vec_scalar_test_neg_sp] unsigned int __builtin_vec_scalar_test_neg_sp (float); @@ -5938,7 +5944,9 @@ [VEC_VSTDCQP, scalar_test_data_class_qp, __builtin_vec_scalar_test_data_class_qp] unsigned int __builtin_vec_scalar_test_data_class_qp (_Float128, const int); - VSTDCQP VSTDCQP_DEPR1 + VSTDCQP_KF VSTDCQP_KF_DEPR1 + unsigned int __builtin_vec_scalar_test_data_class_qp (long double, const int); + VSTDCQP_TF VSTDCQP_TF_DEPR1 [VEC_VSTDCSP, scalar_test_data_class_sp, __builtin_vec_scalar_test_data_class_sp] unsigned int __builtin_vec_scalar_test_data_class_sp (float, const int); diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c index 7c6fca2b729..82da5956e05 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c @@ -10,5 +10,5 @@ test_data_class (__ieee128 *p) { __ieee128 source = *p; - return __builtin_vec_scalar_test_data_class (source, 3); /* { dg-error "'__builtin_vsx_scalar_test_data_class_qp' requires" } */ + return __builtin_vec_scalar_test_data_class (source, 3); /* { dg-error "'__builtin_vsx_scalar_test_data_class_qp.*' requires" } */ } diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c index 8c55c1cfb5c..eef02f40f3d 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c @@ -10,5 +10,5 @@ test_neg (__ieee128 *p) { __ieee128 source = *p; - return __builtin_vec_scalar_test_neg (source); /* { dg-error "'__builtin_vsx_scalar_test_neg_qp' requires" } */ + return __builtin_vec_scalar_test_neg (source); /* { dg-error "'__builtin_vsx_scalar_test_neg_qp.*' requires" } */ }