From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27617 invoked by alias); 11 Mar 2013 13:35:50 -0000 Received: (qmail 25264 invoked by uid 48); 11 Mar 2013 13:35:23 -0000 From: "azanella at linux dot vnet.ibm.com" To: glibc-bugs@sourceware.org Subject: [Bug math/15268] New: Default SET_RESTORE_ROUND implementation hold exceptions Date: Mon, 11 Mar 2013 13:35: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: azanella at linux dot vnet.ibm.com 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 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 X-SW-Source: 2013-03/txt/msg00051.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15268 Bug #: 15268 Summary: Default SET_RESTORE_ROUND implementation hold exceptions Product: glibc Version: 2.18 Status: NEW Severity: normal Priority: P2 Component: math AssignedTo: unassigned@sourceware.org ReportedBy: azanella@linux.vnet.ibm.com Classification: Unclassified While debugging why exp (-7.4444006192138124e+02) does *not* generate an underflow exception on PowerPC and does on i32/x86_64 I found the issue is related on how the rounding mode is being set on the two architectures. The rounding mode is set using the macro SET_RESTORE_ROUND: #define SET_RESTORE_ROUND(RM) \ fenv_t __libc_save_rm __attribute__((cleanup(libc_feresetround))); \ libc_feholdsetround (&__libc_save_rm, (RM)) And libc_feresetround and libc_feholdsetround could be redefined depending on the architecture. For SSE2 or higher on i32/x86_64 it will be redefined to libc_feresetround_sse and this function only sets the rounding mode, not changing any behavior on how the FP exception are being generated. The issue is for PowerPC the default implementation default_libc_feholdexcept_setround is being used and the function set the rounding mode *and* hold any FP exception. This make the exp underflow exception to be generate but ignored on PowerPC. So SET_RESTORE_ROUND generic implementation does not really follow what it proposes: I believe the correct implementation would be *just* set the rounding mode and not touch any FP exceptions behavior. The macro SET_RESTORE_ROUND_NOEX handles the case where FP exception may be ignored. -- 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.