public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/3325] New: Implementation of fpmod should use fprem1, not fprem
@ 2006-10-09 17:52 jaredcasper at gmail dot com
  2006-10-09 17:53 ` [Bug math/3325] " jaredcasper at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jaredcasper at gmail dot com @ 2006-10-09 17:52 UTC (permalink / raw)
  To: glibc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

According to Vol 2A of the IA-32 Intel® Architecture Software Developer’s Manual
(http://download.intel.com/design/Pentium4/manuals/25366620.pdf) page 3-355, the
fprem1 instruction follows IEEE Std. 754, and the fprem instruction does not (it
is an old implementation they kept around for backward compatibility).   So it
seems like the __ieee754_fmod* instructions in sysdeps/i386/fpu/e_fmod* should
use fprem1, not fprem.

-- 
           Summary: Implementation of fpmod should use fprem1, not fprem
           Product: glibc
           Version: 2.3.6
            Status: NEW
          Severity: minor
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: jaredcasper at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com,jaredcasper at
                    gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug math/3325] Implementation of fpmod should use fprem1, not fprem
  2006-10-09 17:52 [Bug math/3325] New: Implementation of fpmod should use fprem1, not fprem jaredcasper at gmail dot com
@ 2006-10-09 17:53 ` jaredcasper at gmail dot com
  2007-02-18 13:22 ` aj at suse dot de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jaredcasper at gmail dot com @ 2006-10-09 17:53 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jaredcasper at gmail dot com  2006-10-09 17:53 -------
Created an attachment (id=1362)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1362&action=view)
Patch to switch from using fprem to fprem1


-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug math/3325] Implementation of fpmod should use fprem1, not fprem
  2006-10-09 17:52 [Bug math/3325] New: Implementation of fpmod should use fprem1, not fprem jaredcasper at gmail dot com
  2006-10-09 17:53 ` [Bug math/3325] " jaredcasper at gmail dot com
@ 2007-02-18 13:22 ` aj at suse dot de
  2007-02-19  5:49 ` drepper at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: aj at suse dot de @ 2007-02-18 13:22 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From aj at suse dot de  2007-02-18 13:22 -------
Uli, could you check this?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|aj at suse dot de           |drepper at redhat dot com
             Status|NEW                         |ASSIGNED


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug math/3325] Implementation of fpmod should use fprem1, not fprem
  2006-10-09 17:52 [Bug math/3325] New: Implementation of fpmod should use fprem1, not fprem jaredcasper at gmail dot com
  2006-10-09 17:53 ` [Bug math/3325] " jaredcasper at gmail dot com
  2007-02-18 13:22 ` aj at suse dot de
@ 2007-02-19  5:49 ` drepper at redhat dot com
  2007-02-21 19:52 ` jakub at redhat dot com
  2007-02-21 20:04 ` jakub at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: drepper at redhat dot com @ 2007-02-19  5:49 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-02-19 05:49 -------
The patch is on the cvs trunk now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug math/3325] Implementation of fpmod should use fprem1, not fprem
  2006-10-09 17:52 [Bug math/3325] New: Implementation of fpmod should use fprem1, not fprem jaredcasper at gmail dot com
                   ` (2 preceding siblings ...)
  2007-02-19  5:49 ` drepper at redhat dot com
@ 2007-02-21 19:52 ` jakub at redhat dot com
  2007-02-21 20:04 ` jakub at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at redhat dot com @ 2007-02-21 19:52 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2007-02-21 19:52 -------
Except that fmod{,f,l} as defined in ISO C99 and POSIX
requires the semantics that fprem provides.
E.g. ISO C99 in 7.12.10.1 says:
The fmod functions return the value x  - ny, for some integer n such that, if y
is nonzero, the result has the same sign as x and magnitude less than the
magnitude of y. If y is zero, whether a domain error occurs or the fmod
functions return zero is implementation-defined.
http://www.posix.nl/linuxassembly/nasmdochtml/nasmdoca.html
says fprem behaves exactly that way, while fprem1 rounds the division to nearest
and thus can return different sign of result from x, but result absolute value
won't be bigger than half of abs(y).
So, by changing fprem in fmod/fmodf/fmodl implementation to fprem1 you are
breaking e.g.
fmod (6.5, 2.25) which is supposed to return 2.0 (and was until now), while with
fprem1 it returns -0.25.

The patch has been reverted in CVS.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug math/3325] Implementation of fpmod should use fprem1, not fprem
  2006-10-09 17:52 [Bug math/3325] New: Implementation of fpmod should use fprem1, not fprem jaredcasper at gmail dot com
                   ` (3 preceding siblings ...)
  2007-02-21 19:52 ` jakub at redhat dot com
@ 2007-02-21 20:04 ` jakub at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at redhat dot com @ 2007-02-21 20:04 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2007-02-21 20:04 -------
Closing as invalid.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2007-02-21 20:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-09 17:52 [Bug math/3325] New: Implementation of fpmod should use fprem1, not fprem jaredcasper at gmail dot com
2006-10-09 17:53 ` [Bug math/3325] " jaredcasper at gmail dot com
2007-02-18 13:22 ` aj at suse dot de
2007-02-19  5:49 ` drepper at redhat dot com
2007-02-21 19:52 ` jakub at redhat dot com
2007-02-21 20:04 ` jakub 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).