feat(libc): implement 64-bit atomic fetch helpers #11729

Merged
iAbdulrrahman merged 1 commit from upstream-pr/11729 into main 2026-10-28 16:35:50 +00:00
iAbdulrrahman commented 2026-10-27 06:05:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by iAbdulrrahman on 2026-10-27T06:05:53Z.


What

Implement the 64-bit atomic fetch helpers _Fetch_add_8 (JbQw6W62UwI), _Fetch_and_8 (pxFnS1okTFE), _Fetch_or_8 (ixWEOmOBavk), and _Fetch_xor_8 (YhaOeniKcoA) in libc, completing the set of Dinkumware sequential bitwise and arithmetic fetch exports. Extend guest_dinkumware_fetch_tests to cover width 8 and add, verifying returned original values, bitwise results, neighboring storage bounds, concurrency, and sequential consistency ordering litmus tests for unpatched and patched libraries.

Tested

Windows 11:

  • guest_dinkumware_fetch_tests passed for all operations (add, and, or, xor) at width 8, as well as widths 1, 2, and 4 on unpatched and patched libc.prx.
  • tools/check_conventions.py --base origin/main passed.
  • tools/pr_overlap.py --branch feat/libc-fetch-64-bit-atomics confirmed zero overlap with all open pull requests.

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:5029422852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11729). Originally posted by [iAbdulrrahman](https://github.com/iAbdulrrahman) on 2026-10-27T06:05:53Z. --- ### What Implement the 64-bit atomic fetch helpers `_Fetch_add_8` (`JbQw6W62UwI`), `_Fetch_and_8` (`pxFnS1okTFE`), `_Fetch_or_8` (`ixWEOmOBavk`), and `_Fetch_xor_8` (`YhaOeniKcoA`) in `libc`, completing the set of Dinkumware sequential bitwise and arithmetic fetch exports. Extend `guest_dinkumware_fetch_tests` to cover width 8 and `add`, verifying returned original values, bitwise results, neighboring storage bounds, concurrency, and sequential consistency ordering litmus tests for unpatched and patched libraries. ### 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. --> Windows 11: - `guest_dinkumware_fetch_tests` passed for all operations (`add`, `and`, `or`, `xor`) at width 8, as well as widths 1, 2, and 4 on unpatched and patched `libc.prx`. - `tools/check_conventions.py --base origin/main` passed. - `tools/pr_overlap.py --branch feat/libc-fetch-64-bit-atomics` confirmed zero overlap with all open pull requests. ### 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
MarcZX10 commented 2026-10-27 06:26:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T06:26:12Z.

Review: APPROVED


Reviewed exact head 9f77f256a9d7578fc58c58f98ba9a6b86b9c2930. I built the exact guest_dinkumware_fetch_tests target and ran the full guest_dinkumware_fetch_ CTest group locally: all 26 raw/patched tests across existing widths and the new 64-bit helpers passed. This includes return values, arithmetic/bitwise results, guarded neighbors, concurrent history, and the ordering litmus. git diff --check and the current-base conventions check pass. Hosted eligibility, intake, labels, conventions, report, and relinker checks pass; product Linux/Windows jobs are skipped by path policy, and one unrelated macOS Intel Release registration job is still queued. The author also reports the Windows raw/patched tests passing. I found no blocker and approve.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5663053559 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11729#pullrequestreview-5663053559). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T06:26:12Z. **Review:** APPROVED --- Reviewed exact head `9f77f256a9d7578fc58c58f98ba9a6b86b9c2930`. I built the exact `guest_dinkumware_fetch_tests` target and ran the full `guest_dinkumware_fetch_` CTest group locally: all 26 raw/patched tests across existing widths and the new 64-bit helpers passed. This includes return values, arithmetic/bitwise results, guarded neighbors, concurrent history, and the ordering litmus. `git diff --check` and the current-base conventions check pass. Hosted eligibility, intake, labels, conventions, report, and relinker checks pass; product Linux/Windows jobs are skipped by path policy, and one unrelated macOS Intel Release registration job is still queued. The author also reports the Windows raw/patched tests passing. I found no blocker and approve.
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!11729
No description provided.