This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Avoid extra float->double conversion


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]