From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Michael Meissner 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-Type: text/plain; charset=us-ascii 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-List-Received-Date: Thu, 28 Jul 2022 04:54:29 -0000 [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" } */ } -- 2.35.3 -- Michael Meissner, IBM PO Box 98, Ayer, Massachusetts, USA, 01432 email: meissner@linux.ibm.com