Repository navigation
feat(libc): implement log1p, log1pf and expm1 - #3259
Conversation
Export them forwarding to the C++ standard library, like log and exp. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Full Linux and Windows builds and tests for this head (
The one Linux failure, Run: https://github.com/AchrafReyani/AnyPS5/actions/runs/38109323513 |
|
Checked with #3190 under this head (1f94d93) on OpenRCT2 (PPSA99728), Linux, catalog build with
On Windows the loader reports |
Resubmission of #2173, which was closed because no title was shown stopping on these functions.
OpenRCT2 (PPSA99728) stops at
coshonmain961b25f (implemented by #3190). With #3190 applied, it stops next atexpm1(gqKfOiJaCOo), per @babyhuey's run on #3190 (comment). So this becomes OpenRCT2's next stop as soon as #3190 lands, the same stacking as #2933 (llroundf) before #2932 (atol).log1p,log1pfandexpm1are still absent on currentmain, and no open PR implements them. There is no code dependency on #3190: the branch is rebased onto currentmainand merges cleanly with #3190. Windows 11 (WinLibs GCC 15.2.0), Release:guest_mathpasses 3/3, andcheck_conventions.pyandpr_overlap.py --branchpass.What
Exports
log1p,log1pfandexpm1. Each one forwards to the C++ standard library, likelogandexp. Only the variants that titles import are added.Titles: open-source homebrew from the #1578 catalog audit imports them from
libSceLibcInternal(resolved throughlibc.prx):log1p: PPSA68091 Ruffle, PPSA99169 RetroArchlog1pf: PPSA68091 Ruffleexpm1: PPSA99169 RetroArch, PPSA99764 PorpoiseI haven't run any of these titles.
Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON:guest_math_tests, next tolog10f:log1p(-0)andexpm1(-0)are-0);log1p(-1) == -inf,log1p(inf) == inf,expm1(-inf) == expm1(-1000) == -1;log1p(-2),log1pf(-2);log1p(1e-300),log1pf(1e-30f)andexpm1(1e-300)return their argument, andlog1p(1e-10)/expm1(1e-10)are within 1e-25 of the exact values.log(1 + x)andexp(x) - 1give 0 or lose most digits there.log(1 + x)orexp(x) - 1makesguest_mathfail.cmake --build build --target libs: the patchedlibc.prxexports all 3 NIDs.tools/check_conventions.pypasses, andtools/pr_overlap.py --branchreports no overlap. This branch also merges cleanly with my feat(libc): implement __powidf2 #2158, feat(libc): implement the hyperbolic functions #2166 and feat(libc): implement fabs, sqrt, trunc and fma #2167.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code