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/16315] Bad overflowing pow results for directed rounding


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

--- Comment #3 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  4da6db51880289f0bf41b39e05cf9bb1c4769c47 (commit)
      from  5686b236cccdc8c72788b7996537ed92ac3a3c8c (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=4da6db51880289f0bf41b39e05cf9bb1c4769c47

commit 4da6db51880289f0bf41b39e05cf9bb1c4769c47
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Jun 23 20:12:33 2014 +0000

    Fix pow overflow in non-default rounding modes (bug 16315).

    This patch fixes bug 16315, bad pow handling of overflow/underflow in
    non-default rounding modes.  Tests of pow are duly converted to
    ALL_RM_TEST to run all tests in all rounding modes.

    There are two main issues here.  First, various implementations
    compute a negative result by negating a positive result, but this
    yields inappropriate overflow / underflow values for directed
    rounding, so either overflow / underflow results need recomputing in
    the correct sign, or the relevant overflowing / underflowing operation
    needs to be made to have a result of the correct sign.  Second, the
    dbl-64 implementation sets FE_TONEAREST internally; in the overflow /
    underflow case, the result needs recomputing in the original rounding
    mode.

    Tested x86_64 and x86 and ulps updated accordingly.

        [BZ #16315]
        * sysdeps/i386/fpu/e_pow.S (__ieee754_pow): Ensure possibly
        overflowing or underflowing operations take place with sign of
        result.
        * sysdeps/i386/fpu/e_powf.S (__ieee754_powf): Likewise.
        * sysdeps/i386/fpu/e_powl.S (__ieee754_powl): Likewise.
        * sysdeps/ieee754/dbl-64/e_pow.c: Include <math.h>.
        (__ieee754_pow): Recompute overflowing and underflowing results in
        original rounding mode.
        * sysdeps/x86/fpu/powl_helper.c: Include <stdbool.h>.
        (__powl_helper): Allow negative argument X and scale negated value
        as needed.  Avoid passing value outside [-1, 1] to f2xm1.
        * sysdeps/x86_64/fpu/e_powl.S (__ieee754_powl): Ensure possibly
        overflowing or underflowing operations take place with sign of
        result.
        * sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]:
        Include <math.h>.
        * math/auto-libm-test-in: Add more tests of pow.
        * math/auto-libm-test-out: Regenerated.
        * math/libm-test.inc (pow_test): Use ALL_RM_TEST.
        (pow_tonearest_test_data): Remove.
        (pow_test_tonearest): Likewise.
        (pow_towardzero_test_data): Likewise.
        (pow_test_towardzero): Likewise.
        (pow_downward_test_data): Likewise.
        (pow_test_downward): Likewise.
        (pow_upward_test_data): Likewise.
        (pow_test_upward): Likewise.
        (main): Don't call removed functions.
        * sysdeps/i386/fpu/libm-test-ulps: Update.
        * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.

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

Summary of changes:
 ChangeLog                            |   34 +
 NEWS                                 |   22 +-
 math/auto-libm-test-in               |   65 +
 math/auto-libm-test-out              | 2670 ++++++++++++++++++++++++++++++++++
 math/libm-test.inc                   |   68 +-
 sysdeps/i386/fpu/e_pow.S             |   50 +-
 sysdeps/i386/fpu/e_powf.S            |   12 +-
 sysdeps/i386/fpu/e_powl.S            |   78 +-
 sysdeps/i386/fpu/libm-test-ulps      |    8 +-
 sysdeps/ieee754/dbl-64/e_pow.c       |   61 +-
 sysdeps/x86/fpu/powl_helper.c        |   32 +-
 sysdeps/x86_64/fpu/e_powl.S          |   71 +-
 sysdeps/x86_64/fpu/libm-test-ulps    |   14 +-
 sysdeps/x86_64/fpu/multiarch/e_pow.c |    1 +
 14 files changed, 2953 insertions(+), 233 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]