feat(libc): implement llroundf #2933
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2933"
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 reyani-dev on 2026-10-10T18:33:51Z.
Resubmission of #2189, which was closed because no title was shown stopping on it. The title evidence has since been posted there by @babyhuey (run):
On
mainc963432d, OpenRCT2 Native Port (PPSA99728) stops atllroundf(eQhBFnTOp40): WindowsFAIL: unresolved ELF import eQhBFnTOp40 (llroundf) from libSceLibcInternal.prx, Linuxundefined symbol: eQhBFnTOp40. With this change it moves on toatol.The function is still absent on current
main, and no open PR implements it. The branch is rebased onto currentmain. Windows 11 (WinLibs GCC 15.2.0), Release:guest_mathpasses 3/3,check_conventions.pypasses, andpr_overlap.pyreports no overlap.What
Exports
llroundfnext tolroundfandllround, which round the same way: halfway cases away from zero, into a 64-bit result.Title: PPSA99169 RetroArch imports it from
libSceLibcInternal(resolved throughlibc.prx), per the #1578 audit. I haven't run the title.Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON:guest_math_tests, next to thellroundcase:±2.5f);-0.4f→ 0;2^33,-2^62);0.49999997f→ 0, whichfloor(x + 0.5f)gets wrong because the sum rounds up to 1;16777215.f.floor(x + 0.5f)and the hostlround(32-bitlongon Windows) each makeguest_mathfail.cmake --build build --target libs: the patchedlibc.prxexportseQhBFnTOp40.tools/check_conventions.pypasses, andtools/pr_overlap.py --branchreports no overlap.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
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T18:57:31Z.
Full Linux and Windows builds and tests for this head (
3c431989), using the project's Build workflow. I can't start the upstream manual run, so I ran the samebuild.ymlin my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into currentmain(bf6e25a1):ctest: 703/703 passedctest: 711/711 passedRun: https://github.com/AchrafReyani/AnyPS5/actions/runs/38076401894
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:00:23Z.
Progress report (
1476f76→3c43198)➖ System libraries: 84.56% (+0.0%, +1 implemented functions)
✅ 1 implemented
llroundf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T19:09:33Z.
Heads-up so the evidence here isn't read against the wrong layout: the runs of mine linked in the description are from
mainc963432d, before #2605. Since #2605 each title'ssce_module/libc.prxhas to be unwrapped, and that module is the SDK shim whose exports point 1872 libc functions at one return-0 stub (#2652). So on currentmain(9c5d67fb, catalog run with the module unwrapped) OpenRCT2 Native Port (PPSA99728) stops atexecvp(#2827) instead ofllroundf. The stop comes back once the shim's return-0 exports are left out, which is what the closed #2705 did; a run without the shim's return-0 exports would show whetherllroundfis its stop again.Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-10T19:17:30Z.
Thanks @babyhuey, that's an important caveat. These titles' imports declare
libSceLibcInternal, so on currentmainthey bind to the bundled SDK shim's return-0 export (#1497/#2652) instead of failing at load, which hides the stop. Once #1529 keepslibSceLibcInternal-declared imports host-bound, the stop comes back, as the closed #2705 table showed. Either way, these titles call the real function, so onmainthey currently get 0 from it.