public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/13304] New: fma, fmaf, fmal produce wrong results
@ 2011-10-17  2:02 bruno at clisp dot org
  2011-10-17  2:03 ` [Bug math/13304] " bruno at clisp dot org
                   ` (45 more replies)
  0 siblings, 46 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:02 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 13304
           Summary: fma, fmaf, fmal produce wrong results
           Product: glibc
           Version: 2.11
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: bruno@clisp.org
    Classification: Unclassified


Created attachment 5990
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5990
test suite for fma()

The functions fma(), fmaf(), fmal() are defined in POSIX:2008
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/fma.html>:

  "These functions shall compute (x * y) + z, rounded as one ternary operation:
   they shall compute the value (as if) to infinite precision and round once
   to the result format"

Find attached a test suite for fma(), easily adapted for fmaf() or fmal()
through a couple of #defines. I have checked this test suite by running it
against a slow but correct multi-precision implementation of fma().

This test suite gives
  - 7 failures for fma(),
  - 1 more failure for fmaf(),
  - 9 more failures for fmal(),
on a glibc 2.11.3 system where
  - fma() and fmaf() are implemented through a complex floating-point
    instruction rich code,
  - fmal() does just a x*y+z computation.

Find attached the bugs, each in a separate program, to be compiled and linked
with "-lm".

Feel free to add the test suite to glibc. I have a copyright assignment for
glibc on file, and am giving this file to the FSF.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
@ 2011-10-17  2:03 ` bruno at clisp dot org
  2011-10-17  2:05 ` bruno at clisp dot org
                   ` (44 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:03 UTC (permalink / raw)
  To: glibc-bugs

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

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-suse-linux-gnu
               Host|                            |x86_64-suse-linux-gnu
              Build|                            |x86_64-suse-linux-gnu

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
  2011-10-17  2:03 ` [Bug math/13304] " bruno at clisp dot org
  2011-10-17  2:05 ` bruno at clisp dot org
@ 2011-10-17  2:05 ` bruno at clisp dot org
  2011-10-17  2:05 ` bruno at clisp dot org
                   ` (42 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:05 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:04:57 UTC ---
Created attachment 5992
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5992
test case #2 for fma()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (2 preceding siblings ...)
  2011-10-17  2:05 ` bruno at clisp dot org
@ 2011-10-17  2:05 ` bruno at clisp dot org
  2011-10-17  2:06 ` bruno at clisp dot org
                   ` (41 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:05 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:05:34 UTC ---
Created attachment 5993
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5993
test case #3 for fma()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
  2011-10-17  2:03 ` [Bug math/13304] " bruno at clisp dot org
@ 2011-10-17  2:05 ` bruno at clisp dot org
  2011-10-17  2:05 ` bruno at clisp dot org
                   ` (43 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:05 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:04:29 UTC ---
Created attachment 5991
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5991
test case #1 for fma()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (3 preceding siblings ...)
  2011-10-17  2:05 ` bruno at clisp dot org
@ 2011-10-17  2:06 ` bruno at clisp dot org
  2011-10-17  2:06 ` bruno at clisp dot org
                   ` (40 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:06 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #5 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:06:32 UTC ---
Created attachment 5995
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5995
test case #5 for fma()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (4 preceding siblings ...)
  2011-10-17  2:06 ` bruno at clisp dot org
@ 2011-10-17  2:06 ` bruno at clisp dot org
  2011-10-17  2:07 ` bruno at clisp dot org
                   ` (39 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:06 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:06:07 UTC ---
Created attachment 5994
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5994
test case #4 for fma()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (5 preceding siblings ...)
  2011-10-17  2:06 ` bruno at clisp dot org
@ 2011-10-17  2:07 ` bruno at clisp dot org
  2011-10-17  2:08 ` bruno at clisp dot org
                   ` (38 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:07 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:07:01 UTC ---
Created attachment 5996
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5996
test case #6 for fma()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (6 preceding siblings ...)
  2011-10-17  2:07 ` bruno at clisp dot org
@ 2011-10-17  2:08 ` bruno at clisp dot org
  2011-10-17  2:08 ` bruno at clisp dot org
                   ` (37 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:08 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #7 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:07:30 UTC ---
Created attachment 5997
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5997
test case #7 for fmaf()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (7 preceding siblings ...)
  2011-10-17  2:08 ` bruno at clisp dot org
@ 2011-10-17  2:08 ` bruno at clisp dot org
  2011-10-17  2:08 ` bruno at clisp dot org
                   ` (36 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:08 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #9 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:08:21 UTC ---
Created attachment 5999
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5999
test case #9 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (8 preceding siblings ...)
  2011-10-17  2:08 ` bruno at clisp dot org
@ 2011-10-17  2:08 ` bruno at clisp dot org
  2011-10-17  2:09 ` bruno at clisp dot org
                   ` (35 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:08 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #8 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:07:53 UTC ---
Created attachment 5998
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5998
test case #8 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (9 preceding siblings ...)
  2011-10-17  2:08 ` bruno at clisp dot org
@ 2011-10-17  2:09 ` bruno at clisp dot org
  2011-10-17  2:10 ` bruno at clisp dot org
                   ` (34 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:09 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #10 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:08:47 UTC ---
Created attachment 6000
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6000
test case #10 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (11 preceding siblings ...)
  2011-10-17  2:10 ` bruno at clisp dot org
@ 2011-10-17  2:10 ` bruno at clisp dot org
  2011-10-17  2:11 ` bruno at clisp dot org
                   ` (32 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:10 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #11 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:09:09 UTC ---
Created attachment 6001
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6001
test case #11 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (10 preceding siblings ...)
  2011-10-17  2:09 ` bruno at clisp dot org
@ 2011-10-17  2:10 ` bruno at clisp dot org
  2011-10-17  2:10 ` bruno at clisp dot org
                   ` (33 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:10 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #12 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:09:33 UTC ---
Created attachment 6002
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6002
test case #12 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (12 preceding siblings ...)
  2011-10-17  2:10 ` bruno at clisp dot org
@ 2011-10-17  2:11 ` bruno at clisp dot org
  2011-10-17  2:11 ` bruno at clisp dot org
                   ` (31 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:11 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #13 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:10:02 UTC ---
Created attachment 6003
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6003
test case #13 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (15 preceding siblings ...)
  2011-10-17  2:11 ` bruno at clisp dot org
@ 2011-10-17  2:11 ` bruno at clisp dot org
  2011-10-17  5:54 ` jakub at redhat dot com
                   ` (28 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:11 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #14 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:10:29 UTC ---
Created attachment 6004
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6004
test case #14 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (13 preceding siblings ...)
  2011-10-17  2:11 ` bruno at clisp dot org
@ 2011-10-17  2:11 ` bruno at clisp dot org
  2011-10-17  2:11 ` bruno at clisp dot org
                   ` (30 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:11 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #16 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:11:16 UTC ---
Created attachment 6006
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6006
test case #16 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (14 preceding siblings ...)
  2011-10-17  2:11 ` bruno at clisp dot org
@ 2011-10-17  2:11 ` bruno at clisp dot org
  2011-10-17  2:11 ` bruno at clisp dot org
                   ` (29 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  2:11 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #15 from Bruno Haible <bruno at clisp dot org> 2011-10-17 02:10:52 UTC ---
Created attachment 6005
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6005
test case #15 for fmal()

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (16 preceding siblings ...)
  2011-10-17  2:11 ` bruno at clisp dot org
@ 2011-10-17  5:54 ` jakub at redhat dot com
  2011-10-17  7:19 ` aj at suse dot de
                   ` (27 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jakub at redhat dot com @ 2011-10-17  5:54 UTC (permalink / raw)
  To: glibc-bugs

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

Jakub Jelinek <jakub at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #17 from Jakub Jelinek <jakub at redhat dot com> 2011-10-17 05:54:21 UTC ---
glibc 2.11 is very old, fma{,f,l} has been rewritten for glibc 2.14+.  Please
test that instead.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (17 preceding siblings ...)
  2011-10-17  5:54 ` jakub at redhat dot com
@ 2011-10-17  7:19 ` aj at suse dot de
  2011-10-17  7:32 ` jakub at redhat dot com
                   ` (26 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: aj at suse dot de @ 2011-10-17  7:19 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Jaeger <aj at suse dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|aj at suse dot de           |jakub at redhat dot com

--- Comment #18 from Andreas Jaeger <aj at suse dot de> 2011-10-17 07:18:35 UTC ---
Jakub, the testsuite and the first two test fail for me on x86-64. The
testsuite fails on 32-bit x86 as well but the two first tests pass.

Test 1 on x86-64:
Expected: 0X1.0000000000001P+54
Actual:   0X1P+54

Test 2
Expected: 0X1.FFFFFFFFFFFFFP+53
Actual:   0X1P+54

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (18 preceding siblings ...)
  2011-10-17  7:19 ` aj at suse dot de
@ 2011-10-17  7:32 ` jakub at redhat dot com
  2011-10-17  8:24 ` aj at suse dot de
                   ` (25 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jakub at redhat dot com @ 2011-10-17  7:32 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #19 from Jakub Jelinek <jakub at redhat dot com> 2011-10-17 07:32:22 UTC ---
(In reply to comment #18)
> Jakub, the testsuite and the first two test fail for me on x86-64. The
> testsuite fails on 32-bit x86 as well but the two first tests pass.
> 
> Test 1 on x86-64:
> Expected: 0X1.0000000000001P+54
> Actual:   0X1P+54
> 
> Test 2
> Expected: 0X1.FFFFFFFFFFFFFP+53
> Actual:   0X1P+54

Neither fma-bug1.c nor fma-bug2.c fails for me (x86_64, glibc 2.14).

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (19 preceding siblings ...)
  2011-10-17  7:32 ` jakub at redhat dot com
@ 2011-10-17  8:24 ` aj at suse dot de
  2011-10-17  9:14 ` bruno at clisp dot org
                   ` (24 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: aj at suse dot de @ 2011-10-17  8:24 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Jaeger <aj at suse dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |aj at suse dot de
         Resolution|                            |FIXED

--- Comment #20 from Andreas Jaeger <aj at suse dot de> 2011-10-17 08:23:33 UTC ---
Indeed, works for me now as well after removing some buggy routines. Let's
close as Fixed for glibc 2.14+

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (20 preceding siblings ...)
  2011-10-17  8:24 ` aj at suse dot de
@ 2011-10-17  9:14 ` bruno at clisp dot org
  2011-10-17  9:28 ` jakub at redhat dot com
                   ` (23 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  9:14 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #21 from Bruno Haible <bruno at clisp dot org> 2011-10-17 09:14:27 UTC ---
Please add the first attachment to glibc's test suite.
I see 6 different implementations of fma(), 4 implementations of fmaf(),
and 4 implementations of fmal() in the glibc source code.
How can you guarantee that all of them are thoroughly tested?

The ones in math/s_fma.c, math/s_fmaf.c, math/s_fmal.c are definitely buggy.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (21 preceding siblings ...)
  2011-10-17  9:14 ` bruno at clisp dot org
@ 2011-10-17  9:28 ` jakub at redhat dot com
  2011-10-17  9:50 ` bruno at clisp dot org
                   ` (22 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jakub at redhat dot com @ 2011-10-17  9:28 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #22 from Jakub Jelinek <jakub at redhat dot com> 2011-10-17 09:27:50 UTC ---
I've done quite a lot of testing on it back when it was added to glibc, see
e.g. the
http://sources.redhat.com/ml/libc-alpha/2010-10/txt00000.txt
testcase (which has been tweaked for the other floating point formats (float,
80-bit long double, 128-bit long double).
Yes, math/s_fma*.c won't DTRT, they are just fallback implementations for
architectures without sufficient exception support (the real implementations
rely on exceptions working properly and various fenv.h functions being
available).

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (22 preceding siblings ...)
  2011-10-17  9:28 ` jakub at redhat dot com
@ 2011-10-17  9:50 ` bruno at clisp dot org
  2011-10-17  9:51 ` bruno at clisp dot org
                   ` (21 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  9:50 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #23 from Bruno Haible <bruno at clisp dot org> 2011-10-17 09:49:41 UTC ---
(In reply to comment #22)
> I've done quite a lot of testing on it back when it was added to glibc, see
> e.g. the
> http://sources.redhat.com/ml/libc-alpha/2010-10/txt00000.txt
> testcase

Good. It would be even better - for the quality of future modifications -
if a good unit test was in the glibc source tree. My proposed one runs in
less than a second and was able to catch 16 different bugs (and does not
need to link against mpfr or gmp).

> Yes, math/s_fma*.c won't DTRT, they are just fallback implementations for
> architectures without sufficient exception support

Find attached a code that produces the correct result also regardless of
exception support. Will soon be contributed to GNU gnulib. Should we replace
math/s_fma{,f,l}.c with this code (after some polishing for glibc coding
style)?

Bruno

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (23 preceding siblings ...)
  2011-10-17  9:50 ` bruno at clisp dot org
@ 2011-10-17  9:51 ` bruno at clisp dot org
  2011-10-17 12:20 ` jakub at redhat dot com
                   ` (20 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17  9:51 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #24 from Bruno Haible <bruno at clisp dot org> 2011-10-17 09:51:12 UTC ---
Created attachment 6008
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6008
portable implementation of fma(), fmaf(), fmal(), code written for gnulib

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (24 preceding siblings ...)
  2011-10-17  9:51 ` bruno at clisp dot org
@ 2011-10-17 12:20 ` jakub at redhat dot com
  2011-10-17 14:07 ` joseph at codesourcery dot com
                   ` (19 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jakub at redhat dot com @ 2011-10-17 12:20 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #25 from Jakub Jelinek <jakub at redhat dot com> 2011-10-17 12:19:24 UTC ---
I'll leave the decision whether to include the testcase into glibc or not to
Ulrich, I'm not involved with glibc these days too much.
And I'm not sure if there are any supported targets that do currently use
math/s_fma*.c.
BTW, your implementation will do the wrong thing if you call say
fma (DBL_MAX, DBL_MAX, -__builtin_inf (""));
will I think in your implementation return NaN, while it must be -Inf.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (25 preceding siblings ...)
  2011-10-17 12:20 ` jakub at redhat dot com
@ 2011-10-17 14:07 ` joseph at codesourcery dot com
  2011-10-17 20:10 ` bruno at clisp dot org
                   ` (18 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: joseph at codesourcery dot com @ 2011-10-17 14:07 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #26 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-10-17 14:07:21 UTC ---
Among libc targets, there is one that fails to build fma* at present for 
lack of rounding mode support (and not being configured to use the 
incorrect fallbacks): no-FPU SH.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (26 preceding siblings ...)
  2011-10-17 14:07 ` joseph at codesourcery dot com
@ 2011-10-17 20:10 ` bruno at clisp dot org
  2011-10-17 20:23 ` zimmerma+gcc at loria dot fr
                   ` (17 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17 20:10 UTC (permalink / raw)
  To: glibc-bugs

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

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |3268

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (27 preceding siblings ...)
  2011-10-17 20:10 ` bruno at clisp dot org
@ 2011-10-17 20:23 ` zimmerma+gcc at loria dot fr
  2011-10-17 22:36 ` vincent-srcware at vinc17 dot net
                   ` (16 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2011-10-17 20:23 UTC (permalink / raw)
  To: glibc-bugs

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

Paul Zimmermann <zimmerma+gcc at loria dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zimmerma+gcc at loria dot
                   |                            |fr

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (28 preceding siblings ...)
  2011-10-17 20:23 ` zimmerma+gcc at loria dot fr
@ 2011-10-17 22:36 ` vincent-srcware at vinc17 dot net
  2011-10-17 22:40 ` bruno at clisp dot org
                   ` (15 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: vincent-srcware at vinc17 dot net @ 2011-10-17 22:36 UTC (permalink / raw)
  To: glibc-bugs

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

Vincent Lefèvre <vincent-srcware at vinc17 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vincent-srcware at vinc17
                   |                            |dot net

--- Comment #27 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> 2011-10-17 22:36:24 UTC ---
Has it been tested in the directed rounding modes?

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (29 preceding siblings ...)
  2011-10-17 22:36 ` vincent-srcware at vinc17 dot net
@ 2011-10-17 22:40 ` bruno at clisp dot org
  2011-10-17 22:42 ` bruno at clisp dot org
                   ` (14 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17 22:40 UTC (permalink / raw)
  To: glibc-bugs

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

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5990|0                           |1
        is obsolete|                            |

--- Comment #28 from Bruno Haible <bruno at clisp dot org> 2011-10-17 22:39:55 UTC ---
Created attachment 6014
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6014
test suite for fma(), version 2

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (30 preceding siblings ...)
  2011-10-17 22:40 ` bruno at clisp dot org
@ 2011-10-17 22:42 ` bruno at clisp dot org
  2011-10-17 22:47 ` bruno at clisp dot org
                   ` (13 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17 22:42 UTC (permalink / raw)
  To: glibc-bugs

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

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6008|0                           |1
        is obsolete|                            |

--- Comment #29 from Bruno Haible <bruno at clisp dot org> 2011-10-17 22:41:26 UTC ---
Created attachment 6015
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6015
portable implementation of fma(), fmaf(), fmal(), code written for gnulib,
version 2

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (31 preceding siblings ...)
  2011-10-17 22:42 ` bruno at clisp dot org
@ 2011-10-17 22:47 ` bruno at clisp dot org
  2011-10-17 23:34 ` bruno at clisp dot org
                   ` (12 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17 22:47 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #30 from Bruno Haible <bruno at clisp dot org> 2011-10-17 22:46:41 UTC ---
(In reply to comment #25)
Jakub,

> your implementation will do the wrong thing if you call say
> fma (DBL_MAX, DBL_MAX, -__builtin_inf (""));
> will I think in your implementation return NaN, while it must be -Inf.

Good point, yes. I've updated the attached test suite to check this, and fixed
the attached implementation code. Thanks.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (32 preceding siblings ...)
  2011-10-17 22:47 ` bruno at clisp dot org
@ 2011-10-17 23:34 ` bruno at clisp dot org
  2011-10-18  7:24 ` aj at suse dot de
                   ` (11 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-17 23:34 UTC (permalink / raw)
  To: glibc-bugs

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

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6015|0                           |1
        is obsolete|                            |

--- Comment #31 from Bruno Haible <bruno at clisp dot org> 2011-10-17 23:33:34 UTC ---
Created attachment 6017
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6017
portable implementation of fma(), fmaf(), fmal(), code written for gnulib,
version 3

(In reply to comment #27)
> Has it been tested in the directed rounding modes?

A new version of the implementation code (attached) supports the 4 rounding
modes.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (33 preceding siblings ...)
  2011-10-17 23:34 ` bruno at clisp dot org
@ 2011-10-18  7:24 ` aj at suse dot de
  2011-10-18 16:40 ` bruno at clisp dot org
                   ` (10 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: aj at suse dot de @ 2011-10-18  7:24 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Jaeger <aj at suse dot de> changed:

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

--- Comment #32 from Andreas Jaeger <aj at suse dot de> 2011-10-18 07:21:36 UTC ---
Let's reopen to discuss and decide on adding the portable implementation to
glibc.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (34 preceding siblings ...)
  2011-10-18  7:24 ` aj at suse dot de
@ 2011-10-18 16:40 ` bruno at clisp dot org
  2012-02-26 17:46 ` jsm28 at gcc dot gnu.org
                   ` (9 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: bruno at clisp dot org @ 2011-10-18 16:40 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #33 from Bruno Haible <bruno at clisp dot org> 2011-10-18 16:39:45 UTC ---
Besides my implementation of a correct fma() on platforms without rounding mode
support,
there is also the one by Steven Munroe, in bug #3268:
http://sourceware.org/bugzilla/attachment.cgi?id=1664
http://sourceware.org/bugzilla/attachment.cgi?id=1665

I cannot judge whether the glibc maintainers will prefer one or the other.

I'm ready to convert the implementation code here to glibc style. Just let me
know.

Bruno

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (35 preceding siblings ...)
  2011-10-18 16:40 ` bruno at clisp dot org
@ 2012-02-26 17:46 ` jsm28 at gcc dot gnu.org
  2012-02-26 17:49 ` jsm28 at gcc dot gnu.org
                   ` (8 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-26 17:46 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|jakub at redhat dot com     |unassigned at sourceware
                   |                            |dot org

--- Comment #34 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-02-26 17:45:29 UTC ---
I think we should go with something like this version (but of course under
LGPLv2.1+ for glibc) for now - with the source file set up so the same file
(apart from license notices and space/tab differences) can be used in both
glibc and gnulib.

A soft-fp version might be faster - but the one in bug 3268 is not a clean
implementation using soft-fp (it relies on soft-fp knowing about a wider "quad"
floating-point type, rather than having an internal _FP_FMA operation that uses
more precision internally but without requiring a wider type).  So I think we
should use the portable implementation for math/s_fma{,f,l}.c for now.  If in
future there is a clean soft-fp implementation, that can then be used instead
(the portable version would still be useful for ldbl-128ibm - as I understand,
it will work as if that format uses a fixed 106 bit mantissa - unless and until
there is an implementation specific to that format).

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (36 preceding siblings ...)
  2012-02-26 17:46 ` jsm28 at gcc dot gnu.org
@ 2012-02-26 17:49 ` jsm28 at gcc dot gnu.org
  2012-09-27 20:08 ` law at redhat dot com
                   ` (7 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-26 17:49 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sjmunroe at us dot ibm.com

--- Comment #35 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-02-26 17:47:58 UTC ---
*** Bug 3268 has been marked as a duplicate of this bug. ***

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (37 preceding siblings ...)
  2012-02-26 17:49 ` jsm28 at gcc dot gnu.org
@ 2012-09-27 20:08 ` law at redhat dot com
  2012-09-27 20:26 ` joseph at codesourcery dot com
                   ` (6 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: law at redhat dot com @ 2012-09-27 20:08 UTC (permalink / raw)
  To: glibc-bugs


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

--- Comment #36 from law at redhat dot com 2012-09-27 20:07:54 UTC ---
Created attachment 6657
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6657
test case #17

fma (when using sysdeps/ieee754/dbl-64/s_fma.c) computes the wrong sign in some
cases, such as (0.0 * -1.0) + -0.0.

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (38 preceding siblings ...)
  2012-09-27 20:08 ` law at redhat dot com
@ 2012-09-27 20:26 ` joseph at codesourcery dot com
  2012-11-22 17:39 ` jsm28 at gcc dot gnu.org
                   ` (5 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: joseph at codesourcery dot com @ 2012-09-27 20:26 UTC (permalink / raw)
  To: glibc-bugs


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

--- Comment #37 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-09-27 20:26:02 UTC ---
On Thu, 27 Sep 2012, law at redhat dot com wrote:

> fma (when using sysdeps/ieee754/dbl-64/s_fma.c) computes the wrong sign in some
> cases, such as (0.0 * -1.0) + -0.0.

Please file a separate bug for this, and keep the present bug just for the 
need for a better fallback implementation (where we're hoping for Bruno to 
contribute a version of the gnulib code to glibc at some point).

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (39 preceding siblings ...)
  2012-09-27 20:26 ` joseph at codesourcery dot com
@ 2012-11-22 17:39 ` jsm28 at gcc dot gnu.org
  2013-12-17 14:23 ` jsm28 at gcc dot gnu.org
                   ` (4 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-11-22 17:39 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|x86_64-suse-linux-gnu       |
               Host|x86_64-suse-linux-gnu       |
              Build|x86_64-suse-linux-gnu       |

--- Comment #38 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-11-22 17:39:07 UTC ---
FWIW, the ldbl-128ibm version of fmal, which I think would better be replaced
by a generic version such as that discussed here (which would also be useful
for platforms without FE_INEXACT / FE_TOWARDZERO), not only is incorrect in
that it doesn't provide a fused operation, but also appears to produce results
that are actually invalid long double values, when in directed rounding modes,
e.g.:

Failure: Test: fma_towardzero (max_value, max_value, min_value) == max_value
Result:
 is:          1.79769313486231590772e+308   0x1.ffffffffffffffffffffp+1023
 should be:   1.79769313486231580793e+308   0x1.fffffffffffff7ffffffp+1023
 difference:  1.79769313486231550856e+308   0x1.ffffffffffffe0000000p+1023
 ulp       :  81129638414606663681390495662080.0000
 max.ulp   :  0.0000

(Such edges cases for ldbl-128ibm might end up as separate issues, but it
probably doesn't make sense to file such separate issues for them until fmal
for ldbl-128ibm is basically right, most likely through use of a generic
implementation.)

-- 
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] 47+ messages in thread

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (40 preceding siblings ...)
  2012-11-22 17:39 ` jsm28 at gcc dot gnu.org
@ 2013-12-17 14:23 ` jsm28 at gcc dot gnu.org
  2014-06-27 11:51 ` fweimer at redhat dot com
                   ` (3 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2013-12-17 14:23 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #40 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Remaining unfixed cases:

* ldbl-128ibm (needs its own implementation).

* AM33 (supports exceptions but only round-to-nearest), MicroBlaze, soft-float
ColdFire (all need to use the soft-fp implementation).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (41 preceding siblings ...)
  2013-12-17 14:23 ` jsm28 at gcc dot gnu.org
@ 2014-06-27 11:51 ` fweimer at redhat dot com
  2015-09-25 17:30 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  45 siblings, 0 replies; 47+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 11:51 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (42 preceding siblings ...)
  2014-06-27 11:51 ` fweimer at redhat dot com
@ 2015-09-25 17:30 ` cvs-commit at gcc dot gnu.org
  2015-09-25 17:32 ` cvs-commit at gcc dot gnu.org
  2015-09-25 17:35 ` jsm28 at gcc dot gnu.org
  45 siblings, 0 replies; 47+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-09-25 17:30 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #41 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  02c48b21b58ab810a7e7cd09e5b674567ba364de (commit)
      from  93bad7c97c7047ecaf7664859e2b49c0fe995443 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=02c48b21b58ab810a7e7cd09e5b674567ba364de

commit 02c48b21b58ab810a7e7cd09e5b674567ba364de
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Sep 25 17:29:19 2015 +0000

    Use soft-fp fma for MicroBlaze (bug 13304).

    Systems without floating-point exceptions and rounding modes should
    use the soft-fp versions of fmaf and fma, not the sysdeps/ieee754
    versions that rely on setting rounding to zero and testing for the
    "inexact" exception; this has been noted on
    <https://sourceware.org/glibc/wiki/PortStatus> for some time.  This
    patch makes MicroBlaze use the soft-fp files; sfp-machine.h is made to
    include the nios2 version of sfp-machine.h which seems sufficiently
    generic for 32-bit systems.

        [BZ #13304]
        * sysdeps/microblaze/s_fma.c: New file.
        * sysdeps/microblaze/s_fmaf.c: Likewise.
        * sysdeps/microblaze/sfp-machine.h: Likewise.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                              |    7 +++++++
 sysdeps/{nios2 => microblaze}/s_fma.c  |    0
 sysdeps/{nios2 => microblaze}/s_fmaf.c |    0
 sysdeps/microblaze/sfp-machine.h       |    1 +
 4 files changed, 8 insertions(+), 0 deletions(-)
 copy sysdeps/{nios2 => microblaze}/s_fma.c (100%)
 copy sysdeps/{nios2 => microblaze}/s_fmaf.c (100%)
 create mode 100644 sysdeps/microblaze/sfp-machine.h

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (43 preceding siblings ...)
  2015-09-25 17:30 ` cvs-commit at gcc dot gnu.org
@ 2015-09-25 17:32 ` cvs-commit at gcc dot gnu.org
  2015-09-25 17:35 ` jsm28 at gcc dot gnu.org
  45 siblings, 0 replies; 47+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-09-25 17:32 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #42 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  775e99641eca25a0dc9049253fe12b02c568f97a (commit)
      from  02c48b21b58ab810a7e7cd09e5b674567ba364de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=775e99641eca25a0dc9049253fe12b02c568f97a

commit 775e99641eca25a0dc9049253fe12b02c568f97a
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Sep 25 17:30:56 2015 +0000

    Use soft-fp fma for no-FPU ColdFire (bug 13304).

    Systems without floating-point exceptions and rounding modes should
    use the soft-fp versions of fmaf and fma, not the sysdeps/ieee754
    versions that rely on setting rounding to zero and testing for the
    "inexact" exception; this has been noted on
    <https://sourceware.org/glibc/wiki/PortStatus> for some time.  This
    patch makes no-FPU ColdFire use the soft-fp files; sfp-machine.h is
    made to include the nios2 version of sfp-machine.h which seems
    sufficiently generic for 32-bit systems.

        [BZ #13304]
        * sysdeps/m68k/coldfire/nofpu/s_fma.c: New file.
        * sysdeps/m68k/coldfire/nofpu/s_fmaf.c: Likewise.
        * sysdeps/m68k/coldfire/nofpu/sfp-machine.h: Likewise.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |    5 +++++
 .../{microblaze => m68k/coldfire/nofpu}/s_fma.c    |    0
 .../{microblaze => m68k/coldfire/nofpu}/s_fmaf.c   |    0
 .../coldfire/nofpu}/sfp-machine.h                  |    0
 4 files changed, 5 insertions(+), 0 deletions(-)
 copy sysdeps/{microblaze => m68k/coldfire/nofpu}/s_fma.c (100%)
 copy sysdeps/{microblaze => m68k/coldfire/nofpu}/s_fmaf.c (100%)
 copy sysdeps/{microblaze => m68k/coldfire/nofpu}/sfp-machine.h (100%)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug math/13304] fma, fmaf, fmal produce wrong results
  2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
                   ` (44 preceding siblings ...)
  2015-09-25 17:32 ` cvs-commit at gcc dot gnu.org
@ 2015-09-25 17:35 ` jsm28 at gcc dot gnu.org
  45 siblings, 0 replies; 47+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-09-25 17:35 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #43 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
The sole remaining case without an appropriate implementation available is
ldbl-128ibm (needs its own implementation).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2015-09-25 17:35 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17  2:02 [Bug math/13304] New: fma, fmaf, fmal produce wrong results bruno at clisp dot org
2011-10-17  2:03 ` [Bug math/13304] " bruno at clisp dot org
2011-10-17  2:05 ` bruno at clisp dot org
2011-10-17  2:05 ` bruno at clisp dot org
2011-10-17  2:05 ` bruno at clisp dot org
2011-10-17  2:06 ` bruno at clisp dot org
2011-10-17  2:06 ` bruno at clisp dot org
2011-10-17  2:07 ` bruno at clisp dot org
2011-10-17  2:08 ` bruno at clisp dot org
2011-10-17  2:08 ` bruno at clisp dot org
2011-10-17  2:08 ` bruno at clisp dot org
2011-10-17  2:09 ` bruno at clisp dot org
2011-10-17  2:10 ` bruno at clisp dot org
2011-10-17  2:10 ` bruno at clisp dot org
2011-10-17  2:11 ` bruno at clisp dot org
2011-10-17  2:11 ` bruno at clisp dot org
2011-10-17  2:11 ` bruno at clisp dot org
2011-10-17  2:11 ` bruno at clisp dot org
2011-10-17  5:54 ` jakub at redhat dot com
2011-10-17  7:19 ` aj at suse dot de
2011-10-17  7:32 ` jakub at redhat dot com
2011-10-17  8:24 ` aj at suse dot de
2011-10-17  9:14 ` bruno at clisp dot org
2011-10-17  9:28 ` jakub at redhat dot com
2011-10-17  9:50 ` bruno at clisp dot org
2011-10-17  9:51 ` bruno at clisp dot org
2011-10-17 12:20 ` jakub at redhat dot com
2011-10-17 14:07 ` joseph at codesourcery dot com
2011-10-17 20:10 ` bruno at clisp dot org
2011-10-17 20:23 ` zimmerma+gcc at loria dot fr
2011-10-17 22:36 ` vincent-srcware at vinc17 dot net
2011-10-17 22:40 ` bruno at clisp dot org
2011-10-17 22:42 ` bruno at clisp dot org
2011-10-17 22:47 ` bruno at clisp dot org
2011-10-17 23:34 ` bruno at clisp dot org
2011-10-18  7:24 ` aj at suse dot de
2011-10-18 16:40 ` bruno at clisp dot org
2012-02-26 17:46 ` jsm28 at gcc dot gnu.org
2012-02-26 17:49 ` jsm28 at gcc dot gnu.org
2012-09-27 20:08 ` law at redhat dot com
2012-09-27 20:26 ` joseph at codesourcery dot com
2012-11-22 17:39 ` jsm28 at gcc dot gnu.org
2013-12-17 14:23 ` jsm28 at gcc dot gnu.org
2014-06-27 11:51 ` fweimer at redhat dot com
2015-09-25 17:30 ` cvs-commit at gcc dot gnu.org
2015-09-25 17:32 ` cvs-commit at gcc dot gnu.org
2015-09-25 17:35 ` jsm28 at gcc dot gnu.org

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