feat(libc): implement __powidf2 #5174

Merged
AkulTyagi11 merged 1 commit from upstream-pr/5174 into main 2026-10-13 14:09:23 +00:00
AkulTyagi11 commented 2026-10-13 13:53:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AkulTyagi11 on 2026-10-13T13:53:11Z.


What

The H+8UBOwfScI import was a throwing stub (libcCyberUnknown08). Hash verification from tools/nid_names.py resolves it to __powidf2, the double-precision integer power helper that complements __powisf2.

Implemented in Math.cpp and covered by GuestMath.cpp tests.

Tested

GuestMath test suite (positive powers, negative powers, odd/even negative bases, 0^0, NaN, INT_MIN/INT_MAX exponents, signed zeroes and division limits).

Checklist

  • Based on current main; no other open PR implements the same functions
  • 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 under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4844296826 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5174). Originally posted by [AkulTyagi11](https://github.com/AkulTyagi11) on 2026-10-13T13:53:11Z. --- ### What The `H+8UBOwfScI` import was a throwing stub (`libcCyberUnknown08`). Hash verification from `tools/nid_names.py` resolves it to `__powidf2`, the double-precision integer power helper that complements `__powisf2`. Implemented in `Math.cpp` and covered by `GuestMath.cpp` tests. ### Tested `GuestMath` test suite (positive powers, negative powers, odd/even negative bases, 0^0, NaN, INT_MIN/INT_MAX exponents, signed zeroes and division limits). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-13 14:00:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T14:00:47Z.


Progress report (e152ba8 → b4e2ee0)

📈 System libraries: 88.03% (+0.02%, +1 implemented, -1 removed functions)

✅ 1 implemented
Library Name
libc __powidf2_nid_postfix
🗑️ 1 removed
Library Name
libc libcCyberUnknown08
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6147292380 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5174#issuecomment-6147292380). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T14:00:47Z. --- <!-- progress-report --> ### Progress report (e152ba8 → b4e2ee0) 📈 **System libraries**: 88.03% (+0.02%, +1 implemented, -1 removed functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libc | `__powidf2_nid_postfix` | </details> <details> <summary>🗑️ 1 removed</summary> | Library | Name | | - | - | | libc | `libcCyberUnknown08` | </details>
adriadam10 commented 2026-10-13 14:02:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:02:51Z.


Checked: H+8UBOwfScI hashes to __powidf2; the implementation matches compiler-rt's square-and-multiply with reciprocal for negative exponents (INT_MIN handled via unsigned negation); guest_math passes locally and the new rows fail to link without the change. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6147334274 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5174#issuecomment-6147334274). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T14:02:51Z. --- Checked: `H+8UBOwfScI` hashes to `__powidf2`; the implementation matches compiler-rt's square-and-multiply with reciprocal for negative exponents (INT_MIN handled via unsigned negation); `guest_math` passes locally and the new rows fail to link without the change. Merging once the full Build is green.
github-actions[bot] commented 2026-10-13 14:08:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T14:08:47Z.


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
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6147451174 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5174#issuecomment-6147451174). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T14:08:47Z. --- <!-- pr-overlap --> 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` | |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5174
No description provided.