feat(libc): implement div #718
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/718"
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 adriadam10 on 2026-10-05T17:53:58Z.
What
Implements libc
div(NID2gbcltk3swE, hash-verified withtools/nid_names.py), until now thelibcCyberUnknown00stub that threw.Behaviour is the C standard (C11 7.22.6.2): quotient truncated toward zero, remainder with the sign of the numerator,
quot * denom + rem == numer.div_tis twoints returned inraxunder the SysV ABI, same layout as the host'sstd::div_t.Tested
Linux, GCC Release.
guest_mathgains cases for both operand signs andINT_MIN / 10; values from the standard's rules, not from our output. Onmainthe test aborts (the stub throws). Negative check: flipping the remainder sign for negative numerators makes it fail. Checked thatlibc.prxexports2gbcltk3swE.ctest -R 'guest_|libc': 95/95 pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.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-05T17:54:23Z.
Progress report (
0518f0e→afe2b14)📈 System libraries: 79.24% (+0.03%, +1 implemented, -1 removed functions)
✅ 1 implemented
div_nid_postfix🗑️ 1 removed
libcCyberUnknown00