fix(libc): compute acosl with FreeBSD msun's ld80 code as the bundled libc.prx does #11260

Merged
AlexFigas merged 6 commits from upstream-pr/11260 into main 2026-11-06 11:48:49 +00:00
AlexFigas commented 2026-10-25 22:53:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexFigas on 2026-10-25T22:53:41Z.


What

acosl called the host std::acos. Over 20 million random arguments in (-1, 1), the host result differed from the console's on 1,603,469 of them. This PR replaces it with FreeBSD msun's e_acosl.c (ld80), which is the acosl of the libc.prx that PPSA21564 bundles (0x3e5a0, the library's own code). That binary follows e_acosl.c branch for branch:

  • |x| ≥ 1. For ±1 (exponent 0x3fff, fraction 0) it returns 0 or pi + 2*pio2_lo. For anything else, including the infinities and NaN, it calls _Feraise(1), then returns (x - x) / (x - x). _Feraise (0x11b00) raises FE_INVALID and sets errno to EDOM (0x21).
  • |x| < 0.5. Below exponent 0x3fbe it returns pio2_hi + pio2_lo. Otherwise it returns pio2_hi - (x - (pio2_lo - x*r)), with r = P(x²)/Q(x²).
  • x ≤ -0.5. z = (1 + x) * 0.5, s = fsqrt(z), and the result is pi - 2*(s + (r*s - pio2_lo)).
  • x ≥ 0.5. As above, with df = s whose low 32 mantissa bits are cleared, c = (z - df²)/(s + df), and the result is 2*(df + (r*s + c)).

P, Q, pio2_hi and pio2_lo are the ld80 invtrig.c constants. asinl already reproduces them in Math.cpp (AsinNumerator, AsinDenominator, HalfPiHigh, HalfPiLow), and the binary holds the same 80-bit values. pi is the e_acosl.c constant (0xc90fdaa22168c235:4000 in the binary), and the port reads it from memory as the binary does: as a compile-time constant, GCC loads it with fldpi, which rounds by the current mode, so under round-downward or toward-zero at 64 bits the results below -0.5 and acosl(-1) could come out one bit low (51,708 of 5,000,000 arguments). The port reuses those helpers and adds Pi.

x87 precision. The binary's acosl has no instruction that reads or sets the x87 control word (no fnstcw, fldcw, fldenv or fninit), so it computes at the caller's precision and leaves the control word as it found it. That is the FreeBSD source on amd64: e_acosl.c does not use ENTERI()/RETURNI(), and those are empty outside i386 anyway (math_private.h). The port does the same. One difference had to go: pio2_hi + pio2_lo and pi + 2*pio2_lo are added at run time in the binary, because pio2_hi and pio2_lo are invtrig.c externs, so at 53 bits they round to 53 bits; GCC folded them at 64 bits. The port now adds them through SumAtCallerPrecision, which reads the first half through a volatile. Everything else already ran at run time.

The acosl debt entry keeps what is still open: it runs at the caller's precision, so on a guest thread that starts at 53 bits (the thread-start gap the asinl entry records) it returns the binary's 53-bit result, not the console's 64-bit one; other SDK versions are not compared. The next entry no longer says "as acosl is".

Licence. e_acosl.c's copyright notice is copied verbatim directly above acosl, as Math.cpp already does for the msun code of sinh. Like that copy, it keeps the source's trailing space after "this notice", the only line git diff --check reports.

Tested

On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), head 0de3168b81, which merges main 813f46cd68 into the previous head 39fb738477 (main a4eca2a056). The merge has one conflict, in Math.cpp: #12366 rewrote fdim and fdimf right above the host acosl line, so the resolution keeps main's fdim and fdimf, this PR's notice and acosl, and drops the host acosl. 39fb738477 resolved a debt-file conflict with #11077's frexp entry; 84502b855f merged main cc26ab4438 after a commit that drops the trailing space from the e_acosl.c notice, so git diff --check passes; 8365772e47 was rebased onto main 2227f13661:

  • This head's libc.prx. Against the binary, 5,000,000 arguments of every kind (|x| > 1, NaNs and non-canonical encodings included) at each of 64, 53 and 24 bits, under each rounding mode, give the same result, NaN bits, errno and flags, and the control word is unchanged after every call (60,000,000 in all).
  • Native comparison (the port's code compiled into the harness, before this head). I mapped the text and read-only segments of PPSA21564's libc.prx into an executable buffer and called its acosl (0x3e5a0) directly; arguments below 1 in magnitude never reach an import. Against this port it gives the same 80 bits for 20,000,000 random arguments plus the exponent edges (0x3fbc–0x3fbf, 0x3ffd, 0x3ffe, ±0, ±1), with 0 mismatches, at each of 64-, 53- and 24-bit precision (control words 0x37f, 0x27f and 0x07f, set before both are called). The host acosl mismatches on 1,603,469 of the same arguments at 64 bits. Before SumAtCallerPrecision, the 53-bit run mismatched on 252,624 of 2,000,000, all from those two returns.
  • guest_math passes (3 runs). It gains CheckAcosl, with 22 known-answer pairs produced by that binary. Four of them were picked because the host acosl gets them wrong, for example 0xc1d51c773e6f53e1:3ffd → 0x975d54d5f258ea8a:3fff where the host gives …89. It also checks that ±1.5, ±(1 + ulp), the maximum, ±∞ and NaN return NaN with EDOM and FE_INVALID. Six arguments, one or two per branch, also run at 53 bits through ExtendedBitsAt53Bits, which sets the precision field to 53 bits, calls the export, reads the control word back and restores the caller's; each must give the binary's 53-bit result and leave the control word unchanged. With the sums folded again, it aborts at 0x8000000000000000:3fbd. The existing acosl checks in CheckLongDouble still pass. It now also requires the binary's results for three negative arguments, -1 among them, under round-downward.
  • Conventions. python3 tools/check_conventions.py --base origin/main passes, and git diff --check is clean.
  • Overlap. python3 tools/pr_overlap.py --branch fix/libc-acosl-msun-ld80 reports #11262 and #11266, which are stacked on this PR, and oberonlift's #15802, #15803, #15804 and #15807:
    • #11077 and #12366 have merged: frexp is on main above acosl, and so are fdim and fdimf, which the merge kept.
    • #15802 (a stack opened on November 4, after this PR) changes the long double functions to a GuestLongDouble type, including the host acosl line this PR replaces, so each of #15802, #15803, #15804 and #15807 conflicts with this head in Math.cpp and libc.md where it does not with main (all four already conflict with main in libSceJobManager/Export.cpp). This PR was opened and approved first, so I have not added a dependency; the order is for that stack's author to agree.
    • The other 41 pull requests the tool could not compare, which conflict with main, give the same git merge-tree conflicts with this branch as with main.

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 (#11077 and #12366 have merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5009527010 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11260). Originally posted by [AlexFigas](https://github.com/AlexFigas) on 2026-10-25T22:53:41Z. --- ### What `acosl` called the host `std::acos`. Over 20 million random arguments in (-1, 1), the host result differed from the console's on 1,603,469 of them. This PR replaces it with FreeBSD msun's [`e_acosl.c`](https://github.com/freebsd/freebsd-src/blob/9f0432041b8fb69832f10c32da50a67f34feeb61/lib/msun/src/e_acosl.c) (ld80), which is the `acosl` of the `libc.prx` that PPSA21564 bundles (0x3e5a0, the library's own code). That binary follows `e_acosl.c` branch for branch: - **|x| ≥ 1.** For ±1 (exponent 0x3fff, fraction 0) it returns `0` or `pi + 2*pio2_lo`. For anything else, including the infinities and NaN, it calls `_Feraise(1)`, then returns `(x - x) / (x - x)`. `_Feraise` (0x11b00) raises `FE_INVALID` and sets `errno` to `EDOM` (0x21). - **|x| < 0.5.** Below exponent 0x3fbe it returns `pio2_hi + pio2_lo`. Otherwise it returns `pio2_hi - (x - (pio2_lo - x*r))`, with `r = P(x²)/Q(x²)`. - **x ≤ -0.5.** `z = (1 + x) * 0.5`, `s = fsqrt(z)`, and the result is `pi - 2*(s + (r*s - pio2_lo))`. - **x ≥ 0.5.** As above, with `df` = `s` whose low 32 mantissa bits are cleared, `c = (z - df²)/(s + df)`, and the result is `2*(df + (r*s + c))`. `P`, `Q`, `pio2_hi` and `pio2_lo` are the ld80 `invtrig.c` constants. `asinl` already reproduces them in `Math.cpp` (`AsinNumerator`, `AsinDenominator`, `HalfPiHigh`, `HalfPiLow`), and the binary holds the same 80-bit values. `pi` is the `e_acosl.c` constant (`0xc90fdaa22168c235:4000` in the binary), and the port reads it from memory as the binary does: as a compile-time constant, GCC loads it with `fldpi`, which rounds by the current mode, so under round-downward or toward-zero at 64 bits the results below -0.5 and `acosl(-1)` could come out one bit low (51,708 of 5,000,000 arguments). The port reuses those helpers and adds `Pi`. **x87 precision.** The binary's `acosl` has no instruction that reads or sets the x87 control word (no `fnstcw`, `fldcw`, `fldenv` or `fninit`), so it computes at the caller's precision and leaves the control word as it found it. That is the FreeBSD source on amd64: `e_acosl.c` does not use `ENTERI()`/`RETURNI()`, and those are empty outside i386 anyway ([`math_private.h`](https://github.com/freebsd/freebsd-src/blob/9f0432041b8fb69832f10c32da50a67f34feeb61/lib/msun/src/math_private.h#L335-L362)). The port does the same. One difference had to go: `pio2_hi + pio2_lo` and `pi + 2*pio2_lo` are added at run time in the binary, because `pio2_hi` and `pio2_lo` are `invtrig.c` externs, so at 53 bits they round to 53 bits; GCC folded them at 64 bits. The port now adds them through `SumAtCallerPrecision`, which reads the first half through a `volatile`. Everything else already ran at run time. The `acosl` debt entry keeps what is still open: it runs at the caller's precision, so on a guest thread that starts at 53 bits (the thread-start gap the `asinl` entry records) it returns the binary's 53-bit result, not the console's 64-bit one; other SDK versions are not compared. The next entry no longer says "as `acosl` is". **Licence.** `e_acosl.c`'s copyright notice is copied verbatim directly above `acosl`, as `Math.cpp` already does for the msun code of `sinh`. Like that copy, it keeps the source's trailing space after "this notice", the only line `git diff --check` reports. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), head 0de3168b81, which merges `main` 813f46cd68 into the previous head 39fb738477 (`main` a4eca2a056). The merge has one conflict, in `Math.cpp`: #12366 rewrote `fdim` and `fdimf` right above the host `acosl` line, so the resolution keeps `main`'s `fdim` and `fdimf`, this PR's notice and `acosl`, and drops the host `acosl`. 39fb738477 resolved a debt-file conflict with #11077's `frexp` entry; 84502b855f merged `main` cc26ab4438 after a commit that drops the trailing space from the `e_acosl.c` notice, so `git diff --check` passes; 8365772e47 was rebased onto `main` 2227f13661: - **This head's `libc.prx`.** Against the binary, 5,000,000 arguments of every kind (|x| > 1, NaNs and non-canonical encodings included) at each of 64, 53 and 24 bits, under each rounding mode, give the same result, NaN bits, `errno` and flags, and the control word is unchanged after every call (60,000,000 in all). - **Native comparison** (the port's code compiled into the harness, before this head). I mapped the text and read-only segments of PPSA21564's `libc.prx` into an executable buffer and called its `acosl` (0x3e5a0) directly; arguments below 1 in magnitude never reach an import. Against this port it gives the same 80 bits for 20,000,000 random arguments plus the exponent edges (0x3fbc–0x3fbf, 0x3ffd, 0x3ffe, ±0, ±1), with 0 mismatches, at each of 64-, 53- and 24-bit precision (control words 0x37f, 0x27f and 0x07f, set before both are called). The host `acosl` mismatches on 1,603,469 of the same arguments at 64 bits. Before `SumAtCallerPrecision`, the 53-bit run mismatched on 252,624 of 2,000,000, all from those two returns. - **`guest_math` passes** (3 runs). It gains `CheckAcosl`, with 22 known-answer pairs produced by that binary. Four of them were picked because the host `acosl` gets them wrong, for example `0xc1d51c773e6f53e1:3ffd → 0x975d54d5f258ea8a:3fff` where the host gives `…89`. It also checks that ±1.5, ±(1 + ulp), the maximum, ±∞ and NaN return NaN with `EDOM` and `FE_INVALID`. Six arguments, one or two per branch, also run at 53 bits through `ExtendedBitsAt53Bits`, which sets the precision field to 53 bits, calls the export, reads the control word back and restores the caller's; each must give the binary's 53-bit result and leave the control word unchanged. With the sums folded again, it aborts at `0x8000000000000000:3fbd`. The existing `acosl` checks in `CheckLongDouble` still pass. It now also requires the binary's results for three negative arguments, -1 among them, under round-downward. - **Conventions.** `python3 tools/check_conventions.py --base origin/main` passes, and `git diff --check` is clean. - **Overlap.** `python3 tools/pr_overlap.py --branch fix/libc-acosl-msun-ld80` reports #11262 and #11266, which are stacked on this PR, and oberonlift's #15802, #15803, #15804 and #15807: - #11077 and #12366 have merged: `frexp` is on `main` above `acosl`, and so are `fdim` and `fdimf`, which the merge kept. - #15802 (a stack opened on November 4, after this PR) changes the long double functions to a `GuestLongDouble` type, including the host `acosl` line this PR replaces, so each of #15802, #15803, #15804 and #15807 conflicts with this head in `Math.cpp` and `libc.md` where it does not with `main` (all four already conflict with `main` in `libSceJobManager/Export.cpp`). This PR was opened and approved first, so I have not added a dependency; the order is for that stack's author to agree. - The other 41 pull requests the tool could not compare, which conflict with `main`, give the same `git merge-tree` conflicts with this branch as with `main`. ### 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 (#11077 and #12366 have merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 23:11:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T23:11:05Z.

Review: APPROVED


Reviewed the exact head 84591b8434421fdc06a556f585313dc5bd2da4e2. The acosl implementation follows the pinned FreeBSD ld80 algorithm and its tested edge handling; the PR’s reported native comparison covers 20 million random inputs plus boundary cases. I independently checked the diff and conventions in the PR worktree earlier in this sweep; both passed. All hosted eligibility, conventions, intake, report, relinker, register-context and write-watch jobs are now green. Linux and Windows product jobs were skipped, and I did not independently run the native differential here.

I found no blocking issue in the implementation or evidence for this change, so I approve this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5645821636 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11260#pullrequestreview-5645821636). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T23:11:05Z. **Review:** APPROVED --- Reviewed the exact head `84591b8434421fdc06a556f585313dc5bd2da4e2`. The `acosl` implementation follows the pinned FreeBSD ld80 algorithm and its tested edge handling; the PR’s reported native comparison covers 20 million random inputs plus boundary cases. I independently checked the diff and conventions in the PR worktree earlier in this sweep; both passed. All hosted eligibility, conventions, intake, report, relinker, register-context and write-watch jobs are now green. Linux and Windows product jobs were skipped, and I did not independently run the native differential here. I found no blocking issue in the implementation or evidence for this change, so I approve this head.
MarcZX10 commented 2026-10-25 23:19:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T23:19:01Z.

Review: CHANGES_REQUESTED


I found an x87 precision-state gap while reviewing the follow-on atanl/exp2l ports. This acosl implementation also needs 64-bit x87 precision according to its own debt entry, but it does not scope or restore the x87 control word, and its tests do not run with the 53-bit control setting documented for guest threads (0x27f). FreeBSD's referenced ld80 routine uses ENTERI()/RETURNI() for the computation for this reason; the random comparison under the harness's default environment does not cover callers that arrive with a different precision mode. Please add a scoped precision-control path and a regression that checks the result under 53-bit precision and verifies the original control word is restored, or provide console evidence that the caller's precision mode is intentionally preserved and test both modes. I am updating my earlier approval because this correctness gap affects the stated bit-for-bit behavior. Hosted builds remain skipped for this libc-only path; the comparison and focused test results in the PR are author-reported, not independently rerun here.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5645846167 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11260#pullrequestreview-5645846167). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T23:19:01Z. **Review:** CHANGES_REQUESTED --- I found an x87 precision-state gap while reviewing the follow-on `atanl`/`exp2l` ports. This `acosl` implementation also needs 64-bit x87 precision according to its own debt entry, but it does not scope or restore the x87 control word, and its tests do not run with the 53-bit control setting documented for guest threads (`0x27f`). FreeBSD's referenced ld80 routine uses `ENTERI()`/`RETURNI()` for the computation for this reason; the random comparison under the harness's default environment does not cover callers that arrive with a different precision mode. Please add a scoped precision-control path and a regression that checks the result under 53-bit precision and verifies the original control word is restored, or provide console evidence that the caller's precision mode is intentionally preserved and test both modes. I am updating my earlier approval because this correctness gap affects the stated bit-for-bit behavior. Hosted builds remain skipped for this libc-only path; the comparison and focused test results in the PR are author-reported, not independently rerun here.
MarcZX10 commented 2026-10-27 11:00:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T11:00:27Z.

Review: CHANGES_REQUESTED


The FreeBSD msun port is backed by detailed bitwise comparisons against the bundled libc.prx, across inputs, precisions, rounding modes, errno, and exception flags. The committed known-answer cases also cover the important subnormal and non-canonical paths.

I cannot approve this submitted head against current main. Its merge-base is 68cc9d4e75, but current main is 3fea2a937b. Since that base, main has changed all three paths this PR edits: Math.cpp, GuestMath.cpp, and docs/dev/debt/libc.md. The Tested section names a run on main 5b5d24cb22, which is not the base of the submitted head, so the report does not establish that this exact diff passed on the integrated tree.

Please rebase the #11077-dependent branch onto current main, resolve the math/debt integration, and rerun guest_math plus the reference comparison on the resulting head. I found no specific arithmetic defect in the inspected cbrtl-adjacent stack code; this request is for current-tree correctness and matching test evidence before approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5665956073 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11260#pullrequestreview-5665956073). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T11:00:27Z. **Review:** CHANGES_REQUESTED --- The FreeBSD msun port is backed by detailed bitwise comparisons against the bundled libc.prx, across inputs, precisions, rounding modes, errno, and exception flags. The committed known-answer cases also cover the important subnormal and non-canonical paths. I cannot approve this submitted head against current main. Its merge-base is 68cc9d4e754d533e63a2eaab17ff80de18918269, but current main is 3fea2a937ba9fbab2f06c51691fe0c5763659aa3. Since that base, main has changed all three paths this PR edits: Math.cpp, GuestMath.cpp, and docs/dev/debt/libc.md. The Tested section names a run on main 5b5d24cb22, which is not the base of the submitted head, so the report does not establish that this exact diff passed on the integrated tree. Please rebase the #11077-dependent branch onto current main, resolve the math/debt integration, and rerun guest_math plus the reference comparison on the resulting head. I found no specific arithmetic defect in the inspected cbrtl-adjacent stack code; this request is for current-tree correctness and matching test evidence before approval.
MarcZX10 commented 2026-10-27 15:24:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T15:24:00Z.

Review: CHANGES_REQUESTED


I reviewed the current head 23a6c80b60966240bc827ecc77452cf2231467d0. The port follows the pinned FreeBSD ld80 acos branches and coefficients; the caller-precision behavior is supported by the cited binary evidence, and SumAtCallerPrecision addresses the compile-time folding issue. I found no separate arithmetic defect.

Independent focused check: I applied this PR's Math.cpp, GuestMath.cpp, and debt changes to the clean #11213-based Release checkout, rebuilt guest_math_tests, and ran guest_math three times; all passed. This is focused Linux validation on the PR's 1089f2b base plus unrelated #11213 exception changes, not a build of the current integrated main tree.

The remaining integration request is still open: #11077 is still open, and this branch is based on 1089f2b while current main is 2ee8e97 (30 commits ahead). The current-main merge preview is clean, but main has changed paths this PR edits since that base. Please update the stack after #11077 lands and rerun guest_math on the resulting integrated head before approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5669695249 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11260#pullrequestreview-5669695249). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T15:24:00Z. **Review:** CHANGES_REQUESTED --- I reviewed the current head 23a6c80b60966240bc827ecc77452cf2231467d0. The port follows the pinned FreeBSD ld80 acos branches and coefficients; the caller-precision behavior is supported by the cited binary evidence, and SumAtCallerPrecision addresses the compile-time folding issue. I found no separate arithmetic defect. Independent focused check: I applied this PR's Math.cpp, GuestMath.cpp, and debt changes to the clean #11213-based Release checkout, rebuilt guest_math_tests, and ran guest_math three times; all passed. This is focused Linux validation on the PR's 1089f2b base plus unrelated #11213 exception changes, not a build of the current integrated main tree. The remaining integration request is still open: #11077 is still open, and this branch is based on 1089f2b while current main is 2ee8e97 (30 commits ahead). The current-main merge preview is clean, but main has changed paths this PR edits since that base. Please update the stack after #11077 lands and rerun guest_math on the resulting integrated head before approval.
MarcZX10 commented 2026-10-27 15:25:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T15:25:36Z.

Review: APPROVED


Reviewed exact head 23a6c80b60966240bc827ecc77452cf2231467d0. The acosl implementation follows the pinned FreeBSD ld80 branches and coefficients; the caller-precision behavior and runtime sums are supported by the binary evidence. I found no arithmetic defect.

Independent local check: applied this PR's Math.cpp, GuestMath.cpp, and debt changes to a clean #11213-based Release checkout, built guest_math_tests, and ran guest_math three times; all passed. I did not rerun the author's native differential harness. The current-main merge preview is clean, and main has not changed the files this PR touches since its 1089f2b base.

I approve the implementation and focused test evidence. #11077 remains open and is explicitly declared as a dependency; merge this PR after that overlap is resolved in the declared order.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5669728142 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11260#pullrequestreview-5669728142). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T15:25:36Z. **Review:** APPROVED --- Reviewed exact head 23a6c80b60966240bc827ecc77452cf2231467d0. The acosl implementation follows the pinned FreeBSD ld80 branches and coefficients; the caller-precision behavior and runtime sums are supported by the binary evidence. I found no arithmetic defect. Independent local check: applied this PR's Math.cpp, GuestMath.cpp, and debt changes to a clean #11213-based Release checkout, built guest_math_tests, and ran guest_math three times; all passed. I did not rerun the author's native differential harness. The current-main merge preview is clean, and main has not changed the files this PR touches since its 1089f2b base. I approve the implementation and focused test evidence. #11077 remains open and is explicitly declared as a dependency; merge this PR after that overlap is resolved in the declared order.
MarcZX10 commented 2026-10-28 16:51:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T16:51:51Z.

Review: APPROVED


Re-reviewed exact current head 8365772e47fbce5df3fda265bd7b194ea2a4e98d. The post-approval delta adds the required e_acosl.c copyright/license notice immediately above the port; it matches FreeBSD release/11.4.0. The reviewed acosl implementation, tests and declared dependency on #11077 remain unchanged. Hosted Ubuntu, Windows, macOS, ASan, register-context and write-watch checks pass; Linux product is skipped by workflow filters. The author reports guest_math and title-binary comparisons on the new heads. No PS5 title run is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5686449981 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11260#pullrequestreview-5686449981). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T16:51:51Z. **Review:** APPROVED --- Re-reviewed exact current head `8365772e47fbce5df3fda265bd7b194ea2a4e98d`. The post-approval delta adds the required `e_acosl.c` copyright/license notice immediately above the port; it matches FreeBSD release/11.4.0. The reviewed `acosl` implementation, tests and declared dependency on #11077 remain unchanged. Hosted Ubuntu, Windows, macOS, ASan, register-context and write-watch checks pass; Linux product is skipped by workflow filters. The author reports `guest_math` and title-binary comparisons on the new heads. No PS5 title run is claimed.
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!11260
No description provided.