cpu: lower legacy SSE2 CMPSD, MOVLPD, MOVHPD, and MOVNTPD in cpu_sse_fp_aot #2377
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2385"
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-25T14:40:29Z.
Change
Lower four additional legacy SSE2 double-precision forms in
tools/cpu_sse_fp_aot.py:CMPSD(Code.CMPSD_XMM_XMMM64_IMM8): predicates0..7with XMM or flatm64source (unalignedm64accepted), preserving bits[127:64]and writing0xFFFFFFFFFFFFFFFF/0into[63:0]via host SSE2op_cmpsd_qwith volatile operand copies so runtime MXCSR (DAZ) and NaN rules match hardware; rejectsimm8 >= 8.MOVLPD/MOVHPD(MOVLPD_XMM_M64,MOVLPD_M64_XMM,MOVHPD_XMM_M64,MOVHPD_M64_XMM): flatm64load-merge preserving the untouched 64-bit lane andr8-rootedm64store (unaligned displacements accepted; reg-reg encodings rejected).MOVNTPD(MOVNTPD_M128_XMM): 16-byte-alignedr8-rooted non-temporal store (rejectsdisp % 16 != 0and non-r8stores).tests/cpu/sse_fp_check.pyandtests/cpu/sse_fp_pd_check.pyto replace now-supported negative assertions for these four forms with still-unsupported legacy SSE2 forms (unpcklpd,unpckhpd,shufpd,movupd).tests/cpu/sse_fp_pd_moves_cmp.{asm,def,_check.py}(; coverage: record cpu_aot_sse_fp_pd_moves_cmp) and registercpu_aot_sse_fp_pd_moves_cmpinCMakeLists.txt.Verification
Verified on commit
a3c94c99(rebased onupstream/maina31f70a1) across bothdev(Debug) andrelease(/O2) presets:cmake --build --preset dev --target cpu_sse_fp_harness cpu_sse_fp*_original* cpu_sse_fp*_altered*-> exit 0ctest --preset dev -R "^cpu_aot_sse_fp" -E "cpu_native_archive_" --output-on-failure->100% tests passed, 0 tests failed out of 5(0 skipped):cpu_aot_sse_fp(5.03s),cpu_aot_sse_fp_logic(0.68s),cpu_aot_sse_fp_pd(15.02s),cpu_aot_sse_fp_pd_logic(0.64s),cpu_aot_sse_fp_pd_moves_cmp(4.66s)cpu_aot_sse_fp_pd_moves_cmp:6752 lifted + 6752 /O2 cases across 23 exports; 96448 MXCSR CMPSD runs (16 states, 14 quirks); ALTER_IMM diverged on 17 exports + 9 mutants caught;rejections passed: 8 alt + 11 VEX/EVEX + 34 IR + 8 raw + 10 PE-patched + CLIcmake --build --preset release --target cpu_sse_fp_harness cpu_sse_fp*_original* cpu_sse_fp*_altered*-> exit 0ctest --preset release -R "^cpu_aot_sse_fp" -E "cpu_native_archive_" --output-on-failure->100% tests passed, 0 tests failed out of 5(0 skipped; 26.52s)FORM_COVERAGE_RECORDverified in bothout/build/dev/form_coverage/cpu_aot_sse_fp_pd_moves_cmp.txtandout/build/release/form_coverage/cpu_aot_sse_fp_pd_moves_cmp.txt:cmpsd, movaps, movdqa, movdqu, movhpd, movlpd, movntpd, retout/pe-env/Scripts/python.exe -B tests/form_coverage_check.py->form coverage checks passed(exit 0)out/pe-env/Scripts/python.exe -B tests/docs_links_check.py->Self-test passed. Checked 19 Markdown files and 462 links.(exit 0)out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py->Self-test passed. Checked 1677 tracked source, script and build/CI files: no bidirectional controls.(exit 0)Spot mutation checks against
tools/cpu_sse_fp_aot.py(8/8 killed bytests/cpu/sse_fp_pd_moves_cmp_check.py, restored cleanly):cmpsdpredicate bound (imm > 31), invertop_cmpsd_qpredicate 4 (caught by freshly compiled/O2harness), clobber[127:64]incmpsd, skip undefined-dst check incmpsd, swapmovlpd/movhpdload lane index, swapmovlpd/movhpdstore lane index, dropalignment=16onmovntpd, and dropwrite=True(r8-only store guard) onmovntpd(all returned exit 1).Evidence and follow-up
tests/cpu/sse_fp_pd_moves_cmp.{asm,def,_check.py}is a clean-room, source-built MASM fixture (MIT, repo-authored; no game files, dumps, or binaries).CMPSDpredicates on-0.0/+0.0,+/-Inf,+/-qNaN/sNaN, and subnormals across all 16 MXCSR states,[127:64]preservation,MOVLPD/MOVHPDlane preservation and unalignedm64displacements,MOVNTPD16-byte aligned stores, faulting discardedm64read preservation,ALTER_IMMdivergence, mutant models, and VEX/EVEX/reserved-predicate/alignment/non-r8/nonvolatile/undefined-register/raw-invalid/PE-patched/CLI rejections.Checklist
AI-assisted.