https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94073

            Bug ID: 94073
           Summary: ibm-ldouble-format: the given maximum value of the IBM
                    long double format is incorrect
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincent-gcc at vinc17 dot net
  Target Milestone: ---

The IBM long double format (double-double) is specified in
libgcc/config/rs6000/ibm-ldouble-format, which says:

|   Each long double is made up of two IEEE doubles.  The value of the
| long double is the sum of the values of the two parts (except for
| -0.0).  The most significant part is required to be the value of the
| long double rounded to the nearest double, as specified by IEEE.  For
| Inf values, the least significant part is required to be one of +0.0
| or -0.0.  No other requirements are made; so, for example, 1.0 may be
| represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaN
| is don't-care.

Thus the maximum value that can be represented is x_h + x_l with
  x_h = 2^1024 - 2^971  (= DBL_MAX)
  x_l = 2^970 - 2^917   (the maximum value less than 1/2 ulp(x_h))

The binary representation of the significand is 111...1110111...111, with 53
bits 1 in both parts.

If x_l >= 1/2 ulp(x_h) = 2^970, then the value of the long double x_h + x_l
would round as a double to infinity, instead of x_h as required above.

This contradicts Section "Limits", which says:

  The maximum representable long double is 2^1024-2^918.

Indeed, this value is too large to satisfy the above constraints.

Reply via email to