This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/13304] fma, fmaf, fmal produce wrong results
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 19 May 2016 20:11:59 +0000
- Subject: [Bug math/13304] fma, fmaf, fmal produce wrong results
- Auto-submitted: auto-generated
- References: <bug-13304-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=13304
--- Comment #45 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 ffe9aaf2b9b7e297924b9fcf76ad854e6b97869b (commit)
from de71e0421b4e267f9b6cf5a827ee5bab70226cd9 (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=ffe9aaf2b9b7e297924b9fcf76ad854e6b97869b
commit ffe9aaf2b9b7e297924b9fcf76ad854e6b97869b
Author: Joseph Myers <joseph@codesourcery.com>
Date: Thu May 19 20:10:56 2016 +0000
Implement proper fmal for ldbl-128ibm (bug 13304).
ldbl-128ibm had an implementation of fmal that just did (x * y) + z in
most cases, with no attempt at actually being a fused operation.
This patch replaces it with a genuine fused operation. It is not
necessarily correctly rounding, but should produce a result at least
as accurate as the long double arithmetic operations in libgcc, which
I think is all that can reasonably be expected for such a non-IEEE
format where arithmetic is approximate rather than rounded according
to any particular rule for determining the exact result. Like the
libgcc arithmetic, it may produce spurious overflow and underflow
results, and it falls back to the libgcc multiplication in the case of
(finite, finite, zero).
This concludes the fixes for bug 13304; any subsequently found fma
issues should go in separate Bugzilla bugs. Various other pieces of
bug 13304 were fixed in past releases over the past several years.
Tested for powerpc.
[BZ #13304]
* sysdeps/ieee754/ldbl-128ibm/s_fmal.c: Include <fenv.h>,
<float.h>, <math_private.h> and <stdlib.h>.
(add_split): New function.
(mul_split): Likewise.
(ext_val): New typedef.
(store_ext_val): New function.
(mul_ext_val): New function.
(compare): New function.
(add_split_ext): New function.
(__fmal): After checking for Inf, NaN and zero, compute result as
an exact sum of scaled double values in round-to-nearest before
adding those up and adjusting for other rounding modes.
* math/auto-libm-test-in: Remove xfail-rounding:ldbl-128ibm from
tests of fma.
* math/auto-libm-test-out: Regenerated.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 19 +
math/auto-libm-test-in | 17 +-
math/auto-libm-test-out |12256 +++++++++++++++++-----------------
sysdeps/ieee754/ldbl-128ibm/s_fmal.c | 260 +-
4 files changed, 6404 insertions(+), 6148 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.