3 Commits
Author SHA1 Message Date
Akul Tyagi 2fa97c7db0 test(libc): cover integer builtins edge cases
Add edge case test rows in guest_integer_builtins for zero shifts, cross-word shift boundaries, zero bitcounts, comparison symmetry, arithmetic identities, division boundary and wrapping cases.
2026-10-19 22:38:38 +05:30
hypermistandClaude Opus 5.5 667e8ad80c fix(libc): count zero bits of zero like the console's __clz and __ctz builtins
The libc.prx bundled with PPSA08427 returns 32 from __clzdi2 and __ctzdi2 and
64 from __clzti2 and __ctzti2 for a zero argument; found by comparing every
builtin against it on random inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
2026-10-16 00:51:46 +13:00
hypermistandClaude Opus 5.5 0d62d4ee1a feat(libc): implement the compiler-rt integer builtins
Shifts, bit counts, comparisons, negation, multiplication, division and
remainder, __udivmodti4, the overflow-reporting __mulo* and the overflow
checking __addv*/__subv*/__mulv*/__negv*/__absv* families. Where the libc.prx
bundled with PPSA08427 differs from compiler-rt it is followed: __addv* and
__subv* wrap, and the 32-bit unsigned division returns 0 for a zero divisor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
2026-10-16 00:30:58 +13:00