On Fri, Nov 06, 2020 at 11:45:21PM -0500, Michael Meissner wrote:
> On Mon, Nov 02, 2020 at 07:00:15PM -0600, Segher Boessenkool wrote:
> > > +  /* This test is written to test IBM extended double, which is a pair of
> > > +     doubles.  If long double can hold a larger value than a double can, 
> > > such
> > > +     as when long double is IEEE 128-bit, just exit immediately.  */
> > 
> > A double-double can hold bigger values than a double can, as well
> > (if X is the biggest double, then X+Y is a valid double-double whenever
> > you take Y small enough).
> > 
> > > +  if (LDBL_MAX_10_EXP > DBL_MAX_10_EXP)
> > > +    return 0;
> 
> Yes a double-double can hold more mantissa bits than a double, but the 
> exponent
> size is the same (which is what I'm testing).

But that is not what the comment says.  My remark was about the comment.
It is confusing as is.

> > > +#if defined(_ARCH_PPC) && defined(__LONG_DOUBLE_IEEE128__)
> > > +/* On PowerPC systems, long double uses either the IBM long double 
> > > format, or
> > > +   IEEE 128-bit format.  The compiler switches the long double built-in
> > > +   function names and glibc switches the names when math.h is included.
> > > +   Because this test is run with -fno-builtin, include math.h so that the
> > > +   appropriate nextafter functions are called.  */
> > > +#include <math.h>
> > > +#endif
> > > +
> > >  #include "nextafter-1.c"
> > 
> > Please explain *what* mappings are made?  And why is it okay to do this
> > in the testsuite, when all "normal" code (that does not do this) will
> > just fail?
> 
> I can put in a better comment.  However, this test fails because it explicitly
> does not include math.h and it uses -fno-builtin.  So the compiler can't
> effectively map the nextafter math function.

So either the compiler is wrong, or the test is?  Or I do not grasp what
you mean to say at all :-(


Segher

Reply via email to