public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/17907] New: fma modifies and does not reset SSE rounding mode on 32bit machines
@ 2015-01-30 11:59 simonbyrne at gmail dot com
  2015-01-30 14:55 ` [Bug math/17907] " simonbyrne at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: simonbyrne at gmail dot com @ 2015-01-30 11:59 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17907

            Bug ID: 17907
           Summary: fma modifies and does not reset SSE rounding mode on
                    32bit machines
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: simonbyrne at gmail dot com

Created attachment 8091
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8091&action=edit
fma rounding mode test function

The software fma function modifies the rounding mode for SSE floating point
instructions (to round-toward-zero), but does not reset it correctly, on 32bit
(686) processors. The x87 rounding mode is unaffected.

Attached is a sample program: compile on a 32bit machine with gcc:

$ gcc fmacheck.c -o fmacheck -lm -msse2 -mfpmath=sse

or clang:

$ clang fmacheck.c -o fmacheck -lm

When run as

$ ./fmacheck 0x1.0000000000001p+0

it should give
0x1.ffffffffffffep-1
if rounding mode is the default (round-to-nearest). If the rounding mode has
been incorrectly modified to be round-toward-zero, then you will get
0x1.ffffffffffffdp-1

-- 
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-01-30 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-30 11:59 [Bug math/17907] New: fma modifies and does not reset SSE rounding mode on 32bit machines simonbyrne at gmail dot com
2015-01-30 14:55 ` [Bug math/17907] " simonbyrne at gmail dot com
2015-01-30 15:14 ` jsm28 at gcc dot gnu.org
2015-01-30 15:22 ` joseph at codesourcery dot com
2015-01-30 16:15 ` simonbyrne at gmail 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).