feat(libc): implement sinhf and asinl (carried from #3519) #3725
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3725"
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 Recapi on 2026-10-11T16:01:07Z.
What
Carries @screamm's
sinhfandasinlfrom #3519 (screamm:feat/libc-sinhf-asinl), with the commits and their authorship unchanged, cherry-picked ontomaina11c8f7without conflicts. Closes #3519.Both functions are ports of the FreeBSD msun code that the console's
libc.prxruns. In #3519 screamm compared them bit for bit against that code, taken from thelibc.prxbundled with PPSA28319. The two ports:sinhf:e_sinhf.c, with theexpm1f/expfpaths it reaches;asinl:e_asinl.c, with the ld80invtrig.ccoefficients.The details are in #3519. This replaces the host one-liners for the same two functions that I had in #3597 and #3598.
Tested
Linux (Ubuntu, GCC, Release) on
a11c8f7. The catalog ZIPs were checked against their sha256,eboot.binandsce_module/libc.prxwere unwrapped as #2605 requires, and each title was relinked with--registryand run in a sandbox with no network:mainstops at1t1-JoZ0sZQ(sinhf); with this PR it reaches./app.elf: symbol lookup error: ./app.elf: undefined symbol: EDyhWelj7UY(pause)mainstops atNx-F5v0-qU8(asinl); with this PR it reaches./app.elf: symbol lookup error: ./app.elf: undefined symbol: KvOHPTz595Y(atanl, #3598)guest_mathpasses 3/3 (--repeat until-fail:3), andcheck_conventions.pypassesEarlier checks in #3519: screamm ran Windows 11 (WinLibs GCC 15.2.0 r7,
guest_math3/3), blawesom ran the full suite on Linux (832/832), and orishamir ran RetroArch on Windows.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T16:01:32Z.
Progress report (
33ae282→5f3fb3d)📈 System libraries: 86.26% (+0.01%, +2 implemented functions)
✅ 2 implemented
asinl_nid_postfixsinhf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-11T20:32:36Z.
I checked this PR on both OSes with Ruffle (PPSA68091, catalog build), merged onto
main0a8b1d32(test merge 96897625).main, Windows:FAIL: unresolved ELF import 1t1-JoZ0sZQ (sinhf) from libSceLibcInternal.prxsinhfresolves and the next stop ispause(EDyhWelj7UY, #3580) on both.undefined symbol: EDyhWelj7UY (pause)FAIL: unresolved ELF import EDyhWelj7UY (pause) from libkernel.prxguest_mathpasses 5/5 (--repeat until-fail:5) on both. No warnings inMath.cpporGuestMath.cpp.Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-11T22:06:55Z.
Rebased onto
mainc7b9719. The only conflict was inTechnicalDebt.md, where a new entry had landed next to thesinhfone, and both are kept. The commits are still @screamm's. Ran on Linux after the rebase:guest_mathpasses 3/3, Ruffle Flash (PPSA68091) gets pastsinhftopause(#3580), and RetroArch (PPSA99169) gets pastasinltoatanl(#3598). The branch also merges cleanly with #3598 as rebased.Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-12T00:32:19Z.
Windows validation with title evidence (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs): PR head273f5530merged cleanly ontomainbab7b328.guest_math3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"582/584, the two failures being the knownagc_write_tracking(#4087) andguest_kernel_stack_protect(#4088); conventions andgit diff --checkpass.Relinked against this build: RetroArch (PPSA99169) moves from
FAIL: unresolved ELF import Nx-F5v0-qU8 from libSceLibcInternal.prx(asinl) toFAIL: unresolved ELF import DxmIMUQ-wXY from libkernel.prx(pthread_attr_getstackaddr, open #3494); Ruffle (PPSA68091) moves from1t1-JoZ0sZQ(sinhf) toe2G+cdEkOmU(pthread_attr_getscope, #3494). Both stops onmainare removed by this PR.Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-12T03:04:02Z.
Rebased onto
main34a16b7. The only conflict was inTechnicalDebt.md, where thepthread_attr_*entry from #3494 had landed next to thesinhfone, and both are kept. The commits are still @screamm's. Ran on Linux after the rebase:guest_mathpasses 3/3 andcheck_conventions.pypasses. With #3494 now onmain, Ruffle Flash (PPSA68091) loads with no absent imports, and RetroArch (PPSA99169) gets past all its libc imports tosceKernelJitCreateSharedMemory.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T08:23:53Z.
Conflicts with main in
core/libs/tests/GuestMath.cpp; please rebase.Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-12T09:11:31Z.
@Recapi, to save you the rebase: the two commits are rebased onto current
mainc36fd0a0atscreamm:feat/libc-sinhf-asinl-rebased(e471aa6csinhf,157e6a5casinl, same author and messages). The only conflict was one hunk inGuestMath.cppafterCheckLongDouble():main's newCheckFmodErrno()is kept whole, followed by this PR'sMakeExtended()andCheckAsinl();main()calls both.Math.cppandTechnicalDebt.mdmerged automatically, nothing is defined twice and no test line is lost (git range-diffagainst this PR shows only context changes). Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, full build includinglibs:guest_math3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"602/602; conventions andgit diff --checkpass. A force-push of those two commits onto this PR's branch should be all that is needed.Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-12T10:58:48Z.
Correction: the rebased commits are re-pushed to the same branch with the author identity fixed (they carried a placeholder
[email protected]from the rebase environment): now2c6e3f53sinhf and5f3fb3ddasinl, content identical to the hashes above. Please take these instead.Imported from boykopovar/AnyPS5. Originally posted by Recapi on 2026-10-12T13:19:54Z.
Thanks @screamm. The PR head is now your rebased
2c6e3f53(sinhf) and5f3fb3dd(asinl), unchanged, with the corrected author identity. It merges cleanly ontomain33ae282. On Linux:guest_mathpasses 3/3 andcheck_conventions.pypasses. @oneandonlydean theGuestMath.cppconflict is resolved.