public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390
@ 2014-01-10 10:22 krebbel1 at de dot ibm.com
  2014-01-10 14:04 ` [Bug libc/16427] " joseph at codesourcery dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-01-10 10:22 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16427
           Summary: test-ldouble and test-ildoubl fail on S/390
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: krebbel1 at de dot ibm.com
                CC: drepper.fsp at gmail dot com

Even after regenerating ULPs test-ldouble and test-ildoubl keep failing.

This worked with glibc 2.14 and fails with 2.17. It still fails with 2.19. I'll
try to start some more tests in order to narrow it down.

testing long double (without inline functions)
Failure: Test: exp_towardzero (0x1.86ap+16)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_towardzero (0xf.ffffffffffff8p+1020)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_towardzero (0xf.ffffffffffffbffffffffffffcp+1020)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_towardzero (0xf.fffffffffffffffffffffffffff8p+16380)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_towardzero (0xf.fffffffffffffffp+16380)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_towardzero (0xf.fffffp+124)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_downward (0x1.86ap+16)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_downward (0xf.ffffffffffff8p+1020)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_downward (0xf.ffffffffffffbffffffffffffcp+1020)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_downward (0xf.fffffffffffffffffffffffffff8p+16380)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_downward (0xf.fffffffffffffffp+16380)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: exp_downward (0xf.fffffp+124)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: expm1_towardzero (0x1.86ap+16)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: expm1_towardzero (0xf.ffffffffffff8p+1020)
Result:
 is:          inf   inf
 should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383
Failure: Test: expm1_towardzero (0xf.ffffffffffffbffffffffffffcp+1020)

...

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


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

* [Bug libc/16427] test-ldouble and test-ildoubl fail on S/390
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
@ 2014-01-10 14:04 ` joseph at codesourcery dot com
  2014-01-10 15:08 ` [Bug math/16427] ldbl-128 exp overflows to inf krebbel1 at de dot ibm.com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: joseph at codesourcery dot com @ 2014-01-10 14:04 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Fri, 10 Jan 2014, krebbel1 at de dot ibm.com wrote:

> Failure: Test: exp_towardzero (0x1.86ap+16)
> Result:
>  is:          inf   inf
>  should be:   1.18973149535723176508e+4932   0x1.ffffffffffffffffffffp+16383

Overflow of exp in directed rounding modes is bug 16284.  It would also be 
reasonable to have a separate bug for the ldbl-128 case and keep 16284 for 
dbl-64 only, but please name it something referring to ldbl-128 exp in 
that case, and avoid omnibus bugs like "test-ldouble and test-ildoubl 
fail", preferring bugs relating to specific failures of specific functions 
that describe what the issue is for glibc users (i.e. a given function 
does something wrong) rather than in developer terms (a given testcase 
fails).  (Such bugs should also be component "math".)

Given a properly specific bug in component "math", then mark the problem 
tests with xfail-rounding:ldbl-128 and a comment referring to the bug in 
question.

> Failure: Test: expm1_towardzero (0x1.86ap+16)

expm1 overflow failure is just a consequence of exp failure, so the same 
bug.

If there are other functions with bad results not a consequence of this 
exp bug, please file separate bugs for them that identify the specific 
functions concerned.

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
  2014-01-10 14:04 ` [Bug libc/16427] " joseph at codesourcery dot com
@ 2014-01-10 15:08 ` krebbel1 at de dot ibm.com
  2014-01-10 17:47 ` joseph at codesourcery dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-01-10 15:08 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Krebbel <krebbel1 at de dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |s390x-ibm-linux
          Component|libc                        |math
               Host|                            |s390x-ibm-linux
            Version|2.17                        |2.16
            Summary|test-ldouble and            |ldbl-128 exp overflows to
                   |test-ildoubl fail on S/390  |inf
              Build|                            |s390x-ibm-linux

--- Comment #2 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
On S/390 the testcase starts failing with that commit:

commit 2a8ab7f26591053136bc17be34499db5c64e89d6
Author: David S. Miller <davem@davemloft.net>
Date:   Tue Mar 13 00:31:48 2012 -0700

    Fix generic ldbl-128 expm1l just like x86-64 and i386 variants were.

        * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Use expl for
        large parameters.

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
  2014-01-10 14:04 ` [Bug libc/16427] " joseph at codesourcery dot com
  2014-01-10 15:08 ` [Bug math/16427] ldbl-128 exp overflows to inf krebbel1 at de dot ibm.com
@ 2014-01-10 17:47 ` joseph at codesourcery dot com
  2014-01-13 13:28 ` krebbel1 at de dot ibm.com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: joseph at codesourcery dot com @ 2014-01-10 17:47 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Note that I don't see how the ldbl-128 exp would actually have this 
problem.  The code for overflow looks quite straightforward: for x above 
himark, it just does:

    return TWO16383*x;

That should produce a value rounded appropriately for the current rounding 
mode.  Could you confirm if the call to expl with a large argument in 
FE_DOWNWARD or FE_TOWARDZERO mode does indeed reach that code, and what 
value that code produces?  Could you confirm also if the multiplication is 
using a hardware instruction, software floating point in glibc, or 
software floating point in libgcc?  If a hardware instruction, is it 
implemented in hardware, or Linux kernel emulation?

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (2 preceding siblings ...)
  2014-01-10 17:47 ` joseph at codesourcery dot com
@ 2014-01-13 13:28 ` krebbel1 at de dot ibm.com
  2014-01-13 13:30 ` krebbel1 at de dot ibm.com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-01-13 13:28 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
The code path in __ieee_expl reaches the statement:

return TWO16383*x;

The multiplication is performed using the mxbr hardware instruction dealing
with FPR register pairs.

At the end of the function the expected results were generated and can be
printed correctly:

=> 0x3fffdf6117a <__ieee754_expl+78>:   mxbr    %f8,%f1
(gdb) 
0x000003fffdf6117e      247         return TWO16383*x;
1: x/i $pc
=> 0x3fffdf6117e <__ieee754_expl+82>:   std     %f8,0(%r8)
(gdb) p printf ("%Le %La\n", &{$f8, $f10}, &{$f8, $f10})
1.189731e+4932 0x1.ffffffffffffffffffffffffffffp+16383

long double values are returned in memory, pointed to by r2:

=> 0x3fffdf611a0 <__ieee754_expl+116>:  lmg     %r8,%r15,320(%r15)
(gdb) x/4xw $r2
0x3ffffffef78:  0x7ffeffff      0xffffffff      0xffffffff      0xffffffff
(gdb) p printf ("%Le %La\n", $r2, $r2)
1.189731e+4932 0x1.ffffffffffffffffffffffffffffp+16383
$12 = 55

The code in k_standard.c:211 then seems to turn the value into "inf":

        case 206:
        /* exp(finite) overflow */
        exc.type = OVERFLOW;
        exc.name = type < 100 ? "exp" : (type < 200
                         ? "expf" : "expl");
        if (_LIB_VERSION == _SVID_)
          exc.retval = HUGE;
        else
          exc.retval = HUGE_VAL;
        if (_LIB_VERSION == _POSIX_)
          __set_errno (ERANGE);
        else if (!matherr(&exc)) {
            __set_errno (ERANGE);
        }
        break;

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (3 preceding siblings ...)
  2014-01-13 13:28 ` krebbel1 at de dot ibm.com
@ 2014-01-13 13:30 ` krebbel1 at de dot ibm.com
  2014-01-13 14:32 ` krebbel1 at de dot ibm.com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-01-13 13:30 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #5 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
The bug appears to be that __kernel_standard ... is called at all. S/390 is
IEEE complaint and as such the if(_LIB_VERSION == _IEEE_) return z; should
return before going into the non-IEEE routines.

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (4 preceding siblings ...)
  2014-01-13 13:30 ` krebbel1 at de dot ibm.com
@ 2014-01-13 14:32 ` krebbel1 at de dot ibm.com
  2014-01-13 15:54 ` joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-01-13 14:32 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
To me it looks like that the sysdeps/ieee754/ldbl-128/w_expl.c file also needs
the changes Joseph did for sysdeps/ieee754/ldbl-96/w_expl.c with:

https://sourceware.org/ml/libc-alpha/2012-05/msg00185.html

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (5 preceding siblings ...)
  2014-01-13 14:32 ` krebbel1 at de dot ibm.com
@ 2014-01-13 15:54 ` joseph at codesourcery dot com
  2014-01-15  8:51 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: joseph at codesourcery dot com @ 2014-01-13 15:54 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #7 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Mon, 13 Jan 2014, krebbel1 at de dot ibm.com wrote:

> To me it looks like that the sysdeps/ieee754/ldbl-128/w_expl.c file also needs
> the changes Joseph did for sysdeps/ieee754/ldbl-96/w_expl.c with:
> 
> https://sourceware.org/ml/libc-alpha/2012-05/msg00185.html

Right - calling __kernel_standard* won't produce appropriate results in 
directed rounding modes, so checking thresholds and calling it based on 
that, rather than checking the result of the underlying function, is 
suspect.

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (6 preceding siblings ...)
  2014-01-13 15:54 ` joseph at codesourcery dot com
@ 2014-01-15  8:51 ` cvs-commit at gcc dot gnu.org
  2014-02-25  8:18 ` krebbel1 at de dot ibm.com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-01-15  8:51 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #8 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  7beb48cbb77ef32135a07b429838521a0c181377 (commit)
       via  c20d5bf50991d6c4e396f27612ad379214120c48 (commit)
      from  2f10c4d6901e7a4c4ad294cc5bb8ece6547f4f62 (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=7beb48cbb77ef32135a07b429838521a0c181377

commit 7beb48cbb77ef32135a07b429838521a0c181377
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date:   Wed Jan 15 09:50:31 2014 +0100

    [BZ #16427] Fix ldbl-128 exp overflows.

    Invoke the non-IEEE handling only for numbers special also in the IEEE
    case.  This aligns the exp handling with the other ldbl variants.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c20d5bf50991d6c4e396f27612ad379214120c48

commit c20d5bf50991d6c4e396f27612ad379214120c48
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date:   Wed Jan 15 09:49:54 2014 +0100

    S/390: Regenerate ULPs.

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

Summary of changes:
 ChangeLog                         |   10 +
 sysdeps/ieee754/ldbl-128/w_expl.c |   18 +-
 sysdeps/s390/fpu/libm-test-ulps   |11099 +++++++++++++++++++++++++++++++++----
 3 files changed, 9975 insertions(+), 1152 deletions(-)

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (7 preceding siblings ...)
  2014-01-15  8:51 ` cvs-commit at gcc dot gnu.org
@ 2014-02-25  8:18 ` krebbel1 at de dot ibm.com
  2014-02-25  8:19 ` krebbel1 at de dot ibm.com
  2014-06-13  9:05 ` fweimer at redhat dot com
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-02-25  8:18 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Krebbel <krebbel1 at de dot ibm.com> changed:

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

--- Comment #10 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
Fixed - see comment 8

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (8 preceding siblings ...)
  2014-02-25  8:18 ` krebbel1 at de dot ibm.com
@ 2014-02-25  8:19 ` krebbel1 at de dot ibm.com
  2014-06-13  9:05 ` fweimer at redhat dot com
  10 siblings, 0 replies; 12+ messages in thread
From: krebbel1 at de dot ibm.com @ 2014-02-25  8:19 UTC (permalink / raw)
  To: glibc-bugs

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

Andreas Krebbel <krebbel1 at de dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

--- Comment #11 from Andreas Krebbel <krebbel1 at de dot ibm.com> ---
Closed.

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


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

* [Bug math/16427] ldbl-128 exp overflows to inf
  2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
                   ` (9 preceding siblings ...)
  2014-02-25  8:19 ` krebbel1 at de dot ibm.com
@ 2014-06-13  9:05 ` fweimer at redhat dot com
  10 siblings, 0 replies; 12+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13  9:05 UTC (permalink / raw)
  To: glibc-bugs

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

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

end of thread, other threads:[~2014-06-13  9:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-10 10:22 [Bug libc/16427] New: test-ldouble and test-ildoubl fail on S/390 krebbel1 at de dot ibm.com
2014-01-10 14:04 ` [Bug libc/16427] " joseph at codesourcery dot com
2014-01-10 15:08 ` [Bug math/16427] ldbl-128 exp overflows to inf krebbel1 at de dot ibm.com
2014-01-10 17:47 ` joseph at codesourcery dot com
2014-01-13 13:28 ` krebbel1 at de dot ibm.com
2014-01-13 13:30 ` krebbel1 at de dot ibm.com
2014-01-13 14:32 ` krebbel1 at de dot ibm.com
2014-01-13 15:54 ` joseph at codesourcery dot com
2014-01-15  8:51 ` cvs-commit at gcc dot gnu.org
2014-02-25  8:18 ` krebbel1 at de dot ibm.com
2014-02-25  8:19 ` krebbel1 at de dot ibm.com
2014-06-13  9:05 ` fweimer 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).