fix(libc): compute logl, log10l and log2l with _LLog #18110
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18110"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AasishDairelSahayaGrinspan on 2026-11-10T13:24:38Z.
What
The
libc.prxbundled with PPSA21564 computeslogl,log10landlog2lby calling_LLogwith the bases 0, 1 and -1, as the _LLog entry records. The_LLogimplementation ported from that binary already lives in this libc and gives the same bits,errnoand floating-point flags on four million random arguments at 64-, 53- and 24-bit precision, but the three exports still called the host library — whose results differed on 869,197, 2,000,696 and 306,649 of those arguments at 64 bits.The three exports now forward to
_LLog:log10l(1000)is exactly 3,logl(0)raisesFE_DIVBYZEROand setsERANGE, andloglof a negative argument raisesFE_INVALIDand setsEDOM, as the module does. The_XLgammalong double path inherits the improvement through itsloglcall. The debt entry drops the closed clause, and the host-computed ld80 list losesloglandlog10l.The focused test pins the recorded behavior: the exact-3 results, the measured-fraction bits from the
_LLogtable, positive zero forlogl(1), and the errno/flag pairs for zero and negative arguments.Tested
macOS 15 (arm64 host, x86_64 target via Rosetta), Apple Clang, Release:
TestLongLogExportsassertions pass (verified by hoisting the call ahead of a pre-existing, unrelated_Exp subnormal result classificationfailure that cleanmainalready shows on this host — that failure exists without this change and is not touched here).python3 tools/check_conventions.py --base origin/main: passed.Linux and Windows run the full suite in CI; the change is three forwarding calls over the already-tested
_LLog.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)