feat(libc): implement __modti3 #6133
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6133"
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 AkulTyagi11 on 2026-10-14T23:02:22Z.
What
Implements
__modti3, the signed 128-bit integer modulo runtime helper complementing__divti3,__udivti3and__umodti3.SonyModti3incore/libs/prx/libc/include/SonyCrt.hppusing the existing bitwise 128-bit division engine.__modti3_nid_postfixincore/libs/prx/libc/src/RuntimeSupport.cpp.core/libs/tests/GuestCrt.cppcovering sign rules, large 128-bit powers, extremes, and zero-divisor trapping.docs/dev/debt/libc.md.Tested
Windows 11, x86-64:
SonyModti3and__modti3_nid_postfixverifying truncated remainder rules for both signs, zero dividend,INT128_MIN,INT128_MAX, large powers of 2, and zero divisor exception.python tools/check_conventions.py --base origin/mainpassed with 0 errors.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 github-actions[bot] on 2026-10-14T23:03:07Z.
Progress report (
6239cef→ec2acea)📈 System libraries: 88.7% (+0.01%, +1 implemented functions)
✅ 1 implemented
__modti3_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:15:18Z.
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.
core/libs/prx/libc/src/RuntimeSupport.cppdocs/dev/debt/libc.mddocs/dev/debt/libc.mdcore/libs/tests/GuestCrt.cppdocs/dev/debt/libc.mddocs/dev/debt/libc.mdcore/libs/prx/libc/src/RuntimeSupport.cppdocs/dev/debt/libc.mdcore/libs/prx/libc/src/RuntimeSupport.cppdocs/dev/debt/libc.mdcore/libs/prx/libc/include/SonyCrt.hppcore/libs/tests/GuestCrt.cppdocs/dev/debt/libc.mdcore/libs/prx/libc/src/RuntimeSupport.cppImported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-15T21:03:53Z.
Tested on Linux x86-64 (Release build), with
ec2acea5bmerged into main4eb91eacd:guest_crtpasses.guest_crt_testscan't resolve__modti3_nid_postfix(symbol lookup error: ... undefined symbol: __modti3_nid_postfix), since main doesn't export it.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:40:38Z.
Checked
__modti3: the remainder takes the dividend's sign,INT128_MIN % -1gives 0, and a zero divisor throws like the sibling helpers (documented indocs/dev/debt/libc.md).guest_crtpasses and fails to build without the change. Confirmed on Linux by @coltken95. Merging once the full Build is green.