fix(libc): return fetestexcept's unmasked status bits as measured on a PS5 #10175
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10175"
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 orezraey on 2026-10-23T12:02:29Z.
What
fetestexceptmeasured on a retail PS5 (firmware 13.60) with a homebrew probe callinglibSceLibcInternal.sprxfrom a payload process. The source and console log are in this gist (fenv). Split from #10129.fetestexcept. The console returns the x87 status word and MXCSR ORed and masked only by its argument:fetestexcept(0xffff)gave0x9fc1. Before, the result was also masked to 0x3f. Everything else measured already matched: the rounding constants (0, 0x400, 0x800, 0xc00),fesetroundreturning -1 and changing nothing for 1, 0x401, 0x1000 and -1,fegetroundreading the x87 bits, the exception values and the 2-bytefexcept_t. The debt entry now says they are measured.Tested
Windows 11, MinGW (winlibs).
guest_floating_pointchecksfetestexcept(0xffff). It fails onmainand passes three runs in a row with the change.tools/check_conventions.pypasses.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T12:16:42Z.
Review: APPROVED
Reviewed exact head
815a9e0289a8f4af11e6dc669dcdd0e8876427ad. The implementation removes only the additional0x3fclamp after combining x87 status and MXCSR and applying the caller mask; the regression checks the full requested mask against the captured machine state while existing tests continue to cover the six exception flags. The reported PS5 probe result is0x9fc1for mask0xffff. All policy checks and relinker jobs on Ubuntu, Windows and both macOS architectures pass, as do ASAN and the register-context/write-watch jobs; Linux/Windows product jobs were skipped by path policy. The author reports the focused Windows test fails on main and passes three runs with the patch; I could not independently run the C++ suite because no build tree is configured here.