feat(libc): implement acosl and frexpl #3221
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3221"
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 adriadam10 on 2026-10-11T01:59:07Z.
What
acosl(iH4YAIRcecA) andfrexpl(YZk9sHO0yNg), both imported fromlibSceLibcInternal, aren't exported. Since #1529, Linux binds those imports to the system libraries, so each is the stop of a catalog homebrew title onmain:mainf1ae427b6./app.elf: symbol lookup error: ./app.elf: undefined symbol: iH4YAIRcecA(acosl)./app.elf: symbol lookup error: ./app.elf: undefined symbol: YZk9sHO0yNg(frexpl)long doubleis the x87 80-bit format, as in Sony's ownlibc.prx(the one Astro's Playroom ships). There,frexplloads its argument withfldt 0x8(%rsp)and returns inst(0), which is whatAPS5_VABIalready does forstrtoldhere.acosluses the host's math library, likeacosand the other libc math functions here.frexplfollows Sony'sfrexpl, which is FreeBSD'ss_frexpl.c: for infinity and NaN it returns the argument without writing*exp. glibc'sfrexplwrites 0 there, so that case is handled before callingstd::frexp, which is exact for every finite value.TechnicalDebt records that
acoslcomes from the host library rather than the console's msun: the last bit can differ, and glibc setsEDOMwhere msun only raises the exception.asinh(Porpoise, PPSA99764) is left to #3190, which implements it.Tested
Linux (CachyOS), GCC 16, Release.
guest_mathpasses. Expected values were computed independently with Pythondecimalat 80 digits and are compared bit for bit:acosl(-1)is π in 80-bit (0x4000:c90fdaa22168c235),acosl(0)is π/2 andacosl(1)is +0; ±1.5 and -2 give NaN;frexplover 8, -3, 0.375 and the smallest subnormal (0x3ffe:8000000000000000, exponent -16444);frexpl(-0)gives -0 with exponent 0;frexplof ±infinity and NaN returns the argument and leaves the exponent untouched.mainthe test doesn't link.acoslthroughdouble,frexplwriting the exponent for infinity or NaN, andfrexplthroughdouble.main's relinker and launched. Each stops at load with the line above.tools/check_conventions.pypasses.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-11T01:59:27Z.
Progress report (
6040a96→3cd36b0)➖ System libraries: 85.97% (+0.0%, +2 implemented functions)
✅ 2 implemented
acosl_nid_postfixfrexpl_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T02:07:18Z.
Merged: Linux CI is red only on
agc_unit_shadow, which main has failed since #2864 (reported in #3215). Windows passed, andguest_mathpassed on both.