From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27107 invoked by alias); 19 May 2013 18:38:40 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 27079 invoked by uid 48); 19 May 2013 18:38:37 -0000 From: "jsm28 at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug math/15491] New: x86 nearbyint implementations wrongly clear all exceptions Date: Sun, 19 May 2013 18:38:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jsm28 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-05/txt/msg00152.txt.bz2 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.