feat(libc): implement __powidf2 #2158
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2158"
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 reyani-dev on 2026-10-09T10:15:27Z.
What
Implements
__powidf2(NIDH+8UBOwfScI), replacing thelibcCyberUnknown08stub. It was one of the functions in #492, split out as suggested in that review.double __powidf2(double a, int b), as in compiler-rtlib/builtins/powidf2.cand libgcclibgcc2.c.INT_MIN, return1 / rwithout negating the exponent.Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON:guest_math_tests, next toexp2:x^0,2^10,(-2)^3,2^-2,2^INT_MIN == 0,0.5^INT_MIN == inf,(-1)^INT_MAX == -1, NaN propagation;1.1^4,1.1^5and1.1^-4must equal the square-and-multiply products;__builtin_powi(libgcc__powidf2) for every exponent from -40 to 40.guest_mathfail, so the test pins the rounding.ctest -R guest_mathpasses.tools/check_conventions.pypasses, andtools/pr_overlap.py --branchreports no conflict with other open PRs.cmake --build build --target libsbuilds and NID-patches every library; the patchedlibc.prxexportsH+8UBOwfScI, andtools/nid_names.pyno longer lists it.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T10:16:13Z.
Progress report (
51f69aa→ef27d8f)📈 System libraries: 84.72% (+0.03%, +1 implemented, -1 removed functions)
✅ 1 implemented
__powidf2_nid_postfix🗑️ 1 removed
libcCyberUnknown08Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T10:19:57Z.
I reviewed the full diff against LLVM compiler-rt's
powidf2implementation. The square-and-multiply loop and reciprocal handling match the reference, and the signed halving avoids negatingINT_MIN. I found no correctness issue in the implementation or test diff.The current upstream checks ran eligibility, conventions and the relinker matrix; Linux and Windows full-build jobs were skipped. Since this changes a system library, CONTRIBUTING requires the full build and relevant runtime tests. Please arrange a collaborator-triggered Build on this head before final review; I have not submitted an approval while those checks are absent.
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T11:24:32Z.
@MarcZX100 thanks for the review. Full Linux and Windows builds and tests for this head (
ef27d8fe), using the project's Build workflow. I can't start the upstream manual run, so I ran the samebuild.ymlin my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into currentmain(d70b8998):ctest: 516/516 passedctest: 507/507 passedRun: https://github.com/AchrafReyani/AnyPS5/actions/runs/37920402135
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T15:28:22Z.
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)core/libs/prx/libc/Export.cppL69-77Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:09:10Z.
Closing: the only evidence is that Cyberpunk 2077 imports
__powidf2, and no title is shown reaching the stub on main. The implementation itself looks right, so please reopen with the title ID and the log line once one stops there.Pull request closed