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 4578C386F001 for ; Thu, 22 Oct 2020 22:07:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4578C386F001 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09MM2For020226; Thu, 22 Oct 2020 18:07:20 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34ba2gs3jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 18:07:20 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 09MM4FYg029640; Thu, 22 Oct 2020 18:07:20 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 34ba2gs3h2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 18:07:19 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09MM6w8O001938; Thu, 22 Oct 2020 22:07:18 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma01dal.us.ibm.com with ESMTP id 34bhyq88fg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 22:07:18 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09MM7BrB24117536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Oct 2020 22:07:11 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6D577805E; Thu, 22 Oct 2020 22:07:16 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 043027805C; Thu, 22 Oct 2020 22:07:15 +0000 (GMT) Received: from ibm-toto.the-meissners.org (unknown [9.160.70.240]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTPS; Thu, 22 Oct 2020 22:07:15 +0000 (GMT) Date: Thu, 22 Oct 2020 18:07:14 -0400 From: Michael Meissner To: gcc-patches@gcc.gnu.org, Michael Meissner , Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Jeff Law , Jonathan Wakely Subject: PowerPC: Update long double IEEE 128-bit tests. Message-ID: <20201022220714.GA11800@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 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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.737 definitions=2020-10-22_17:2020-10-20, 2020-10-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 priorityscore=1501 adultscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010220136 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, RCVD_IN_DNSWL_NONE, 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, 22 Oct 2020 22:07:22 -0000 PowerPC: Update long double IEEE 128-bit tests. I have split all of these patches into separate patches to hopefully get them into the tree. This patch fixes 3 tests in the testsuite that fail if long double is set to IEEE 128-bit. I have tested this patch with bootstrap builds on a little endian power9 system running Linux. With the other patches, I have built two full bootstrap builds using this patch and the patches after this patch. One build used the current default for long double (IBM extended double) and the other build switched the default to IEEE 128-bit. I used the Advance Toolchain AT 14.0 compiler as the library used by this compiler. There are no regressions between the tests. There are 3 fortran benchmarks (ieee/large_2.f90, default_format_2.f90, and default_format_denormal_2.f90) that now pass. Can I install this into the trunk? We have gotten some requests to back port these changes to GCC 10.x. At the moment, I am not planning to do the back port, but I may need to in the future. gcc/testsuite/ 2020-10-22 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