docs(relinker): record what Rosetta executes on an M5 #7143

Merged
javierUDP merged 1 commit from upstream-pr/7143 into main 2026-10-17 14:24:14 +00:00
javierUDP commented 2026-10-17 13:34:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-17T13:34:54Z.


What

The Rosetta conversion limits in Rosetta conversion limits come from an M1 running macOS 15.3.1 and an M5 Max. This records a survey on a second host, an M5 running macOS 26.4, so the entry says which host each observation comes from.

Each instruction runs in its own x86-64 process built with clang -arch x86_64; a process that exits normally executed it, and one killed by SIGILL did not. CPUID leaves 1, 7 and 0x80000001 are read the same way.

M5, macOS 26.4
ANDN, BEXTR, BLSI, BLSR, BLSMSK, TZCNT execute
BZHI, MULX, PDEP, PEXT, RORX, SARX, SHLX, SHRX execute
LZCNT, POPCNT, PREFETCHW, CLFLUSHOPT, MOVBE execute
AVX, AVX2, FMA, F16C execute
RDRAND, RDTSCP execute, RDTSCP leaves 0xAAAAAAAB in ECX
RDSEED, CLWB, RDPID, ADCX, ADOX SIGILL
EXTRQ, INSERTQ, MOVNTSS, SHA1RNDS4, SHA256RNDS2, CLZERO, MONITORX, RDPRU SIGILL

CPUID on that host: leaf 1 ECX 0298220f (no FMA, MOVBE, XSAVE, OSXSAVE, AVX, F16C or RDRAND), leaf 7 EBX 00000000, leaf 0x80000001 ECX 00000001 (no LZCNT, SSE4A or PREFETCHW). XGETBV reads XCR0 0000000000000007 although OSXSAVE is not reported.

So ANDN and RDRAND, which fault on the M1, execute here, and RDPID raises an illegal instruction rather than returning a value, which is what the substitution avoids. The instructions --to-intel converts all raise an illegal instruction, as the conversions assume.

Tested

Apple M5, macOS 26.4, AppleClang 21.0.0, on current main. Documentation only, no build output changes.

  • The survey above, run under Rosetta.
  • python3 tools/check_conventions.py --base origin/main passes.

The M1 and M5 Max observations already in the entry were not re-run; neither host was available.

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: n/a, documentation only
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source: n/a
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4900486970 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7143). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-17T13:34:54Z. --- ### What The Rosetta conversion limits in [Rosetta conversion limits](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/debt/relinker.md) come from an M1 running macOS 15.3.1 and an M5 Max. This records a survey on a second host, an M5 running macOS 26.4, so the entry says which host each observation comes from. Each instruction runs in its own x86-64 process built with `clang -arch x86_64`; a process that exits normally executed it, and one killed by `SIGILL` did not. CPUID leaves 1, 7 and 0x80000001 are read the same way. | | M5, macOS 26.4 | | --- | --- | | ANDN, BEXTR, BLSI, BLSR, BLSMSK, TZCNT | execute | | BZHI, MULX, PDEP, PEXT, RORX, SARX, SHLX, SHRX | execute | | LZCNT, POPCNT, PREFETCHW, CLFLUSHOPT, MOVBE | execute | | AVX, AVX2, FMA, F16C | execute | | RDRAND, RDTSCP | execute, RDTSCP leaves 0xAAAAAAAB in ECX | | RDSEED, CLWB, RDPID, ADCX, ADOX | SIGILL | | EXTRQ, INSERTQ, MOVNTSS, SHA1RNDS4, SHA256RNDS2, CLZERO, MONITORX, RDPRU | SIGILL | CPUID on that host: leaf 1 ECX `0298220f` (no FMA, MOVBE, XSAVE, OSXSAVE, AVX, F16C or RDRAND), leaf 7 EBX `00000000`, leaf 0x80000001 ECX `00000001` (no LZCNT, SSE4A or PREFETCHW). `XGETBV` reads XCR0 `0000000000000007` although OSXSAVE is not reported. So ANDN and RDRAND, which fault on the M1, execute here, and RDPID raises an illegal instruction rather than returning a value, which is what the substitution avoids. The instructions `--to-intel` converts all raise an illegal instruction, as the conversions assume. ### Tested Apple M5, macOS 26.4, AppleClang 21.0.0, on current `main`. Documentation only, no build output changes. - The survey above, run under Rosetta. - `python3 tools/check_conventions.py --base origin/main` passes. The M1 and M5 Max observations already in the entry were not re-run; neither host was available. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file: n/a, documentation only - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source: n/a - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Destroyers212x commented 2026-10-17 13:37:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Destroyers212x on 2026-10-17T13:37:15Z.


Adding a data point from a second chip that may help with the wording. It's the same chip generation as the M1 on macOS 15.3.1, but on a newer macOS.

M1, macOS 26.6.2. Same method: each instruction runs in its own forked x86-64 process built with clang -arch x86_64. A process that exits normally executed the instruction; one killed by SIGILL did not.

M1, macOS 26.6.2
ANDN, BEXTR, BLSI, BLSMSK, BLSR, TZCNT, LZCNT, POPCNT execute
BZHI, MULX, PDEP, PEXT, RORX, SARX, SHLX, SHRX execute
MOVBE, FMA, AVX2, F16C, RDRAND, RDTSCP execute
RDSEED, RDPID, CLWB, ADCX, ADOX SIGILL

Under Rosetta, machdep.cpu.features (leaf 1) lists none of MOVBE, FMA, AVX or F16C. I did not read leaf 7 or 0x80000001.

ANDN and RDRAND faulted on an M1 with macOS 15.3.1 but execute on this M1 with 26.6.2. So that difference seems to come from the Rosetta version, not the chip, and the entry could attribute it to the macOS version. If it's useful, feel free to fold this into this PR. I won't open a separate one on the same line.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234533479 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7143#issuecomment-6234533479). Originally posted by [Destroyers212x](https://github.com/Destroyers212x) on 2026-10-17T13:37:15Z. --- Adding a data point from a second chip that may help with the wording. It's the same chip generation as the M1 on macOS 15.3.1, but on a newer macOS. **M1, macOS 26.6.2.** Same method: each instruction runs in its own forked x86-64 process built with `clang -arch x86_64`. A process that exits normally executed the instruction; one killed by `SIGILL` did not. | | M1, macOS 26.6.2 | | --- | --- | | ANDN, BEXTR, BLSI, BLSMSK, BLSR, TZCNT, LZCNT, POPCNT | execute | | BZHI, MULX, PDEP, PEXT, RORX, SARX, SHLX, SHRX | execute | | MOVBE, FMA, AVX2, F16C, RDRAND, RDTSCP | execute | | RDSEED, RDPID, CLWB, ADCX, ADOX | SIGILL | Under Rosetta, `machdep.cpu.features` (leaf 1) lists none of MOVBE, FMA, AVX or F16C. I did not read leaf 7 or 0x80000001. ANDN and RDRAND faulted on an M1 with macOS 15.3.1 but execute on this M1 with 26.6.2. So that difference seems to come from the Rosetta version, not the chip, and the entry could attribute it to the macOS version. If it's useful, feel free to fold this into this PR. I won't open a separate one on the same line. AI-assisted: yes (Claude Code)
github-actions[bot] commented 2026-10-17 13:46:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T13:46:31Z.


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
PR 6111 docs/dev/debt/relinker.md L20

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 docs/dev/debt/relinker.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234629709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7143#issuecomment-6234629709). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T13:46:31Z. --- <!-- 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 | |---|---|---|---| | [PR 6111](https://www.github.com/boykopovar/AnyPS5/pull/6111) | `docs/dev/debt/relinker.md` [L20](https://github.com/boykopovar/AnyPS5/blob/47a266cf975f00f7fba94013467d03bfa5e355e9/docs/dev/debt/relinker.md#L20) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `docs/dev/debt/relinker.md` |
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!7143
No description provided.