From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 80073383B41F; Thu, 15 Apr 2021 17:18:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80073383B41F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work048)] Force IBM long double for conversion test on PowerPC. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work048 X-Git-Oldrev: 2e3abd8d3d1b834692f7cedf8744974aff8c3f53 X-Git-Newrev: f3a758ca8fc07fe3558743d7eeacfbf6ac21723f Message-Id: <20210415171821.80073383B41F@sourceware.org> Date: Thu, 15 Apr 2021 17:18:21 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2021 17:18:21 -0000 https://gcc.gnu.org/g:f3a758ca8fc07fe3558743d7eeacfbf6ac21723f commit f3a758ca8fc07fe3558743d7eeacfbf6ac21723f Author: Michael Meissner Date: Thu Apr 15 13:17:45 2021 -0400 Force IBM long double for conversion test on PowerPC. The test c-c++-common/dfp/convert-bfp-11.c explicit expects long double to use the IBM 128-bit extended double format. In particular, some of the tests expect an infinity to be created if decimal values that are converted that are too large for IBM extended double. However, the numbers do fit in the range for IEEE 128-bit format, since it has a larger exponent than the IBM 128-bit format. The test fails because an infinity is not generated. This patch explicitly sets the long double type to IBM extended double. I have run tests on a little endian power9 system with 3 compilers. There were no regressions with these patches, and the two tests in the following patches now work if the default long double is not IBM 128-bit: * One compiler using the default IBM 128-bit format; * One compiler using the IEEE 128-bit format; (and) * One compiler using 64-bit long doubles. I have also tested compilers on a big endian power8 system with a compiler defaulting to power8 code generation and another with the default cpu set. There were no regressions. Can I check this patch into the master branch? gcc/testsuite/ 2021-04-15 Michael Meissner * c-c++-common/dfp/convert-bfp-11.c: Force using IBM 128-bit long double. Remove check for 64-bit long double. Diff: --- gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 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..35da07d1fa4 100644 --- a/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c +++ b/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c @@ -1,9 +1,14 @@ -/* { dg-skip-if "" { ! "powerpc*-*-linux*" } } */ +/* { dg-require-effective-target dfp } */ +/* { dg-require-effective-target ppc_long_double_override_ibm128 } */ +/* { dg-add-options ppc_long_double_override_ibm128 } */ -/* Test decimal float conversions to and from IBM 128-bit long double. - Checks are skipped at runtime if long double is not 128 bits. - Don't force 128-bit long doubles because runtime support depends - on glibc. */ +/* We force the long double type to be IBM 128-bit because the CONVERT_TO_PINF + tests will fail if we use IEEE 128-bit floating point. This is due to IEEE + 128-bit having a larger exponent range than IBM 128-bit extended double. So + tests that would generate an infinity with IBM 128-bit will generate a + normal number with IEEE 128-bit. */ + +/* Test decimal float conversions to and from IBM 128-bit long double. */ #include "convert.h" @@ -36,9 +41,6 @@ CONVERT_TO_PINF (312, tf, sd, 1.6e+308L, d32) int main () { - if (sizeof (long double) != 16) - return 0; - convert_101 (); convert_102 ();