This is an archive of the discontinued LLVM Phabricator instance.

[libc] Implement log10f correctly rounded for all rounding modes.
ClosedPublic

Authored by lntue on Jan 24 2022, 6:43 PM.

Details

Summary

Based on RLIBM implementation similar to logf and log2f. Most of the exceptional inputs are the exact powers of 10.

Diff Detail

Event Timeline

lntue created this revision.Jan 24 2022, 6:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2022, 6:43 PM
lntue requested review of this revision.Jan 24 2022, 6:43 PM
lntue updated this revision to Diff 402753.Jan 24 2022, 8:01 PM

Fix comments.

sivachandra accepted this revision.Jan 24 2022, 10:01 PM

LGTM but please wait for approval from others.

libc/src/math/generic/log10f.cpp
135

Nit: Does it make sense to add a comment telling the reader about the decimal value?

libc/test/src/math/log10f_test.cpp
36

Nit: Can you add a comment telling the reader what these numbers correspond to?

This revision is now accepted and ready to land.Jan 24 2022, 10:01 PM
zimmermann6 accepted this revision.Jan 25 2022, 1:57 AM

this revision passes all exhaustive tests, for the four rounding modes, great work!

santoshn accepted this revision.Jan 25 2022, 4:45 AM

Looks good to me. Thanks.

jpl169 accepted this revision.Jan 25 2022, 6:58 AM
lntue updated this revision to Diff 402908.Jan 25 2022, 7:16 AM

Add decimals of exceptional values to comments.

lntue marked 2 inline comments as done.Jan 25 2022, 7:17 AM
This revision was landed with ongoing or failed builds.Jan 25 2022, 7:34 AM
This revision was automatically updated to reflect the committed changes.