runtime: lower REX-prefixed and register-form SSE4a EXTRQ/INSERTQ stubs in host_cpu #1839

Merged
Ammmae0x merged 2 commits from upstream-pr/1846 into main 2026-11-24 22:02:53 +00:00
Ammmae0x commented 2026-11-24 19:26:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-24T19:26:23Z.


Change

Extends sse4a_stub() and stub_for() in tools/startup/host_cpu.py to decode and lower:

  • REX-prefixed immediate EXTRQ (66 [REX] 0F 78 /0 ib ib) and INSERTQ (F2 [REX] 0F 78 /r ib ib) across xmm0..xmm15,
  • Register-parameter EXTRQ (66 [REX] 0F 79 /r) and INSERTQ (F2 [REX] 0F 79 /r) across xmm0..xmm15, reading the bitfield width ([5:0], with 0 meaning 64) and bit offset ([13:8]) from xmm_src[63:0] for EXTRQ and xmm_src[127:64] for INSERTQ.

Both immediate and register stubs preserve RFLAGS, all general-purpose registers, and destination xmm[127:64] (including dst == src), while _sse4a_decode() rejects invalid forms (mod != 3, non-zero /reg on 66 0F 78, offset + width > 64, missing/duplicate prefixes, and truncated encodings) by returning None.

Extends tests/startup_host_cpu_check.py with REX xmm8..xmm15 immediate and 0F 79 register-form positive controls (including dst == src, length == 0 as 64, upper-64/GPR/CF preservation, and CPUID-gated native comparison when sse4a is present) as well as negative controls for invalid encodings and wrong-offset/wrong-register stubs.

Verification

Commit: f738af81

  • .\out\pe-env\Scripts\python.exe -B tests/startup_host_cpu_check.py: PASS (1162 insertq/extrq results, clzero with two moved-instruction forms, 5 clwb and 2 wait rewrites, clwb/clflushopt NOPs for every addressing form, 4 non-temporal stores, rdpru, rdpid into 7 registers, sha-1 and sha-256 of 4 messages through the seven sha operations with 112 native results; native comparison: rdpid, sha) (host CPU lacks sse4a and clzero, so native comparison ran for rdpid and sha; all 1162 insertq/extrq checks ran against the software bitfield model).
  • ctest --preset dev -N: Total Tests: 1025.
  • ctest --preset dev --no-tests=error -R "^startup_host_cpu$" -V: 1/1 Test #309: startup_host_cpu ... Passed (0.22 sec).
  • ctest --preset release --no-tests=error -R "^startup_host_cpu$" -V: 1/1 Test #309: startup_host_cpu ... Passed (0.17 sec).
  • .\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py: form coverage checks passed.
  • .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py: Self-test passed. Checked 18 Markdown files and 369 links.
  • .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py: Self-test passed. Checked 1320 tracked source, script and build/CI files: no bidirectional controls.

Evidence and follow-up

All fixtures in tests/startup_host_cpu_check.py are assembled in-memory in Python without external game files or dumps. Native SSE4a hardware comparison remains gated on CPUID leaf 0x80000001 ECX[6] (sse4a) and was skipped on this host because sse4a is absent.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6589675751 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1846). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-11-24T19:26:23Z. --- ## Change Extends `sse4a_stub()` and `stub_for()` in `tools/startup/host_cpu.py` to decode and lower: - REX-prefixed immediate `EXTRQ` (`66 [REX] 0F 78 /0 ib ib`) and `INSERTQ` (`F2 [REX] 0F 78 /r ib ib`) across `xmm0..xmm15`, - Register-parameter `EXTRQ` (`66 [REX] 0F 79 /r`) and `INSERTQ` (`F2 [REX] 0F 79 /r`) across `xmm0..xmm15`, reading the bitfield width (`[5:0]`, with `0` meaning `64`) and bit offset (`[13:8]`) from `xmm_src[63:0]` for `EXTRQ` and `xmm_src[127:64]` for `INSERTQ`. Both immediate and register stubs preserve `RFLAGS`, all general-purpose registers, and destination `xmm[127:64]` (including `dst == src`), while `_sse4a_decode()` rejects invalid forms (`mod != 3`, non-zero `/reg` on `66 0F 78`, `offset + width > 64`, missing/duplicate prefixes, and truncated encodings) by returning `None`. Extends `tests/startup_host_cpu_check.py` with REX `xmm8..xmm15` immediate and `0F 79` register-form positive controls (including `dst == src`, `length == 0` as 64, upper-64/GPR/CF preservation, and CPUID-gated native comparison when `sse4a` is present) as well as negative controls for invalid encodings and wrong-offset/wrong-register stubs. ## Verification Commit: `f738af81` - `.\out\pe-env\Scripts\python.exe -B tests/startup_host_cpu_check.py`: `PASS (1162 insertq/extrq results, clzero with two moved-instruction forms, 5 clwb and 2 wait rewrites, clwb/clflushopt NOPs for every addressing form, 4 non-temporal stores, rdpru, rdpid into 7 registers, sha-1 and sha-256 of 4 messages through the seven sha operations with 112 native results; native comparison: rdpid, sha)` (host CPU lacks `sse4a` and `clzero`, so native comparison ran for `rdpid` and `sha`; all 1162 `insertq`/`extrq` checks ran against the software bitfield model). - `ctest --preset dev -N`: `Total Tests: 1025`. - `ctest --preset dev --no-tests=error -R "^startup_host_cpu$" -V`: `1/1 Test #309: startup_host_cpu ... Passed` (0.22 sec). - `ctest --preset release --no-tests=error -R "^startup_host_cpu$" -V`: `1/1 Test #309: startup_host_cpu ... Passed` (0.17 sec). - `.\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py`: `form coverage checks passed`. - `.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py`: `Self-test passed. Checked 18 Markdown files and 369 links.` - `.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py`: `Self-test passed. Checked 1320 tracked source, script and build/CI files: no bidirectional controls.` ## Evidence and follow-up All fixtures in `tests/startup_host_cpu_check.py` are assembled in-memory in Python without external game files or dumps. Native SSE4a hardware comparison remains gated on CPUID leaf `0x80000001` ECX[6] (`sse4a`) and was skipped on this host because `sse4a` is absent. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
tedin7 commented 2026-11-24 20:00:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:31:37Z.

Review: COMMENTED


Peer review of head f738af8161f786b25a1aed79615b1adf8c27d522.

Result: no P1/P2 defects found in the local verification. One documentation mismatch (P3) below.

Read in full: the diff of tools/startup/host_cpu.py and tests/startup_host_cpu_check.py, plus the caller in tools/startup/debug_launch.py (rewrite_for_host, which now receives the length from stub_for). Checked by hand against the encodings:

  • Decode: the prefix is F2 or 66, then an optional REX, then 0F 78 (immediate) or 0F 79 (register). Lengths come out as 6/7 and 4/5. Register-form destination is ModRM.reg with REX.R, control source is ModRM.rm with REX.B. The immediate EXTRQ takes /0 with the operand in rm plus REX.B. Anything with mod != 3, a wrong prefix, a REX before the legacy prefix, a duplicate prefix or a truncated encoding returns no stub.
  • Immediate forms keep the earlier semantics (length 0 means 64, index + length above 64 is refused) and now pick up xmm8-15.
  • Register INSERTQ stub: the control qword comes from pextrq rdi, xmm_src, 1. The mask is built with shr rsi, cl after neg ecx, so length 0 gives a full 64-bit mask; the index comes from bits 13:8. The same register as source and destination is handled. RSI and RDI are saved and restored, and RAX, RCX, RDX and the flags as before.
  • Register EXTRQ stub: control and value come from the low qwords of the two registers, with the same mask construction, and bits 127:64 of the destination are preserved by pinsrq. I decoded the byte strings for both stubs and they match the comments.

Win2025 (coordinator run, Windows Server 2025 build 26100): tests/startup_host_cpu_check.py exited 0 and ctest -R '^startup_host_cpu$' passed 1/1 in Debug dev (0.16 s) and Release /O2 (0.15 s).

Linux checks run locally in a clean worktree at this head:

  • git diff --check origin/main...HEAD: clean
  • tests/bidi_controls_check.py: passed (1320 files)
  • tests/startup_host_cpu_check.py: passed, 1162 INSERTQ/EXTRQ results. This host has SSE4a, so the native-instruction comparison ran too (the output lists sse4a among the native comparisons), which checks the stubs against the processor and not only against the model.

Mutations (local, each reverted with git checkout -- .; tree clean). Each made startup_host_cpu_check.py exit 1:

  1. Register-form decode, destination REX bit taken from REX.B instead of REX.R: insertq xmm0, xmm9, 16, 16 gives 0x123456789abcdef, expected 0x12345673210cdef.
  2. INSERTQ register stub, shr rcx, 8 changed to shr rcx, 9: reg insertq xmm0, xmm1 (16, 16) mismatch.
  3. EXTRQ register stub, shr rdx, cl changed to shl rdx, cl: reg extrq xmm0, xmm1 (16, 16) returns 0.

P3 (documentation): docs/startup-runtime.md still describes the old limits. Line 946 lists the instructions as "(xmm0-7)", line 955 says the refused forms include "register-count INSERTQ/EXTRQ, xmm8-15", and line 958 says "288 INSERTQ/EXTRQ results" (the check now reports 1162). The module docstring in host_cpu.py was updated, but this section was not, so the docs now contradict the code. docs_links_check.py does not cover this.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6045972249 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1846#pullrequestreview-6045972249). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:31:37Z. **Review:** COMMENTED --- Peer review of head `f738af8161f786b25a1aed79615b1adf8c27d522`. **Result: no P1/P2 defects found in the local verification.** One documentation mismatch (P3) below. Read in full: the diff of `tools/startup/host_cpu.py` and `tests/startup_host_cpu_check.py`, plus the caller in `tools/startup/debug_launch.py` (`rewrite_for_host`, which now receives the length from `stub_for`). Checked by hand against the encodings: - Decode: the prefix is `F2` or `66`, then an optional REX, then `0F 78` (immediate) or `0F 79` (register). Lengths come out as 6/7 and 4/5. Register-form destination is ModRM.reg with REX.R, control source is ModRM.rm with REX.B. The immediate EXTRQ takes /0 with the operand in rm plus REX.B. Anything with mod != 3, a wrong prefix, a REX before the legacy prefix, a duplicate prefix or a truncated encoding returns no stub. - Immediate forms keep the earlier semantics (length 0 means 64, index + length above 64 is refused) and now pick up xmm8-15. - Register INSERTQ stub: the control qword comes from `pextrq rdi, xmm_src, 1`. The mask is built with `shr rsi, cl` after `neg ecx`, so length 0 gives a full 64-bit mask; the index comes from bits 13:8. The same register as source and destination is handled. RSI and RDI are saved and restored, and RAX, RCX, RDX and the flags as before. - Register EXTRQ stub: control and value come from the low qwords of the two registers, with the same mask construction, and bits 127:64 of the destination are preserved by `pinsrq`. I decoded the byte strings for both stubs and they match the comments. Win2025 (coordinator run, Windows Server 2025 build 26100): `tests/startup_host_cpu_check.py` exited 0 and `ctest -R '^startup_host_cpu$'` passed 1/1 in Debug `dev` (0.16 s) and Release `/O2` (0.15 s). Linux checks run locally in a clean worktree at this head: - `git diff --check origin/main...HEAD`: clean - `tests/bidi_controls_check.py`: passed (1320 files) - `tests/startup_host_cpu_check.py`: passed, 1162 INSERTQ/EXTRQ results. This host has SSE4a, so the native-instruction comparison ran too (the output lists `sse4a` among the native comparisons), which checks the stubs against the processor and not only against the model. Mutations (local, each reverted with `git checkout -- .`; tree clean). Each made `startup_host_cpu_check.py` exit 1: 1. Register-form decode, destination REX bit taken from REX.B instead of REX.R: `insertq xmm0, xmm9, 16, 16` gives `0x123456789abcdef`, expected `0x12345673210cdef`. 2. INSERTQ register stub, `shr rcx, 8` changed to `shr rcx, 9`: `reg insertq xmm0, xmm1 (16, 16)` mismatch. 3. EXTRQ register stub, `shr rdx, cl` changed to `shl rdx, cl`: `reg extrq xmm0, xmm1 (16, 16)` returns 0. **P3 (documentation): `docs/startup-runtime.md` still describes the old limits.** Line 946 lists the instructions as "(xmm0-7)", line 955 says the refused forms include "register-count `INSERTQ`/`EXTRQ`, xmm8-15", and line 958 says "288 `INSERTQ`/`EXTRQ` results" (the check now reports 1162). The module docstring in `host_cpu.py` was updated, but this section was not, so the docs now contradict the code. `docs_links_check.py` does not cover this. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-24 20:00:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:51:01Z.

Review: COMMENTED


Review of head b2abbcc32a7854bdf7af685d10ec8915c55f2404 (two commits: f738af81, b2abbcc3; base origin/main).

Verdict: no P1, no P2. Two P3 notes. This is the first time I run the register forms against the real instruction: the host I used has SSE4a (AMD), so the check's native comparison was live.

What I read The whole diff of tools/startup/host_cpu.py, tests/startup_host_cpu_check.py and docs/startup-runtime.md, and the one caller of stub_for (tools/startup/debug_launch.py).

Semantics, checked against the encodings and the stubs byte by byte

  • Decode. F2|66 [REX] 0F 78|79 /r. Register forms: length 3 + prefix (+1 with REX); immediate forms: 5 + prefix (+1 with REX). ModRM.mod must be 3 (memory operands refused). Immediate EXTRQ needs ModRM.reg == 0 and uses rm | REX.B as both operands. Every other form takes the destination from reg | REX.R and the source or control from rm | REX.B. That is the operand order LLVM gives these instructions (MRMSrcReg: first operand in reg, mask/source in rm).
  • EXTRQ xmm, xmm. The control comes from the low 64 bits of the source: length = bits 5:0 (0 means 64), index = bits 13:8. The stub does shr rdx, cl with rcx = ctrl >> 8 (the shift count is taken modulo 64, so bits 13:8), then masks with -1 >> ((-len) & 63). Bytes decoded by hand: 48 89 c1; 48 c1 e9 08; 48 d3 ea; 89 c1; f7 d9; 48 c7 c0 ff ff ff ff; 48 d3 e8; 48 21 c2: correct.
  • INSERTQ xmm, xmm. Data is the low qword of the source; length is bits 5:0 and index bits 13:8 of the source's high qword (bits 69:64 and 77:72 of the register). The stub reads the high qword with pextrq rdi, xmm_src, 1, builds the mask the same way, shifts data and mask by the index, clears the field in the destination and ORs the data. Bytes decoded by hand: 89 f9; f7 d9; 48 c7 c6 ff ff ff ff; 48 d3 ee; 48 21 f0; 48 89 f9; 48 c1 e9 08; 48 d3 e0; 48 d3 e6; 48 f7 d6; 48 21 f2; 48 09 c2: correct. rsi and rdi are pushed and popped in the right order (push ... rsi, rdi / pop rdi, rsi, rdx, rcx, rax, popfq).
  • Undefined cases. Immediate forms with index + length > 64 stay refused. For the register forms the control is only known at run time, so the stub computes some value there; the processor's result is undefined too, which the docstring already says.
  • REX. _xmm_modrm sets REX.W and REX.R/REX.B from the register numbers, so xmm8-15 and r8-r15 are addressed correctly; a REX before the legacy prefix, two REX bytes, an F3 prefix and no prefix are all refused.
  • Replacement. stub_for now returns the real length (4 to 7). plan_replacement moved the following instructions for a 4-byte and a 5-byte case in my check and padded the rest with NOPs.

Commands run locally on Linux (Python 3.14.8; iced-x86 installed in a scratch folder outside the repository; CPU reports sse4a)

  • python3 -B tests/startup_host_cpu_check.py: PASS (1162 insertq/extrq results, CLZERO, CLWB, wait, non-temporal stores, RDPRU, RDPID, SHA; "native comparison: clzero, rdpid, sha, sse4a").
  • My own differential, outside the repository, using the test module's helpers: 48,000 random cases (8 register pairs including xmm8, xmm15 and dest == src, both instructions; length 0, 1, 2, 31 to 33, 63 and random; index from 0 up to the largest valid; random garbage in bits 7:6 and 15:14 of the control bytes and in the unused control bits) comparing the patched stub with the native instruction: 0 differences in the low 64 bits.
  • A table of 23 byte strings through stub_for (all four forms with and without REX, memory operand, immediate EXTRQ with reg != 0, truncated, F3, no prefix, REX first, double REX, len 0 idx 1, 2121 which is 33+33 > 64, trailing bytes): each result is the expected length or None.
  • python3 -B tests/docs_links_check.py (18 files, 369 links), python3 -B tests/bidi_controls_check.py (1320 files): pass. git diff --check origin/main...HEAD: clean.

Local mutations of tools/startup/host_cpu.py (each restored with git checkout -- ., tree clean afterwards), each caught by startup_host_cpu_check.py

  1. INSERTQ register stub: index shift 8 changed to 9.
  2. REX.R ignored for the destination.
  3. EXTRQ register stub: the negation of the length dropped.
  4. Register-form length one byte too long.
  5. Immediate EXTRQ with ModRM.reg != 0 accepted.
  6. Length 0 no longer meaning 64.

Findings

  • P3: the doc table row still reads "xmm0-15" for both groups and lists the register forms, while the module docstring says bits 127:64 are left as they were; for INSERTQ xmm, xmm with the same register on both sides the test expects the control word to survive in the high qword. Both are undefined on the processor, so nothing depends on it, but one sentence in the doc would say it.
  • P3: the new stubs are 52 and 75 bytes and push up to six registers (48 bytes of stack); the other stubs push four. Fine on Windows x64 (no red zone), worth knowing for a caller with a very tight stack.

Not run: the debugger path that writes the stubs into a live process (debug_launch.py) and a Windows run; I only exercised the stub generation, plan_replacement and the stubs on this host.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6046270898 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1846#pullrequestreview-6046270898). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:51:01Z. **Review:** COMMENTED --- Review of head `b2abbcc32a7854bdf7af685d10ec8915c55f2404` (two commits: `f738af81`, `b2abbcc3`; base `origin/main`). **Verdict: no P1, no P2. Two P3 notes.** This is the first time I run the register forms against the real instruction: the host I used has SSE4a (AMD), so the check's native comparison was live. **What I read** The whole diff of `tools/startup/host_cpu.py`, `tests/startup_host_cpu_check.py` and `docs/startup-runtime.md`, and the one caller of `stub_for` (`tools/startup/debug_launch.py`). **Semantics, checked against the encodings and the stubs byte by byte** - *Decode.* `F2|66 [REX] 0F 78|79 /r`. Register forms: length 3 + prefix (+1 with REX); immediate forms: 5 + prefix (+1 with REX). `ModRM.mod` must be 3 (memory operands refused). Immediate `EXTRQ` needs `ModRM.reg == 0` and uses `rm | REX.B` as both operands. Every other form takes the destination from `reg | REX.R` and the source or control from `rm | REX.B`. That is the operand order LLVM gives these instructions (`MRMSrcReg`: first operand in `reg`, mask/source in `rm`). - *`EXTRQ xmm, xmm`.* The control comes from the low 64 bits of the source: length = bits 5:0 (0 means 64), index = bits 13:8. The stub does `shr rdx, cl` with `rcx = ctrl >> 8` (the shift count is taken modulo 64, so bits 13:8), then masks with `-1 >> ((-len) & 63)`. Bytes decoded by hand: `48 89 c1; 48 c1 e9 08; 48 d3 ea; 89 c1; f7 d9; 48 c7 c0 ff ff ff ff; 48 d3 e8; 48 21 c2`: correct. - *`INSERTQ xmm, xmm`.* Data is the low qword of the source; length is bits 5:0 and index bits 13:8 of the source's high qword (bits 69:64 and 77:72 of the register). The stub reads the high qword with `pextrq rdi, xmm_src, 1`, builds the mask the same way, shifts data and mask by the index, clears the field in the destination and ORs the data. Bytes decoded by hand: `89 f9; f7 d9; 48 c7 c6 ff ff ff ff; 48 d3 ee; 48 21 f0; 48 89 f9; 48 c1 e9 08; 48 d3 e0; 48 d3 e6; 48 f7 d6; 48 21 f2; 48 09 c2`: correct. `rsi` and `rdi` are pushed and popped in the right order (`push ... rsi, rdi` / `pop rdi, rsi, rdx, rcx, rax, popfq`). - *Undefined cases.* Immediate forms with `index + length > 64` stay refused. For the register forms the control is only known at run time, so the stub computes some value there; the processor's result is undefined too, which the docstring already says. - *REX.* `_xmm_modrm` sets REX.W and REX.R/REX.B from the register numbers, so xmm8-15 and `r8-r15` are addressed correctly; a REX before the legacy prefix, two REX bytes, an F3 prefix and no prefix are all refused. - *Replacement.* `stub_for` now returns the real length (4 to 7). `plan_replacement` moved the following instructions for a 4-byte and a 5-byte case in my check and padded the rest with NOPs. **Commands run locally on Linux** (Python 3.14.8; iced-x86 installed in a scratch folder outside the repository; CPU reports `sse4a`) - `python3 -B tests/startup_host_cpu_check.py`: PASS (1162 insertq/extrq results, CLZERO, CLWB, wait, non-temporal stores, RDPRU, RDPID, SHA; "native comparison: clzero, rdpid, sha, sse4a"). - My own differential, outside the repository, using the test module's helpers: 48,000 random cases (8 register pairs including xmm8, xmm15 and dest == src, both instructions; length 0, 1, 2, 31 to 33, 63 and random; index from 0 up to the largest valid; random garbage in bits 7:6 and 15:14 of the control bytes and in the unused control bits) comparing the patched stub with the native instruction: 0 differences in the low 64 bits. - A table of 23 byte strings through `stub_for` (all four forms with and without REX, memory operand, immediate EXTRQ with `reg != 0`, truncated, F3, no prefix, REX first, double REX, `len 0 idx 1`, `2121` which is 33+33 > 64, trailing bytes): each result is the expected length or `None`. - `python3 -B tests/docs_links_check.py` (18 files, 369 links), `python3 -B tests/bidi_controls_check.py` (1320 files): pass. `git diff --check origin/main...HEAD`: clean. **Local mutations of `tools/startup/host_cpu.py` (each restored with `git checkout -- .`, tree clean afterwards), each caught by `startup_host_cpu_check.py`** 1. INSERTQ register stub: index shift 8 changed to 9. 2. REX.R ignored for the destination. 3. EXTRQ register stub: the negation of the length dropped. 4. Register-form length one byte too long. 5. Immediate EXTRQ with `ModRM.reg != 0` accepted. 6. Length 0 no longer meaning 64. **Findings** - P3: the doc table row still reads "xmm0-15" for both groups and lists the register forms, while the module docstring says bits 127:64 are left as they were; for `INSERTQ xmm, xmm` with the same register on both sides the test expects the control word to survive in the high qword. Both are undefined on the processor, so nothing depends on it, but one sentence in the doc would say it. - P3: the new stubs are 52 and 75 bytes and push up to six registers (48 bytes of stack); the other stubs push four. Fine on Windows x64 (no red zone), worth knowing for a caller with a very tight stack. **Not run:** the debugger path that writes the stubs into a live process (`debug_launch.py`) and a Windows run; I only exercised the stub generation, `plan_replacement` and the stubs on this host. AI-assisted; commands listed were executed locally.
Ammmae0x commented 2026-11-24 20:01:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-24T19:43:51Z.


Updated docs/startup-runtime.md to reflect REX (xmm0-15) and register-form INSERTQ/EXTRQ support, the current refused forms, and the 1162-result check count (tests/startup_host_cpu_check.py, tests/docs_links_check.py, tests/bidi_controls_check.py, and startup_host_cpu in dev and release all pass). AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7142508096 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1846#issuecomment-7142508096). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-11-24T19:43:51Z. --- Updated `docs/startup-runtime.md` to reflect REX (`xmm0-15`) and register-form `INSERTQ`/`EXTRQ` support, the current refused forms, and the 1162-result check count (`tests/startup_host_cpu_check.py`, `tests/docs_links_check.py`, `tests/bidi_controls_check.py`, and `startup_host_cpu` in `dev` and `release` all pass). AI-assisted.
upstream-sync closed this pull request 2026-11-24 23:03:04 +00:00
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
R0Y00/Xbox2Windows!1839
No description provided.