[PATCH] Don't do double divide in powf.
Jim Wilson
jimw@sifive.com
Tue Dec 12 18:35:00 GMT 2017
On 12/12/2017 05:04 AM, Corinna Vinschen wrote:
> On Dec 11 19:45, Jim Wilson wrote:
>> - exc.retval = 0.0/0.0; /* X/Open allow NaN */
>> + exc.retval = nan(""); /* X/Open allow NaN */
>
> As far as I can see, that still pulls in an unnecessary function call,
> nan().
>
> What about using NAN? That's basically __builtin_nanf("") and usually
> resolves without function call on any platform.
I don't see any place in the math dir that currently uses NAN like this,
but there are multiple places calling nan(""), so I did it that way. I
don't care which way it is done. But it looks like Craig Howland has a
legitimate objection, so I will try float 0.0/0.0 divide instead.
Jim
More information about the Newlib
mailing list