From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24748 invoked by alias); 1 Jun 2012 20:03:31 -0000 Received: (qmail 24739 invoked by uid 22791); 1 Jun 2012 20:03:28 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jun 2012 20:03:16 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1SaY43-0000uR-7C from joseph_myers@mentor.com for libc-ports@sourceware.org; Fri, 01 Jun 2012 13:03:15 -0700 Received: from digraph.polyomino.org.uk ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 1 Jun 2012 21:03:13 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.74) (envelope-from ) id 1SaY40-0003oE-6R for libc-ports@sourceware.org; Fri, 01 Jun 2012 20:03:12 +0000 Date: Fri, 01 Jun 2012 20:03:00 -0000 From: "Joseph S. Myers" To: libc-ports@sourceware.org Subject: Use dbl-64 fma for MIPS64 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00006.txt.bz2 On MIPS64, long double is always implemented in software - and currently this is fp-bit with no integration with hardware exceptions and rounding modes. Using the ldbl-128 implementation of (double) fma is thus both slow and not correctly rounding (since that implementation relies on rounding modes and exceptions); as on SPARC, it's better the use the dbl-64 implementation and ignore the existence of long double. I've applied this patch to do so, which gets clean results for test-float / test-double / test-ifloat / test-idouble (previously some fma tests failed to be correctly rounding). (For the soft-float MIPS64 case, I don't know which implementation would be faster - lack of rounding modes and exceptions means neither would be correctly rounding - but I don't see any real reason to make soft-float do something different from hard-float here until we have a generic fma implementation (bug 13304), at which point we can make hard-float use the dbl-64 code and soft-float use the new generic implementation.) diff --git a/ChangeLog.mips b/ChangeLog.mips index 5cd25e7..853f286 100644 --- a/ChangeLog.mips +++ b/ChangeLog.mips @@ -1,5 +1,8 @@ 2012-06-01 Joseph Myers + * sysdeps/mips/mips64/n32/s_fma.c: New file. + * sysdeps/mips/mips64/n64/s_fma.c: Likewise. + * sysdeps/unix/sysv/linux/mips/Makefile (abi-n32-condition): Fix typo. diff --git a/sysdeps/mips/mips64/n32/s_fma.c b/sysdeps/mips/mips64/n32/s_fma.c new file mode 100644 index 0000000..74a1e01 --- /dev/null +++ b/sysdeps/mips/mips64/n32/s_fma.c @@ -0,0 +1,6 @@ +/* MIPS long double is implemented in software by fp-bit (as of GCC + 4.7) without support for exceptions or rounding modes, so the fma + implementation in terms of long double is slow and will not produce + correctly rounding results. */ + +#include diff --git a/sysdeps/mips/mips64/n64/s_fma.c b/sysdeps/mips/mips64/n64/s_fma.c new file mode 100644 index 0000000..74a1e01 --- /dev/null +++ b/sysdeps/mips/mips64/n64/s_fma.c @@ -0,0 +1,6 @@ +/* MIPS long double is implemented in software by fp-bit (as of GCC + 4.7) without support for exceptions or rounding modes, so the fma + implementation in terms of long double is slow and will not produce + correctly rounding results. */ + +#include -- Joseph S. Myers joseph@codesourcery.com