This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/20916] pow handling of sNaN arguments


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

--- Comment #2 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  a91fd168a0db38563528dab1a13180fda2a5040c (commit)
      from  ca6e601a9d4a72b3699cca15bad12ac1716bf49a (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=a91fd168a0db38563528dab1a13180fda2a5040c

commit a91fd168a0db38563528dab1a13180fda2a5040c
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Dec 6 00:33:19 2016 +0000

    Fix x86_64/x86 powl handling of sNaN arguments (bug 20916).

    The x86_64/x86 powl implementations mishandle sNaN arguments, both by
    returning sNaN in some cases (instead of doing arithmetic on the
    arguments to produce the result when NaN arguments result in NaN
    results) and by treating sNaN the same as qNaN for arguments (1, sNaN)
    and (sNaN, 0), contrary to TS 18661-1 which requires those cases to
    return qNaN instead of 1.

    This patch makes the x86_64/x86 powl implementations follow TS 18661-1
    semantics for sNaN arguments; sNaN tests are also added for pow.
    Given the problems with testing float and double sNaN arguments on
    32-bit x86 (sNaN tests disabled because the compiler may convert
    unnecessarily to a qNaN when passing arguments), no changes are made
    to the powf and pow implementations there.

    Tested for x86_64 and x86.

        [BZ #20916]
        * sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Do not return 1 for
        arguments (sNaN, 0) or (1, sNaN).  Do arithmetic on NaN arguments
        to compute result.
        * sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Likewise.
        * math/libm-test.inc (pow_test_data): Add tests of sNaN arguments.

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

Summary of changes:
 ChangeLog                   |    9 +++++++
 math/libm-test.inc          |   54 ++++++++++++++++++++++++++++++++++++++++++-
 sysdeps/i386/fpu/e_powl.S   |   29 +++++++++++++++++++----
 sysdeps/x86_64/fpu/e_powl.S |   27 ++++++++++++++++++---
 4 files changed, 109 insertions(+), 10 deletions(-)

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]