Repository navigation
feat(libc): implement floating-point rounding and exception flags - #6985
Conversation
Progress report (e1ac330 → 4e7e8ac)📈 System libraries: 89.4% (+0.01%, +6 implemented functions) ✅ 6 implemented
|
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
jotitadev
left a comment
There was a problem hiding this comment.
Linux run, since the description notes Linux execution has not been performed.
Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON, full build.
Head 4e7e8ac1a merged onto main 40315fcf8 (clean merge; the branch is based on e1ac3300d).
guest_floating_pointandguest_mathpass with the PR.- Non-GPU suite (
ctest -E "^agc|gpu|vulkan|video_out"): 683/683, the 682 tests ofmainplusguest_floating_point.
I did not repeat the test-only check on main: the test needs the new exports to link, which the description already covers.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Checked against FreeBSD |
What
Adds six missing
libSceLibcInternalexports to libc:fegetround,fesetround,fetestexcept,feclearexcept,fegetexceptflagandfesetexceptflag.Rounding changes apply to both x87 and SSE. Exception queries combine both units, and masked flag updates preserve unrelated flags and control bits. The implementation follows the FreeBSD 11.4 amd64 contract used by the existing
fegetenv, including the denormal flag and the 16-bitfexcept_t; the unverified console ABI and null-pointer behavior are recorded in libc's technical debt.A dedicated test checks actual x87/SSE conversions in all four rounding modes, invalid-mode rejection without state changes, flag save/restore/clear, two-byte writes with canaries, preservation of exception masks and isolation between threads. No title-unblocking or performance claim.
Tested
Windows x86-64, WinLibs MinGW-w64 GCC 15.2, Ninja, Release,
BUILD_TESTING=ON, rebased ontoe1ac3300d(baseline check onfd9e577d; focused tests rerun after rebase).undefined reference); adding the implementation makes the same test link and pass.cmake --build build --target guest_floating_point_tests guest_math_tests --parallel 2: passed.ctest --test-dir build -R '^guest_(floating_point|math)$' --output-on-failure: 2/2 passed; the new test takes about 0.04 s.nid_patcher, patched the resultinglibc.prx, and verified all six NIDs in its export table.python tools/check_conventions.py --base origin/mainandgit diff --check: passed.tools/progress.py: libraries 3318/3712 (89.39%) on main, 3324/3718 (89.40%) with this change.Linux execution, a full-project build and title runs have not been performed locally. Automatic PR checks do not replace the project's manually dispatched full Linux/Windows builds.
Overlap review: ran
tools/pr_overlap.py --branch feat/libc-floating-point-controlsand rechecked the final documentation placement against all 36 PRs changing that file. No duplicate exports, new files or confirmed line conflicts remain. The stale branches #5021, #5303, #5668, #6044, #6222 and #6565 share build/debt files and cannot be fully compared automatically; their available diffs were reviewed manually. They do not implement these exports. #6044 reorganizes existing tests, so this new test may need the same organization when that work lands. None is a prerequisite for this implementation.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)