feat(libc): implement abs and __powidf2 #4229
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4229"
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 MarcZX10 on 2026-10-12T01:48:18Z.
What
Implement the
absand__powidf2libc exports imported by Cyberpunk 2077.abs(INT_MIN)follows FreeBSD's observed choice to returnINT_MIN;__powidf2uses compiler-rt's integer-exponent square-and-multiply behavior. Add bit and edge-case regression checks and document the behavior in TechnicalDebt. Carried from #3161's Linux-verified rebased branch, with its original commit author preserved. The patch is rebased onto current main and retains the current__powisf2implementation and tests.Tested
python3 tools/check_conventions.py --base upstream/main --head HEAD— passed.git diff --check upstream/main...HEAD— passed.guest_mathpassing on Windows and Linux; its rebased Linux run reports 520/520 in the full test subset.Checklist
main; reviewed overlapping Math.cpp and GuestMath.cpp changes.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T01:48:23Z.
Carried the #3161 implementation from the Linux-verified rebased branch onto current main. Its initial cherry-pick conflicted with current __powisf2 and TechnicalDebt edits; I merged those contexts and retained both changes plus all tests. Conventions and diff checks pass. The issue reports focused guest_math validation on Linux and Windows.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T01:48:44Z.
Progress report (
d371ed3→0fb168b)📈 System libraries: 86.48% (+0.01%, +1 implemented functions)
✅ 1 implemented
__powidf2_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T01:55:08Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)__powidf2_nid_postfixcore/libs/prx/libc/src/Math.cppL38-39, L147-159docs/dev/TechnicalDebt.mdL680docs/dev/TechnicalDebt.mdL680core/libs/tests/GuestMath.cppL465docs/dev/TechnicalDebt.mdL680core/libs/prx/libc/src/Math.cppL38-39Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T07:46:54Z.
Closing: this doesn't build.
abs_nid_postfixis already on main (core/libs/prx/libc/src/Math.cpp:90,e2b11c2dd8) and the branch defines it a second time atMath.cpp:39, andH+8UBOwfScIis still exported aslibcCyberUnknown08inExport.cpp.__powidf2is #2465's, and no title is shown calling it.Pull request closed