[PATCH v4] Add nextup and nextdown math functions

Rajalakshmi Srinivasaraghavan raji@linux.vnet.ibm.com
Thu Jun 16 07:53:00 GMT 2016



On 06/16/2016 04:12 AM, Joseph Myers wrote:
> 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.
>
Changed it in the attached patch.

-- 
Thanks
Rajalakshmi S

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-nextup-and-nextdown-math-functions.patch
Type: text/x-patch
Size: 56796 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160616/4a139a54/attachment.bin>


More information about the Libc-alpha mailing list