Repository navigation
feat(libc): implement fegetexcept - #9216
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the export, implementation, tests, and remaining-debt note at head 18213e0. The new export is a direct alias of the existing x87 trap-mask query, matching FreeBSD's amd64 behavior described in the PR. The test independently varies all 4,096 x87/SSE mask combinations, checks that flags/control state and guest errno are unchanged, and exercises mask disagreement explicitly. The limitation is stated accurately: the PS5 inventory establishes the export name/NID, but console behavior has not been measured. Conventions, eligibility, intake, labels, Linux/macOS register-context and relinker matrices, Windows relinker, ASan, write-watch, and report checks pass. Full Linux/Windows product workflows are skipped by repository policy. No blocking issue found in the reviewed diff.
What
Adds the missing
fegetexceptexport (VtRkfsD292M) by reusing the existing x87 trap query. It reports the six unmasked x87 exceptions without changing the floating-point environment or guest errno; SSE masks do not contribute to the result.The name/NID is present in the pinned PS5 3.20 libSceLibcInternal export inventory. The behavior follows FreeBSD 11.4 amd64 fenv.h, lines 121-133, consistent with the existing floating-point implementation.
PS5 equivalence is unverified and recorded in
docs/dev/debt/libc.md. A useful console check is to set the x87 and SSE exception masks independently, call the system-library export with no arithmetic that triggers a trap, and record the result and before/after environment and errno. In particular, x87-only and SSE-only enabled exceptions distinguish the assumed rule.Tested
Windows 11 Pro 10.0.26200, x86-64, Release, WinLibs GCC 15.2.0 UCRT POSIX SEH r7,
BUILD_TESTING=ON.Passed:
cmake --build build --target libs guest_floating_point_tests guest_math_tests guest_math_exact_tests guest_float_builtins_tests guest_fminf_tests patched_libraries_tests --parallel 6.ctest --test-dir build -R '^(guest_floating_point|guest_math|guest_math_exact|guest_float_builtins|guest_fminf|patched_libraries)$' --output-on-failure: 6/6 passed, 0.56 s total. The extended floating-point test covers all 4,096 x87/SSE mask pairs, including denormal exceptions, mismatched rounding modes, sticky flags and errno preservation.python tools/check_conventions.py --base origin/main.git diff --check origin/main...HEAD.The default full build,
cmake --build build --parallel 6, was attempted and failed in the unchanged upstreamcore/libs/prx/libSceAgcDriver/tests/execution/ImageArrayWindowPastLayerLimit.cpp:33:alignas(65536)exceeds MinGW's object-file maximum alignment of 8192. The file is identical to basececb540a63f614d2b06cbb557c6d1f6f02475fa3. The subsequent runtime-library and focused-test build above succeeded. The complete CTest suite was not run because the default build could not finish.No PS5 or title run, and no local Linux/macOS execution. Full Linux/Windows PR CI requires a collaborator to dispatch the Build workflow as described in CONTRIBUTING; that has not been dispatched here.
Overlap:
python tools/pr_overlap.py --branch feat/libc-fegetexcept --repo boykopovar/AnyPS5was run. Test/debt insertion positions were separated from neighboring open PRs. The final run reports no same exports or conflicts with mergeable PRs. Thirteen PRs already conflict with main and share the debt file; their debt diffs were manually inspected and concern other entries. There is no functional dependency on another PR.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)