public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/15491] New: x86 nearbyint implementations wrongly clear all exceptions
@ 2013-05-19 18:38 jsm28 at gcc dot gnu.org
  2014-02-06 18:33 ` [Bug math/15491] [i386/x86_64] " jsm28 at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2013-05-19 18:38 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=15491

             Bug #: 15491
           Summary: x86 nearbyint implementations wrongly clear all
                    exceptions
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jsm28@gcc.gnu.org
    Classification: Unclassified


The implementations of nearbyint functions using x87 floating point (x86 all
versions, x86_64 long double only) use the fclex instruction, which clears any
exceptions that were raised before the function was called.  These functions
must not clear exceptions that were raised before they were called.

I think fixing this will require saving and restoring the whole floating-point
environment as the way of avoiding raising "inexact" (which is what fesetenv
does, so use of frndint should still be faster than the C versions) - except
that if frndint raises an "invalid" exception for a sNaN operand, that *should*
be added into the restored environment.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-22 23:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-19 18:38 [Bug math/15491] New: x86 nearbyint implementations wrongly clear all exceptions jsm28 at gcc dot gnu.org
2014-02-06 18:33 ` [Bug math/15491] [i386/x86_64] " jsm28 at gcc dot gnu.org
2014-06-13 17:43 ` fweimer at redhat dot com
2015-10-22 23:16 ` cvs-commit at gcc dot gnu.org
2015-10-22 23:17 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).