libc: single-precision libm on Windows vs titles' libc.prx, last-bit survey #9707
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 JJenkx on 2026-10-22T09:27:46Z.
Where the single-precision libm functions of this libc's Windows build stand against the
libc.prxthat titles ship, measured by running those copies natively. Posted as a map for whoever ports the next function (as #9668 does foracosf), not as a request.Method. I loaded the decrypted
libc.prxof PPSA07923 (no FMA in its math code) and PPSA13934 (an FMA-contracted build) into a scratch harness. It maps the ELF, applies its relocations and supplies__error. Each function's export was called next to<name>_nid_postfixfrom this libc's Windows build (main-based, WinLibs GCC 15.2.0 r7 UCRT, Release) on the same 20,000,000 inputs. Half were random bit patterns; half were random significands with exponents from 2^-15 to 2^16. I compared the result bits. NaN-only differences (both NaN, different bits) are left out.sinfcosftanfasinfacosfatanfsinhfcoshftanhfasinhfacoshfatanhfexpfexp2fexpm1flogflog2flog10flog1pfsqrtfcbrtferfferfcftgammaffloorfceilfroundftruncfrintfsqrtfand the rounding functions on both copies, andsinhfandatanhfon the non-FMA copy. Those follow the console's msun code here already.tgammaf's 895,517 are the sign of a zero result. For example, for-4260.884765625(0xc5852714) the console returns-0.0and this libc+0.0.sinhf,atanhf,asinf,acosf,logf,erffand others. So for those functions no single implementation can match every title. The exhaustiveacosfrun is on #9668.I'm not opening PRs for these: no title is known to depend on the last bit (#5239). Linux was not measured; there these functions call glibc. The harness and full logs are local and available on request.
AI-assisted (Claude Code).