public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/5268] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
@ 2012-02-21  1:28 ` jsm28 at gcc dot gnu.org
  2013-06-26  2:53 ` amodra at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-02-21  1:28 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-02-21 01:24:10 UTC ---
Ryan, ping.  You said in 2008 you'd look at this....

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

* [Bug libc/5268] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
  2012-02-21  1:28 ` [Bug libc/5268] huge and denornal reads and writes for long doubles jsm28 at gcc dot gnu.org
@ 2013-06-26  2:53 ` amodra at gmail dot com
  2013-06-26 13:28 ` amodra at gmail dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: amodra at gmail dot com @ 2013-06-26  2:53 UTC (permalink / raw)
  To: glibc-bugs

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gmail dot com

--- Comment #3 from Alan Modra <amodra at gmail dot com> ---
huge() seems to give a long double having component doubles of 0x1p+1023
-0x1p+917.  I'm not sure why this value is chosen, as it's quite a lot smaller
than the largest correctly rounded long double not an infinity.  It's even
smaller than the value returned by huge() for double!  And it's really really
odd that the low double is negative..

The actual maximum is 0x1.fffffffffffff7ffffffffffffcp+1023 (component doubles
of 0x1.fffffffffffffp+1023 0x1.fffffffffffffp+969).  That "7" is there because
anything higher will cause the high double to be rounded to inf.

As to the bug with writing out the current huge() and reading back in, I think
you'll find the problem is related to normalisation in
sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c where the mantissa is trimmed to 105
bits.  The current huge() has exponents that differ by 106.  That means there
are 53 implicit bits of significand between the high double significand and the
low double significand.
So the number you're trying to write is actually
0x1.ffffffffffffffffffffffffff8p+1022 (if I can count) which ought to be OK. 
However, ldbl2mpn.c normalises before subtracting, resulting in the low double
mantissa becoming zero.  Net result is loss of one bit.  This bug isn't
addressed by http://sourceware.org/ml/libc-alpha/2013-06/msg00919.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 libc/5268] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
  2012-02-21  1:28 ` [Bug libc/5268] huge and denornal reads and writes for long doubles jsm28 at gcc dot gnu.org
  2013-06-26  2:53 ` amodra at gmail dot com
@ 2013-06-26 13:28 ` amodra at gmail dot com
  2013-06-29  4:04 ` amodra at gmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: amodra at gmail dot com @ 2013-06-26 13:28 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from Alan Modra <amodra at gmail dot com> ---
Created attachment 7095
  --> http://sourceware.org/bugzilla/attachment.cgi?id=7095&action=edit
ldbl2mpn.c rewrite

This rewrite of __mpn_extract_long_double uses extra precision for the
normalization after subtraction, avoiding the loss of 1 bit.

-- 
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/5268] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-06-26 13:28 ` amodra at gmail dot com
@ 2013-06-29  4:04 ` amodra at gmail dot com
  2013-10-05  3:12 ` amodra at gmail dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: amodra at gmail dot com @ 2013-06-29  4:04 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #5 from Alan Modra <amodra at gmail dot com> ---
> huge() seems to give a long double having component doubles of 0x1p+1023
> -0x1p+917.  I'm not sure why this value is chosen

Ah, I knew I had something to do with this long double choice but had forgotten
the exact reason.  See http://gcc.gnu.org/ml/fortran/2005-09/msg00556.html.
huge() has nothing to do with the maximum value for a machine representable
number.

-- 
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/5268] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-06-29  4:04 ` amodra at gmail dot com
@ 2013-10-05  3:12 ` amodra at gmail dot com
  2013-11-16  3:54 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: amodra at gmail dot com @ 2013-10-05  3:12 UTC (permalink / raw)
  To: glibc-bugs

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://sourceware.org/ml/li
                   |                            |bc-alpha/2013-08/msg00106.h
                   |                            |tml
           Assignee|rsa at us dot ibm.com              |amodra at gmail dot com

-- 
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/5268] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2013-10-05  3:12 ` amodra at gmail dot com
@ 2013-11-16  3:54 ` cvs-commit at gcc dot gnu.org
  2014-02-07  2:33 ` [Bug libc/5268] [ldbl-128ibm] " jsm28 at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-11-16  3:54 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 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, ibm_2.18 has been created
        at  40e9bbdd3d2ea22c2455949959ced90e054f6023 (commit)

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

commit 40e9bbdd3d2ea22c2455949959ced90e054f6023
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Nov 16 10:18:28 2013 +1030

    Mention powerpc64le support in NEWS and README, plus bugs fixed.

        * NEWS: Mention powerpc64le support and bugs fixed.
        * README: Both big-endian and little-endian powerpc64 supported.

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

commit 74af96bf910f7e10289c72a397564dab19131b31
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Nov 16 10:09:06 2013 +1030

    PowerPC64le has ifunc too.

    I believe this is really just a "documentation" fix.
    See https://sourceware.org/ml/binutils/2013-10/msg00059.html

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

commit d5f593430c7748f64321ecac36162646420a6aaf
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Oct 5 17:05:54 2013 +0930

    Set arch_minimum_kernel for powerpc*le.

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

commit c325a11f7fa409423514de4af55ba63cc559cbf0
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Aug 17 19:11:11 2013 +0930

    A little more precise %Lf for IBM long double
    http://sourceware.org/ml/libc-alpha/2013-08/msg00106.html

    IBM long double has variable precision and we often have values with
    107 bits during the normal course of calculations.  It's possible to
    have an IBM long double with 2k bits of precision, and while some might
    argue we ought to print to the full precision, I'm not inclined to try
    to implement that.

    So this patch gives the mpn values returned from ldbl2mpn() an extra
    11 bits of precision.  To do that it's necessary to inform the caller
    of __mpn_extract_long_double() exactly how many bits are returned
    rather than assuming a fixed LDBL_MANT_DIG bits.  I did that
    indirectly by returning the number of zero bits in the last mp_limb,
    which turns out to be convenient both in __mpn_extract_long_double(),
    and it's caller.  Given the extra parameter it then becomes possible
    to omit shifting in __mpn_extract_long_double(), since the caller does
    that anyway.

    In the following, note that 1 - IEEE854_LONG_DOUBLE_BIAS is equal to
    LDBL_MIN_EXP - 1.  I prefer the former since we already use
    IEEE854_LONG_DOUBLE_BIAS in the exponent calculation for normalised
    values, and it reinforces the fact that denormals are treated as if
    their unbiased exponent was 1.

        [BZ #5268]
        * include/gmp.h (__mpn_extract_double, __mpn_extract_long_double):
        Update prototypes.
        * stdio-common/printf_fp.c: Likewise.
        (__printf_fp): Use returned zero_bits.
        * stdlib/dbl2mpn.c (__mpn_extract_double): Update funtion arguments.
        * sysdeps/i386/ldbl2mpn.c (__mpn_extract_long_double): Don't perform
        shifts for denormals here.  Instead return leading zero bit count
        and adjust return value of function.
        * sysdeps/ieee754/dbl-64/dbl2mpn.c (__mpn_extract_long_double):
Likewise.
        * sysdeps/ieee754/ldbl-128/ldbl2mpn.c (__mpn_extract_long_double):
        Likewise.
        * sysdeps/ieee754/ldbl-96/ldbl2mpn.c (__mpn_extract_long_double):
        Likewise.
        * sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c (__mpn_extract_long_double):
        Likewise.  Return an extra 11 bits of precision.

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

commit e24fc3c2914e0e17836455991e43151d453eb34c
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Oct 3 14:09:27 2013 +0930

    PowerPC LE ABI tests
    http://sourceware.org/ml/libc-alpha/2013-08/msg00096.html

    This adds ABI tests for powerpc64le.

        * Makerules (abilist): Define and use var in abilist rules.
        * sysdeps/unix/sysv/linux/powerpc/Makefile (abilist): Define.
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/ld-le.abilist,
        *
sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libBrokenLocale-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libanl-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libcrypt-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libdl-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libm-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libnsl-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libresolv-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/librt-le.abilist,
        *
sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libthread_db-le.abilist,
        * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libutil-le.abilist:
        New files.

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

-- 
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/5268] [ldbl-128ibm] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2013-11-16  3:54 ` cvs-commit at gcc dot gnu.org
@ 2014-02-07  2:33 ` jsm28 at gcc dot gnu.org
  2014-07-14 14:51 ` carlos at redhat dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-02-07  2:33 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|huge and denornal reads and |[ldbl-128ibm] huge and
                   |writes for long doubles     |denornal reads and writes
                   |                            |for long doubles

-- 
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/5268] [ldbl-128ibm] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2014-02-07  2:33 ` [Bug libc/5268] [ldbl-128ibm] " jsm28 at gcc dot gnu.org
@ 2014-07-14 14:51 ` carlos at redhat dot com
  2014-07-15  0:46 ` amodra at gmail dot com
  2015-08-27 22:03 ` [Bug math/5268] " jsm28 at gcc dot gnu.org
  9 siblings, 0 replies; 12+ messages in thread
From: carlos at redhat dot com @ 2014-07-14 14:51 UTC (permalink / raw)
  To: glibc-bugs

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

Carlos O'Donell <carlos at redhat dot com> changed:

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

--- Comment #7 from Carlos O'Donell <carlos at redhat dot com> ---
Alan,

Is this fixed now?

-- 
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/5268] [ldbl-128ibm] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2014-07-14 14:51 ` carlos at redhat dot com
@ 2014-07-15  0:46 ` amodra at gmail dot com
  2015-08-27 22:03 ` [Bug math/5268] " jsm28 at gcc dot gnu.org
  9 siblings, 0 replies; 12+ messages in thread
From: amodra at gmail dot com @ 2014-07-15  0:46 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #8 from Alan Modra <amodra at gmail dot com> ---
No, the bug is not fixed, and I moved on to other things.

http://sourceware.org/ml/libc-alpha/2013-08/msg00106.html was never reviewed. 
The commits here are for the ibm-2.18 branch..

-- 
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/5268] [ldbl-128ibm] huge and denornal reads and writes for long doubles
       [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2014-07-15  0:46 ` amodra at gmail dot com
@ 2015-08-27 22:03 ` jsm28 at gcc dot gnu.org
  9 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-08-27 22:03 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |math

-- 
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/5268] huge and denornal reads and writes for long doubles
  2007-11-03 17:26 [Bug libc/5268] New: " jvdelisle at gcc dot gnu dot org
  2007-11-08  0:45 ` [Bug libc/5268] " drepper at redhat dot com
@ 2008-03-14 17:49 ` rsa at us dot ibm dot com
  1 sibling, 0 replies; 12+ messages in thread
From: rsa at us dot ibm dot com @ 2008-03-14 17:49 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From rsa at us dot ibm dot com  2008-03-14 17:49 -------
I'll take a look at this one.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper at redhat dot com   |rsa at us dot ibm dot com
             Status|NEW                         |ASSIGNED


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/5268] huge and denornal reads and writes for long doubles
  2007-11-03 17:26 [Bug libc/5268] New: " jvdelisle at gcc dot gnu dot org
@ 2007-11-08  0:45 ` drepper at redhat dot com
  2008-03-14 17:49 ` rsa at us dot ibm dot com
  1 sibling, 0 replies; 12+ messages in thread
From: drepper at redhat dot com @ 2007-11-08  0:45 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   GCC host triplet|powerpc*-*-linux* and darwin|powerpc*-*-linux*


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2015-08-27 22:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-5268-131@http.sourceware.org/bugzilla/>
2012-02-21  1:28 ` [Bug libc/5268] huge and denornal reads and writes for long doubles jsm28 at gcc dot gnu.org
2013-06-26  2:53 ` amodra at gmail dot com
2013-06-26 13:28 ` amodra at gmail dot com
2013-06-29  4:04 ` amodra at gmail dot com
2013-10-05  3:12 ` amodra at gmail dot com
2013-11-16  3:54 ` cvs-commit at gcc dot gnu.org
2014-02-07  2:33 ` [Bug libc/5268] [ldbl-128ibm] " jsm28 at gcc dot gnu.org
2014-07-14 14:51 ` carlos at redhat dot com
2014-07-15  0:46 ` amodra at gmail dot com
2015-08-27 22:03 ` [Bug math/5268] " jsm28 at gcc dot gnu.org
2007-11-03 17:26 [Bug libc/5268] New: " jvdelisle at gcc dot gnu dot org
2007-11-08  0:45 ` [Bug libc/5268] " drepper at redhat dot com
2008-03-14 17:49 ` rsa at us dot ibm 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).