cpu: add AVX packed-integer and bit-move leaf AOT translators #373

Manually merged
github merged 3 commits from gh-pr/373/head into gh-pr/373/base 2026-11-26 21:46:51 +00:00
Owner

@⁠MarlomMedeiros on GitHub · 2026-11-21 23:40 UTC · original
cpu-avx-174 → main · +8175 −1 · 13 files · 3 commits · merged 2026-11-22 08:10 UTC

Change

  • Add two leaf AOT translators covering 140 surviving AVX forms in docs/coverage/x64_zen2.tsv group AVX:
    • tools/cpu_avx_int_aot.py: 90 VEX.128 packed-integer forms: vpadd*/vpsub* arithmetic and saturating, vpcmp*, vpmul*/vpmadd*/vpmulhrsw, vpabs*, vpsign*, vpackss*/vpackusdw, vpmovsx*/vpmovzx*, vpunpck*, vpshuf*/vph*, vpblend*/vpblendvb, vpalignr, vmpsadbw, vpsadbw, vphminposuw, vpmovmskb, vpextr*/vpinsr* GPR bridge, vzeroall/vzeroupper
    • tools/cpu_avx_move_aot.py: 50 bit-move forms across XMM/YMM: vmov* aligned/unaligned/NT/scalar/half, vshufps/vshufpd/vunpck*, vblend*/vblendv*, vperm*/vpermil*, vinsert*/vextract*, vbroadcast*, vand*/vandn*/vor*/vxor*, vmaskmov* masked load/store
  • Carve out 33 forms to cpu_vex_aot.py (PR #325): 28 packed-integer + 5 move forms reject as unsupported so each form has exactly one translator; vmovdqu/vzeroupper remain implemented as transport glue.
  • Add source-built MASM differential fixtures tests/cpu/avx_int_regs.{asm,def} + avx_int_regs_check.py and tests/cpu/avx_move_regs.{asm,def} + avx_move_regs_check.py, CTest cpu_aot_avx_int_regs/cpu_aot_avx_move_regs, coverage mapping in tools/form_coverage.py/tests/form_coverage_check.py, and documentation in docs/experiments.md.
  • Refs #314. Complements #325.

Verification

  • Built and tested on Windows 11 x64 (Ryzen 7 5800X3D, MSVC 19.52):
    • ctest --preset dev --no-tests=error -R 'cpu_aot_avx_(int|move)_regs' : 2/2 passed (1,568 packed-integer + 2,314 move native/lifted/reference cases matched bit-for-bit across 119 + 142 exports, plus 16 guard-page fault-suppression cases)
    • ctest --preset dev --no-tests=error -R '^cpu_' -E '_hardware$' : 43/43 passed
    • .\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py : form coverage checks passed (AVX group 7 -> 146/256, total x64 Zen 2 55 -> 194/948)
    • .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py : passed
  • Negative controls: 110 + 78 unit rejection cases (33 carved forms, VEX.L=1 integer, register-domain memory operands, out-of-scope, EVEX/ABI/addressing violations), 11 + 11 PE-patched DLL rejections, 13 alternate-encoding accept checks (r64/W1 GPR bridge forms MASM does not emit), ALTER_IMM divergence and output-mutation controls.

Evidence and follow-up

  • The 33 carved forms stay reserved for the cpu_vex_aot.py work in PR #325; each is rejected by both new tools with unit + PE-patched controls so no coverage row is double-claimed.
  • Not covered: memory operands on the 28 register-only move forms, AVX FP arithmetic/compare/convert/test, string-compare and MXCSR forms, control flow or calls mixed with AVX state, nonvolatile XMM6..XMM15 prologues, title CPU execution.
**@⁠MarlomMedeiros** on GitHub · 2026-11-21 23:40 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/373) `cpu-avx-174` → `main` · +8175 −1 · 13 files · 3 commits · merged 2026-11-22 08:10 UTC ## Change - Add two leaf AOT translators covering 140 surviving AVX forms in `docs/coverage/x64_zen2.tsv` group `AVX`: - `tools/cpu_avx_int_aot.py`: 90 VEX.128 packed-integer forms: `vpadd*`/`vpsub*` arithmetic and saturating, `vpcmp*`, `vpmul*`/`vpmadd*`/`vpmulhrsw`, `vpabs*`, `vpsign*`, `vpackss*`/`vpackusdw`, `vpmovsx*`/`vpmovzx*`, `vpunpck*`, `vpshuf*`/`vph*`, `vpblend*`/`vpblendvb`, `vpalignr`, `vmpsadbw`, `vpsadbw`, `vphminposuw`, `vpmovmskb`, `vpextr*`/`vpinsr*` GPR bridge, `vzeroall`/`vzeroupper` - `tools/cpu_avx_move_aot.py`: 50 bit-move forms across XMM/YMM: `vmov*` aligned/unaligned/NT/scalar/half, `vshufps`/`vshufpd`/`vunpck*`, `vblend*`/`vblendv*`, `vperm*`/`vpermil*`, `vinsert*`/`vextract*`, `vbroadcast*`, `vand*`/`vandn*`/`vor*`/`vxor*`, `vmaskmov*` masked load/store - Carve out 33 forms to `cpu_vex_aot.py` (PR #325): 28 packed-integer + 5 move forms reject as unsupported so each form has exactly one translator; `vmovdqu`/`vzeroupper` remain implemented as transport glue. - Add source-built MASM differential fixtures `tests/cpu/avx_int_regs.{asm,def}` + `avx_int_regs_check.py` and `tests/cpu/avx_move_regs.{asm,def}` + `avx_move_regs_check.py`, CTest `cpu_aot_avx_int_regs`/`cpu_aot_avx_move_regs`, coverage mapping in `tools/form_coverage.py`/`tests/form_coverage_check.py`, and documentation in `docs/experiments.md`. - Refs #314. Complements #325. ## Verification - Built and tested on Windows 11 x64 (Ryzen 7 5800X3D, MSVC 19.52): - `ctest --preset dev --no-tests=error -R 'cpu_aot_avx_(int|move)_regs'` : 2/2 passed (1,568 packed-integer + 2,314 move native/lifted/reference cases matched bit-for-bit across 119 + 142 exports, plus 16 guard-page fault-suppression cases) - `ctest --preset dev --no-tests=error -R '^cpu_' -E '_hardware$'` : 43/43 passed - `.\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py` : form coverage checks passed (AVX group 7 -> 146/256, total x64 Zen 2 55 -> 194/948) - `.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py` : passed - Negative controls: 110 + 78 unit rejection cases (33 carved forms, VEX.L=1 integer, register-domain memory operands, out-of-scope, EVEX/ABI/addressing violations), 11 + 11 PE-patched DLL rejections, 13 alternate-encoding accept checks (r64/W1 GPR bridge forms MASM does not emit), ALTER_IMM divergence and output-mutation controls. ## Evidence and follow-up - The 33 carved forms stay reserved for the `cpu_vex_aot.py` work in PR #325; each is rejected by both new tools with unit + PE-patched controls so no coverage row is double-claimed. - Not covered: memory operands on the 28 register-only move forms, AVX FP arithmetic/compare/convert/test, string-compare and MXCSR forms, control flow or calls mixed with AVX state, nonvolatile `XMM6`..`XMM15` prologues, title CPU execution.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:46:49 +00:00
github manually merged commit 58236607a0 into gh-pr/373/base 2026-11-26 21:46:51 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-21 23:40 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-21 23:40 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/373#pullrequestreview-6008895343) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
This discussion has been locked. Commenting is limited to contributors.
No description provided.