public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/15268] New: Default SET_RESTORE_ROUND implementation hold exceptions
@ 2013-03-11 13:35 azanella at linux dot vnet.ibm.com
  2013-03-11 20:04 ` [Bug math/15268] " azanella at linux dot vnet.ibm.com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: azanella at linux dot vnet.ibm.com @ 2013-03-11 13:35 UTC (permalink / raw)
  To: glibc-bugs

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.


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

end of thread, other threads:[~2014-06-13 10:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-11 13:35 [Bug math/15268] New: Default SET_RESTORE_ROUND implementation hold exceptions azanella at linux dot vnet.ibm.com
2013-03-11 20:04 ` [Bug math/15268] " azanella at linux dot vnet.ibm.com
2013-12-03  0:36 ` [Bug math/15268] exp (-7.4444006192138124e+02) missing underflow jsm28 at gcc dot gnu.org
2013-12-03 21:50 ` cvs-commit at gcc dot gnu.org
2013-12-03 21:51 ` jsm28 at gcc dot gnu.org
2014-06-13 10:10 ` fweimer at redhat dot com

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).