From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1845 invoked by alias); 25 Jun 2013 16:45:37 -0000 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 Received: (qmail 1818 invoked by uid 89); 25 Jun 2013 16:45:35 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_SF autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 16:45:35 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UrWN2-0007T8-US from joseph_myers@mentor.com ; Tue, 25 Jun 2013 09:45:32 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 25 Jun 2013 09:45:33 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.2.247.3; Tue, 25 Jun 2013 17:45:31 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1UrWMz-0003q2-RF; Tue, 25 Jun 2013 16:45:29 +0000 Date: Tue, 25 Jun 2013 16:45:00 -0000 From: "Joseph S. Myers" To: Richard Henderson CC: , , Marcus Shawcroft , Richard Henderson , David Holsgrove , Chris Metcalf , "David S. Miller" Subject: Re: Implement fma in soft-fp In-Reply-To: <51C9C5F5.1070809@twiddle.net> Message-ID: References: <51C9C5F5.1070809@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-06/txt/msg00055.txt.bz2 On Tue, 25 Jun 2013, Richard Henderson wrote: > With the following patch, I get > > > testing long double (without inline functions) > > Failure: fma (0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, 0x1p-16494): Exception "Underflow" set > > Failure: fma (-0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, -0x1p-16494): Exception "Underflow" set > > Failure: fma (0x1p-16494, -0x1p-16494, 0x1p-16382): Exception "Underflow" set > > Failure: fma (0x1p-16494, 0x1p-16494, -0x1p-16382): Exception "Underflow" set > > Failure: fma_downward (-0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, -0x1p-16494): Exception "Underflow" set > > Failure: fma_downward (-0x1p-16494, 0x1.1p-1, -0x0.ffffffffffffffffffffffffffffp-16382): Exception "Underflow" set > > Failure: fma_downward (0x1p-16494, 0x1p-16494, -0x1p-16382): Exception "Underflow" set > > Failure: fma_upward (0x1.fffffffffffffffffffffffffffcp-16382, 0x1.0000000000000000000000000001p-1, 0x1p-16494): Exception "Underflow" set > > Failure: fma_upward (0x1p-16494, 0x1.1p-1, 0x0.ffffffffffffffffffffffffffffp-16382): Exception "Underflow" set > > Failure: fma_upward (0x1p-16494, -0x1p-16494, 0x1p-16382): Exception "Underflow" set > > but I thought you'd already committed the patch to solve this > as commit 695c378f81263640618bdebf56eaa065f578251f ? No, that fix was about incorrect results rather than exceptions. The above is what I was referring to about soft-fp not supporting after-rounding tininess detection. _FP_PACK_SEMIRAW and _FP_PACK_CANONICAL will need, for results whose before-rounding exponent is the largest underflowing exponent, to check some new soft-fp macro for after-rounding architectures and if it's true then determine whether the result would still underflow if rounded to the normal precision (*not* if rounded to the subnormal precision with one less bit, so this involves an extra trial rounding in a temporary variable to determine whether the result counts as tiny). See what stdlib/strtod_l.c does in round_and_return if (TININESS_AFTER_ROUNDING && shift == 1), for example. (But soft-fp would use its own macro definition from sfp-machine.h instead of the existing tininess.h since it's supposed to be usable outside glibc and independent of glibc internal headers.) MIPS is an after-rounding architecture but this issue doesn't cause test failures there because the testsuite knows not to test exceptions for MIPS software floating point (which uses fp-bit in libgcc), via math-tests.h. -- Joseph S. Myers joseph@codesourcery.com