isnanf cleanup
Jeff Johnston
jjohnstn@redhat.com
Wed Jul 8 09:16:00 GMT 2009
Ken Werner wrote:
> On Friday 03 July 2009 07:19:59 pm Jeff Johnston wrote:
>
>> Hi Craig,
>>
>> Sorry for the delay.
>>
>> Patch has a problem. It will break spu math library. The spu will define
>> isnan and isinf to not support float values which will override the
>> definitions in math.h. Don't know why SPU has those macros in
>> machine/ieeefp.h but they should be rewritten to match the ones in math.h
>> or removed entirely.
>>
>> -- Jeff J.
>>
>
> Hi,
> Why does this patch break the SPU math library?
> The reason that the isinf and isnan macros are overwritten by the
> machine/ieeefp.h is that these are evaluated at compile time and thus faster
> than the math.h variant which calls fpclassify. They could be rewritten to use
> fpclassify instead of __isinfd/__isnand but we don't have an optimized
> __fpclassifyd routine like our vectorized isnan code.
>
> -ken
>
This breaks the SPU math library because the override macros only work
for double arguments.
They return 0 if the value is a float. Craig's patch has changed the
float math routines to use isnan/isinf
instead of __isnanf/__isinff which is fine if one uses the macro in
math.h, but in SPU's case they will never properly detect a float nan or
float infinity.
-- Jeff J.
More information about the Newlib
mailing list