feat(libc): implement long double, Bessel and integer math exports #7284

Closed
T3cm0 wants to merge 1 commit from upstream-pr/7284 into main
T3cm0 commented 2026-10-17 21:18:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by T3cm0 on 2026-10-17T21:18:10Z.


What

Implements acoshl, asinhl, atanhl, atan2l, cbrtl, erfl, erfcl, expm1l, log1pl, log2l, lgammal, tgammal, hypotl, hypot3, hypot3f, hypot3l, j0f, j1f, jnf, y0f, y1f, ynf, labs, llabs, imaxabs, imaxdiv, scalbnl and significandf. hypot3* follow the Dinkumware code of the console's decrypted libSceLibcInternal.sprx (SDK 4.5x build of J03950001) (the first NaN is returned, an infinity gives +inf, otherwise the largest magnitude is combined with the hypot of the other two); lgammal leaves signgam alone as the console does. The transcendental functions use the host C library, so the last bits can differ from the console; this is in the debt file.

Tested

Windows 11 (MinGW GCC 15.2) and Ubuntu 26.04 on WSL2 (GCC 15.2), Release builds: ctest for guest_math passes on both, with all of this batch applied together and on its own. Compared with the console's own exports on a PS5 (firmware 13.60) from a homebrew payload that resolves them by NID: the special values and NaN ordering of every function in the test; the results match this implementation except where the debt file says otherwise. Not tested with a title.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4904006782 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7284). Originally posted by [T3cm0](https://github.com/T3cm0) on 2026-10-17T21:18:10Z. --- ### What Implements `acoshl`, `asinhl`, `atanhl`, `atan2l`, `cbrtl`, `erfl`, `erfcl`, `expm1l`, `log1pl`, `log2l`, `lgammal`, `tgammal`, `hypotl`, `hypot3`, `hypot3f`, `hypot3l`, `j0f`, `j1f`, `jnf`, `y0f`, `y1f`, `ynf`, `labs`, `llabs`, `imaxabs`, `imaxdiv`, `scalbnl` and `significandf`. `hypot3*` follow the Dinkumware code of the console's decrypted `libSceLibcInternal.sprx` (SDK 4.5x build of `J03950001`) (the first NaN is returned, an infinity gives +inf, otherwise the largest magnitude is combined with the hypot of the other two); `lgammal` leaves `signgam` alone as the console does. The transcendental functions use the host C library, so the last bits can differ from the console; this is in the debt file. ### Tested Windows 11 (MinGW GCC 15.2) and Ubuntu 26.04 on WSL2 (GCC 15.2), Release builds: `ctest` for guest_math passes on both, with all of this batch applied together and on its own. Compared with the console's own exports on a PS5 (firmware 13.60) from a homebrew payload that resolves them by NID: the special values and NaN ordering of every function in the test; the results match this implementation except where the debt file says otherwise. Not tested with a title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-17 21:18:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T21:18:25Z.


Thank you for your contribution! Authors with no pull requests merged into main can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241250205 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7284#issuecomment-6241250205). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T21:18:25Z. --- Thank you for your contribution! Authors with no pull requests merged into `main` can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.

Pull request closed

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!7284
No description provided.