feat(libc): implement _Rint, _FRint and _LRint Dinkumware math helpers #12364
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12364"
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 PrivacyOnion on 2026-10-28T10:57:46Z.
What
Implement the missing PS5 3.20 math dispatch helpers
_Rint,_FRint, and_LRintinlibc, forwarding torint,rintf, andrintl, with unit tests incore/libs/tests/GuestDinkumwareInternals.cppand debt documentation indocs/dev/debt/libc.md. Provenance: libSceLibcInternal.c in DNNDHH/PS5-3.20_Libs.Tested
Windows 11, unit tests in
core/libs/tests/GuestDinkumwareInternals.cppverifying_Rint,_FRint, and_LRintdispatch and rounding results (including ties-to-even0.5 -> 0,1.5 -> 2,2.5 -> 2) againstrint,rintf, andrintl. Validated withtools/check_conventions.py,tools/check_test_registration.py, andtools/pr_overlap.py.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 BunnyFl on 2026-10-28T12:44:08Z.
Review: APPROVED
Approving head
f8b89cba1e. I read the whole diff and ran firmware 13.42's helpers: the decrypted systemlibSceLibcInternal.sprx's_Rint,_FRintand_LRint, natively on a PC (data in the comment above).rint,rintfandrintlreturn for every input tried (double bit for bit), including all the values the new tests check.TzxDRcns9e4,TLvAYmLtdVwandfJmOr59K8QY, which are the exports I ran.Only the default rounding mode was compared, so the debt entry's "not verified" still holds for flags and other modes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:31:18Z.
Review: APPROVED
Re-checked — approved
The provenance and merge-sequencing questions have been resolved. The three exports are declared with their verified NIDs and each wrapper forwards to the matching existing rint helper. I found no blocking issue in the exact current diff.
What I ran
f8b89cba1eagainst current main52c09d567d.Results
Negative control
Not run locally. The firmware comparison is reviewer-reported and uses default rounding mode only.
Findings
No blocking issue found. One useful non-blocking test addition would be to exercise the wrappers under FE_DOWNWARD, FE_UPWARD, and FE_TOWARDZERO, and to check the sign of a rounded negative zero and FE_INEXACT. The current tests cover default-mode nearest-even values; the implementation delegates directly to the corresponding rint helper, and the debt entry continues to mark console exception behavior unverified.
The author records that #12364 can land before #12363 and #12365; those branches can then be rebased onto the landed helper changes.
Sources
Not verified
To get this to a good state
No further change is required for this review. The additional rounding-mode, signed-zero, and exception assertions would strengthen the regression coverage if the behavior is claimed as verified.
Pull request closed