[PATCH] Avoid extra float->double conversion

Craig Howland howland@LGSInnovations.com
Thu Apr 20 00:36:00 GMT 2017


On 04/19/2017 08:03 PM, Richard Allen wrote:
> There were a few more spots triggering double-precision math.
> Attached patch updated to include comparisons and multiplies.
>
> On Wed, Apr 19, 2017 at 6:53 PM, Richard Allen <rsaxvc@rsaxvc.net> wrote:
>> Patch avoids an unnecessary float->double
>> conversion to save a small amount of codespace.
>>
>> -Richard
This is better than the first one, with the catch on the constants. Have you 
checked what was linked to be certain that no other double things are still 
there?  (Perhaps easier than inspecting the source.)

To be the most gung-ho, isnan() should be isnanf() throughout--saves a 
conversion and might avoid a double function being linked.  (It seems odd that 
it does have isfinitef(), but not isnanf().)

And just wondering, did you check all of the "f" functions?  (I'd guess so since 
your 0/0 patch edits multiple files, but better to know for sure.)  It would not 
be at all surprising if others (or even all) of the f forms had the same flaw.

Craig



More information about the Newlib mailing list