cpu: lower legacy SSE MMX-domain conversion, shuffle, and non-temporal store ops #1000
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1007"
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-23T20:57:21Z.
Change
Add the SSE/MMX leaf translator and differential fixture (
cpu_aot_sse_mmx) covering five previously uncoveredSSEmnemonics fromdocs/coverage/x64_zen2.tsv:cvtpi2ps: converts twoint32_tvalues frommm/m64tofloat32inxmm[63:0]while preservingxmm[127:64].cvtps2pi: converts twofloat32values fromxmm[63:0]/m64toint32_tinmmusing round-to-nearest-even (0x80000000on NaN,+/-Inf, or out-of-int32_trange after rounding).cvttps2pi: converts twofloat32values fromxmm[63:0]/m64toint32_tinmmusing truncation toward zero (0x80000000on NaN,+/-Inf, or out-of-int32_trange).pshufw: performsimm816-bit word permutation frommm/m64intomm.movntq: performs a 64-bit non-temporal store frommmto[r8 + disp].The translator uses the leaf ABI
void fn(word rcx, word rdx, word r8)withXMM0..XMM5(Vec128),MM0..MM7(std::uint64_t mm[8]), volatile scratch GPRs (rax,r9,r10,r11) formovqbridges,movaps/movdqa(16-byte aligned),movdqu,emmsstate tracking (rejectingretwhilemmx_active),std::atomic_signal_fence+ volatileload64/load128for dead-read fault ordering at/O2, andr8-only stores.Verification
All checks ran on x64 Windows (
& .\tools\dev.ps1) with 0 errors and 0 warnings across bothdevandrelease(/O2) presets:cmake --build --preset dev --clean-first --target cpu_sse_mmx_original cpu_sse_mmx_original_lifted cpu_sse_mmx_altered cpu_sse_mmx_altered_lifted cpu_sse_fp_original cpu_sse_fp_original_lifted cpu_sse_fp_altered cpu_sse_fp_altered_lifted-> 0 errors, 0 warnings.cmake --build --preset release --clean-first --target cpu_sse_mmx_original cpu_sse_mmx_original_lifted cpu_sse_mmx_altered cpu_sse_mmx_altered_lifted cpu_sse_fp_original cpu_sse_fp_original_lifted cpu_sse_fp_altered cpu_sse_fp_altered_lifted-> 0 errors, 0 warnings.ctest --preset dev --no-tests=error -R "^(cpu_aot_sse_mmx|cpu_aot_sse_fp)$" -V->2/2 Passed:cpu_aot_sse_mmx: 237 native/lifted/reference cases across 18 exports matched bit-for-bit plusop_discarded_readfault-ordering check;ALTER_IMMdiverged on{'op_cvtps2pi_reg': 3, 'op_cvttps2pi_reg': 3, 'op_pshufw_reg_e4': 7, 'op_pshufw_mem_4e': 7}; output-mutation control caught; 7 alternate-encoding lift checks, 59 unit rejection controls (7 VEX/EVEX, 12 unsupported instructions, 40 ABI/state/addressing/prefix/stream), and 10 PE-patched DLL rejection controls passed.cpu_aot_sse_fp: 720 cases across 34 exports passed.ctest --preset release --no-tests=error -R "^(cpu_aot_sse_mmx|cpu_aot_sse_fp)$" -V->2/2 Passed(same counts at/O2)..\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py-> passed..\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py->Checked 13 Markdown files and 214 links.passed..\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py->Checked 840 tracked source, script and build/CI files: no bidirectional controls.passed.tools/form_coverage.pyoncpu_aot_sse_mmxJUnit XML ->sse_mmx.asmclassifiedpass, coveringcvtpi2ps,cvtps2pi,cvttps2pi,pshufw, andmovntq.Evidence and follow-up
ALTER_IMMopcode/immediate swaps, single-bit output-mutation check, discarded-read fault-ordering test (op_discarded_read), 59 unit rejection controls, and 10 PE-patched DLL rejection controls.movntq, x87/MMX aliasing across calls, control flow, and title CPU code execution.Checklist
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T21:09:53Z.
Independent Release
cpu_aot_sse_mmxpassed at9d28f08. This includes 237 native/lifted/reference comparisons across 18 exports, the displaced unaligned MOVNTQ output, both fault-order controls, 59 unit refusals and 10 PE-patched refusals. I pushedd763b20to document the fixed host FP controls and the MOVNTQ boundary: the fixture compares the final output bytes in caller-owned memory. Cache behavior and inter-thread visibility require a separate contract.