Skip to content

feat(libc): implement __powidf2 for Cyberpunk imports - #4378

Closed
MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/carry-libc-abs-powidf2-3161
Closed

MarcZX10 wants to merge 1 commit into
boykopovar:mainfrom
MarcZX10:codex/carry-libc-abs-powidf2-3161

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

Completes #3161. Current main already has abs; this change adds the missing __powidf2 integer-power helper as the SDK's Clang compiler-rt implementation and removes the stale H+8UBOwfScI placeholder, which has the same NID. The exponent magnitude is handled as unsigned, including INT_MIN. The existing float helper is unchanged. TechnicalDebt records the assumed compiler-rt behavior and its underflow difference from pow.

The implementation is carried from screamm’s ready branch, with the original author preserved.

Tested

  • Linux, GCC 12.2, Release, BUILD_TESTING=ON: configured successfully.
  • Built guest_math_tests; ctest -R '^guest_math$': 1/1 passed.
  • python3 tools/nid_names.py --nid 'H+8UBOwfScI' --json identifies __powidf2 as already implemented.
  • python3 tools/check_conventions.py --base upstream/main: passed.
  • git diff --check: passed.
  • Windows and macOS: not tested locally.

Checklist

  • Based on current main; no other open PR implements this function
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes; carried from the original implementation with authorship preserved

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Progress report (1acfa7f → f9fe59f)

📈 System libraries: 86.39% (+0.03%, +1 implemented, -1 removed functions)

✅ 1 implemented
Library Name
libc __powidf2_nid_postfix
🗑️ 1 removed
Library Name
libc libcCyberUnknown08

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#2465 __powidf2_nid_postfix

@xXPBSXx

xXPBSXx commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Windows test: head 41b598a8a merged onto current main 3d8ffeb27 (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j4: full build 0 errors; ctest (guest_math): 1/1 passed; python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main, authorship unchanged (only a TechnicalDebt.md union conflict; both entries kept).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 954/954 passed

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/4378
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Carry the implementation from screamm/feat/libc-abs-powidf2, based on compiler-rt powidf2. Current main already implements abs; remove its stale H+8UwfScI placeholder and let the __powidf2 NID resolve to this implementation.

Original commit: 2842273 (feat(libc): implement abs and __powidf2)
@MarcZX10
MarcZX10 force-pushed the codex/carry-libc-abs-powidf2-3161 branch from 7366b1c to f9fe59f Compare October 12, 2026 18:49
@oneandonlydean oneandonlydean self-assigned this Oct 12, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: no title is shown calling __powidf2 (H+8UBOwfScI), which is why #4229 was closed shortly before this was opened, and #2465 is open for the same export. Reopen with the title ID and the line where it throws on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs libc needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants