fix(libc): follow msun for acoshf #10003

Merged
MarcZX10 merged 3 commits from upstream-pr/10003 into main 2026-10-24 11:24:45 +00:00
MarcZX10 commented 2026-10-23 03:45:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T03:45:37Z.


What

acoshf currently forwards to the Windows host library. The #9707 survey reports 216,017 and 216,024 result-bit differences from the two bundled libc.prx builds over 20 million inputs. This ports FreeBSD msun's e_acoshf.c range handling and reuses the existing log1pf path for inputs near 1. The invalid-domain path raises FE_INVALID without setting errno, as the source does.

The survey establishes host-versus-title differences, not the exact implementation used by every console library. The exact system libSceLibcInternal behavior and FMA-contracted libc.prx results remain unverified, as recorded in the debt entry.

Tested

  • Linux, GCC 12.2: compiled Math.cpp and GuestMath.cpp.
  • A focused Linux harness passed the boundary and special-value cases, including invalid-domain FE_INVALID and unchanged errno; 1,000,000 random finite inputs stayed within 2 ULP of double-precision std::acosh rounded to float.
  • MinGW GCC: GuestMath.cpp compiled.
  • The complete guest_math target was not run.
  • check_conventions.py, pr_overlap.py and git diff --check passed.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4977492668 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10003). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T03:45:37Z. --- ### What `acoshf` currently forwards to the Windows host library. The #9707 survey reports 216,017 and 216,024 result-bit differences from the two bundled `libc.prx` builds over 20 million inputs. This ports FreeBSD msun's `e_acoshf.c` range handling and reuses the existing `log1pf` path for inputs near 1. The invalid-domain path raises `FE_INVALID` without setting `errno`, as the source does. The survey establishes host-versus-title differences, not the exact implementation used by every console library. The exact system `libSceLibcInternal` behavior and FMA-contracted `libc.prx` results remain unverified, as recorded in the debt entry. ### Tested - Linux, GCC 12.2: compiled `Math.cpp` and `GuestMath.cpp`. - A focused Linux harness passed the boundary and special-value cases, including invalid-domain `FE_INVALID` and unchanged `errno`; 1,000,000 random finite inputs stayed within 2 ULP of double-precision `std::acosh` rounded to float. - MinGW GCC: `GuestMath.cpp` compiled. - The complete `guest_math` target was not run. - `check_conventions.py`, `pr_overlap.py` and `git diff --check` passed. ### 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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
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!10003
No description provided.