cpu: cover AVX2 broadcast, variable-shift and alias controls #700
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/706"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-22T21:30:54Z.
Change
Expand the
cpu_aot_avx2_shiftsMASM fixture, export list, differential runner, and rejection controls to cover previously untested forms of the existing AVX2 integer broadcast and variable per-lane shift lowering (tools/ffx_version_query.py), without modifying the translator:tests/cpu/avx2_shifts.asm,tests/cpu/avx2_shifts.def: expand from 10 to 44 exports covering 128-bit and 256-bitvpbroadcastb/vpbroadcastw/vpbroadcastd/vpbroadcastq(memory, register, anddst == srcalias), 128-bit and 256-bitvpsllvd/vpsrlvd/vpsravd/vpsllvq/vpsrlvq(registerop2, memoryop2,dst == src1,dst == src2, anddst == src1 == src2aliasing), and upper-128 zeroing checks with preloadedYMM0.tests/cpu/avx2_shifts.py: test all 44 exports across 101 differential cases against the native DLL and reference model (including boundary shift counts0,1,7,15,31,32,33,0xfffffffffor dwords and0,1,7,32,63,64,65,0xfffffffffffffffffor qwords) and 14 deterministic rejection controls (EVEX broadcast/non-broadcast/GPR-source/512-bit ZMM forms, untrackedop0/op1/op2registers,FSsegment prefix, andEIP-relative memory operands).docs/experiments.md: update thecpu_aot_avx2_shiftssummary to 44 exports and document the expanded coverage.Verification
Tested on commit
b49216fb3a001606ff24c2967d74e4e8f7184e19(Windows NT 10.0.26100.0, MSVC 19.50.35727 x64, MASM 14.50.35727.0):.\tools\dev.ps1; cmake --preset dev; cmake --build --preset dev --target cpu_avx2_shifts cpu_avx2_shifts_lifted: built with 0 errors and 0 warnings.ctest --preset dev --no-tests=error -R '^cpu_aot_avx2_shifts$' -V: 1 passed, 0 skipped, 0 failed (101 AVX2 broadcast and variable-shift vector cases matched native and translated DLLs).ctest --preset dev --no-tests=error -R '^cpu_aot_' --output-on-failure: 85 passed, 0 skipped, 0 failed..\tools\dev.ps1; cmake --preset release; cmake --build --preset release --target cpu_avx2_shifts cpu_avx2_shifts_lifted: built with 0 errors and 0 warnings.ctest --preset release --no-tests=error -R '^cpu_aot_avx2_shifts$' -V: 1 passed, 0 skipped, 0 failed (101 AVX2 broadcast and variable-shift vector cases matched native and translated DLLs).ctest --preset release --no-tests=error -R '^cpu_aot_' --output-on-failure: 85 passed, 0 skipped, 0 failed..\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py: passed (form coverage checks passed)..\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py: passed (Checked 10 Markdown files and 128 links.)..\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py: passed (Checked 586 tracked source, script and build/CI files: no bidirectional controls.).Not run locally:
ziglang-dependent PE intake tests (optionalziglangomitted fromout/pe-env); does not affectcpu_aot_*or AVX2 shift fixtures.Evidence and follow-up
All fixtures are original MASM source in
tests/cpu/avx2_shifts.asmcompiled natively withml64and translated viatools/ffx_version_query.pyunder the repository's MIT License. The 14 negative controls decode synthetic x64 byte sequences withiced-x86and verifylower(...)raisesValueErrorwith the expected diagnostic prefix. No capability skips occurred on this AVX2-capable host; non-AVX2 hosts retain the existing CPUID/XCR0 exit-77 skip path.Checklist
AI-assisted.