From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 4E114388C025 for ; Thu, 24 Sep 2020 20:36:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E114388C025 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08OKVGai062613; Thu, 24 Sep 2020 16:36:58 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33rxx4p71g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 16:36:57 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08OKVPB8063081; Thu, 24 Sep 2020 16:36:57 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 33rxx4p714-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 16:36:57 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 08OKVo1u029416; Thu, 24 Sep 2020 20:36:56 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma04dal.us.ibm.com with ESMTP id 33n9m9p4mm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 20:36:56 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08OKatUJ54133160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Sep 2020 20:36:55 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 45FD128059; Thu, 24 Sep 2020 20:36:55 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BFDA328058; Thu, 24 Sep 2020 20:36:54 +0000 (GMT) Received: from ibm-toto.the-meissners.org (unknown [9.160.88.183]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTPS; Thu, 24 Sep 2020 20:36:54 +0000 (GMT) Date: Thu, 24 Sep 2020 16:36:53 -0400 From: Michael Meissner To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Jeff Law , Jonathan Wakely Subject: [PATCH 5/9] PowerPC: Update tests to run if long double is IEEE 128-bit. Message-ID: <20200924203653.GE31597@ibm-toto.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Jeff Law , Jonathan Wakely References: <20200924202036.GA28437@ibm-toto.the-meissners.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924202036.GA28437@ibm-toto.the-meissners.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-24_14:2020-09-24, 2020-09-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 suspectscore=0 clxscore=1015 adultscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009240146 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 24 Sep 2020 20:36:59 -0000 PowerPC: Update tests to run if long double is IEEE 128-bit. gcc/testsuite/ 2020-09-23 Michael Meissner * c-c++-common/dfp/convert-bfp-11.c: If long double is IEEE 128-bit, skip the test. * gcc.dg/nextafter-2.c: On PowerPC, if long double is IEEE 128-bit, include math.h to get the built-in mapped correctly. * gcc.target/powerpc/pr70117.c: Add support for long double being IEEE 128-bit. --- gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c | 7 +++++++ gcc/testsuite/gcc.dg/nextafter-2.c | 10 ++++++++++ gcc/testsuite/gcc.target/powerpc/pr70117.c | 6 ++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c b/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c index 95c433d2c24..6ee0c1c6ae9 100644 --- a/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c +++ b/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c @@ -5,6 +5,7 @@ Don't force 128-bit long doubles because runtime support depends on glibc. */ +#include #include "convert.h" volatile _Decimal32 sd; @@ -39,6 +40,12 @@ main () if (sizeof (long double) != 16) return 0; + /* This test is written to test IBM extended double, which is a pair of + doubles. If long double can hold a larger value than a double can, such + as when long double is IEEE 128-bit, just exit immediately. */ + if (LDBL_MAX_10_EXP > DBL_MAX_10_EXP) + return 0; + convert_101 (); convert_102 (); diff --git a/gcc/testsuite/gcc.dg/nextafter-2.c b/gcc/testsuite/gcc.dg/nextafter-2.c index e51ae94be0c..64e9e3c485f 100644 --- a/gcc/testsuite/gcc.dg/nextafter-2.c +++ b/gcc/testsuite/gcc.dg/nextafter-2.c @@ -13,4 +13,14 @@ # define NO_LONG_DOUBLE 1 # endif #endif + +#if defined(_ARCH_PPC) && defined(__LONG_DOUBLE_IEEE128__) +/* On PowerPC systems, long double uses either the IBM long double format, or + IEEE 128-bit format. The compiler switches the long double built-in + function names and glibc switches the names when math.h is included. + Because this test is run with -fno-builtin, include math.h so that the + appropriate nextafter functions are called. */ +#include +#endif + #include "nextafter-1.c" diff --git a/gcc/testsuite/gcc.target/powerpc/pr70117.c b/gcc/testsuite/gcc.target/powerpc/pr70117.c index 3bbd2c595e0..928efe39c7b 100644 --- a/gcc/testsuite/gcc.target/powerpc/pr70117.c +++ b/gcc/testsuite/gcc.target/powerpc/pr70117.c @@ -9,9 +9,11 @@ 128-bit floating point, because the type is not enabled on those systems. */ #define LDOUBLE __ibm128 +#define IBM128_MAX ((__ibm128) 1.79769313486231580793728971405301199e+308L) #elif defined(__LONG_DOUBLE_IBM128__) #define LDOUBLE long double +#define IBM128_MAX LDBL_MAX #else #error "long double must be either IBM 128-bit or IEEE 128-bit" @@ -75,10 +77,10 @@ main (void) if (__builtin_isnormal (ld)) __builtin_abort (); - ld = LDBL_MAX; + ld = IBM128_MAX; if (!__builtin_isnormal (ld)) __builtin_abort (); - ld = -LDBL_MAX; + ld = -IBM128_MAX; if (!__builtin_isnormal (ld)) __builtin_abort (); -- 2.22.0 -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meissner@linux.ibm.com, phone: +1 (978) 899-4797