This is an archive of the discontinued LLVM Phabricator instance.

[libc] Make log2f correctly rounded for all rounding modes when FMA is not available.
ClosedPublic

Authored by lntue on Jan 20 2022, 10:54 AM.

Details

Summary

Add to log2f 2 more exceptional cases got when not using fma for polyeval.

Diff Detail

Event Timeline

lntue created this revision.Jan 20 2022, 10:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2022, 10:54 AM
lntue requested review of this revision.Jan 20 2022, 10:54 AM
sivachandra added inline comments.Jan 20 2022, 12:36 PM
libc/src/math/generic/log2f.cpp
121

You did not need this as a special case before so why is it required now?

lntue added inline comments.Jan 20 2022, 12:56 PM
libc/src/math/generic/log2f.cpp
121

These 2 extra cases I got when I intentionally not using FMA for polyeval, to mimic what would happen if FMA is missing. Another implementation option is only consider these 2 cases when FMA is missing with #ifdef.

sivachandra accepted this revision.Jan 20 2022, 1:04 PM
This revision is now accepted and ready to land.Jan 20 2022, 1:04 PM