This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v4] Add nextup and nextdown math functions
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Rajalakshmi Srinivasaraghavan <raji at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>, Rical Jasan <ricaljasan at pacific dot net>
- Date: Wed, 15 Jun 2016 22:42:36 +0000
- Subject: Re: [PATCH v4] Add nextup and nextdown math functions
- Authentication-results: sourceware.org; auth=none
- References: <57599ABC dot 9070609 at linux dot vnet dot ibm dot com> <575A3EAF dot 4040209 at pacific dot net> <575D8A3C dot 6020908 at linux dot vnet dot ibm dot com> <575DE817 dot 8090101 at pacific dot net> <575F8EF0 dot 6040305 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1606141406310 dot 23819 at digraph dot polyomino dot org dot uk> <57613D54 dot 10907 at linux dot vnet dot ibm dot com>
On Wed, 15 Jun 2016, Rajalakshmi Srinivasaraghavan wrote:
> On 06/14/2016 07:59 PM, Joseph Myers wrote:
> > On Tue, 14 Jun 2016, Rajalakshmi Srinivasaraghavan wrote:
> >
> > > +#if TEST_COND_m68k96
> > > + TEST_ff_f (nextafter, -0x0.fffffffep-16383L, 0.0L,
> > > -0x3.fffffff7fffffff0p-16385L,
> > > INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_ERANGE),
> > > #endif
> > I think the test you have there is wrong for m68k96. For intel96, the
> > smallest normal exponent is -16382; for m68k96, the smallest normal
> > exponent is -16383. This input has exponent -16384. So for m68k96 it's a
> > 63-bit mantissa. The input has bits <31 1s><32 0s>. So the correct
> > output has bits <30 1s><0><32 1s>. But your output has bits <30 1s><0><31
> > 1s>. That is, the final digit in your output should be 8, not 0.
> >
> > In general, it seems very confusing in such tests to show the exponent
> > differently in the output from the input. Why do you show the input with
> > exponent -16383 but the output with exponent -16385? That applies to
> > other tests in this patch as well.
> >
> >
> Addressed comments in the attached patch.
> +#if TEST_COND_m68k96
> + TEST_ff_f (nextafter, -0x0.fffffffep-16383L, 0.0L, -0x0.fffffffdfffffffcp-16383L, INEXACT_EXCEPTION|UNDERFLOW_EXCEPTION|ERRNO_ERANGE),
> #endif
I think this test is still wrong, and that the final digit of the result
should be 'e' not 'c', as in the intel96 test (the exponents in the tests
differ by 1, corresponding to the difference between the formats, so both
involve 63-bit mantissas.)
Likewise for the copies in the nextup and nextdown tests.
--
Joseph S. Myers
joseph@codesourcery.com