cpu: lower legacy SSE FP compare and partial/non-temporal move instructions #978
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/985"
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-23T19:56:28Z.
Change
Add a bounded Windows x64 leaf AOT translator (
tools/cpu_sse_fp_aot.py), source-built MASM fixture (tests/cpu/sse_fp.asm,tests/cpu/sse_fp.def), differential/rejection test suite (tests/cpu/sse_fp_check.py), CMake targets/CTest (cpu_aot_sse_fp), and experiment notes (docs/experiments.md) covering five previously uncovered legacySSEmnemonics indocs/coverage/x64_zen2.tsv:cmpps: all eightimm8predicates (0..7) onxmmand 16-byte alignedm128sourcescmpss: all eightimm8predicates (0..7) onxmmand unalignedm32sources, preserving bits127:32of the destinationmovlpsandmovhps:m64load-merge (preserving the other 64 bits) andm64storemovntps: 16-byte alignedm128non-temporal storeTransport moves (
movaps,movdqa,movdqu) and terminalretare included for ABI glue. Memory stores must target anr8-rooted flat address; VEX/EVEX encodings,imm8 >= 8, nonvolatile registers (xmm6..xmm15), nonvolatile or non-argument base registers, non-r8stores, unaligned 16-byte operands, undefined register reads/merges, prefixes, unsupported instructions, and malformed streams are rejected.Verification
Verified on Windows x64 in both
dev(Debug) andrelease(/O2) presets from commit on branchcpu/sse-fp:cmake --preset dev&cmake --preset release+ clean builds (--clean-first) ofcpu_sse_fp_original,cpu_sse_fp_original_lifted,cpu_sse_fp_altered,cpu_sse_fp_altered_lifted, andcpu_sse2_regs_*: 0 errors, 0 warnings (also verified lifted C++ compiles cleanly withcl /nologo /O2 /W4 /WX).ctest --preset dev --no-tests=error -R "^(cpu_aot_sse_fp|cpu_aot_sse2_regs)$" -V: 2/2 passed (cpu_aot_sse_fp: 720 cases across 34 exports matched native DLL, lifted DLL, and Python IEEE-754 reference bit-for-bit; 6ALTER_IMMpredicate-flip controls diverged on 27 cases each; output mutation control caught; 7 alternate-encoding lift checks, 60 unit rejection controls, and 10 PE-patched rejection controls passed;cpu_aot_sse2_regs: 1,168 cases across 57 exports passed).ctest --preset release --no-tests=error -R "^(cpu_aot_sse_fp|cpu_aot_sse2_regs)$" -V: 2/2 passed with identical counts..\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: passed (Checked 13 Markdown files and 204 links.)..\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py: passed (Checked 820 tracked source, script and build/CI files: no bidirectional controls.).ctest --preset dev --no-tests=error -R "^cpu_aot_sse_fp$" --output-junit ...+tools/form_coverage.py:sse_fp.asmpassed and covered 9 of 948 x64 forms, including all five newSSEmnemonics (cmpps,cmpss,movlps,movhps,movntps).Evidence and follow-up
All fixtures are original MASM (
tests/cpu/sse_fp.asm, MIT-licensed) and synthetic Python inputs covering signed zeros, infinities, quiet and signaling NaNs with distinct payloads, subnormals, unaligned+1m32/m64addresses, 32-byte pre/post buffer guards,ALTER_IMMpredicate-flip controls, output mutation negative control, andiced_x86unit + PE-patched rejection controls.Not covered: non-default MXCSR modes (FTZ/DAZ or unmasked exceptions), non-temporal cache-bypass hints on
movntps, control flow, nonvolatilexmm6..xmm15prologues, and title CPU code execution.Checklist
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:08:03Z.
The current Release fixture passed all 720 cases here. I also checked the eight packed and scalar compare predicates with masked default MXCSR, sampling qNaN, sNaN and a subnormal. The sampled status and output matched.
A separate accepted leaf exposes an /O2 mismatch. Keep the first aligned output store, add a MOVAPS load to an unused volatile XMM register, then store the original value to the following output vector. With a readable input both DLLs perform both stores. With PAGE_NOACCESS for that load, native raises c0000005 with the first output word written and the second unchanged. The generated DLL performs both stores without a fault because the unused memcpy load is optimized out.
Please preserve every executed guest memory read in this profile, even when the destination is dead. Reuse the established ordered access approach from the packed-string path where it fits, and check the original width and both surrounding writes in /O2. The remaining coverage also overlaps #382 for CMPPS/MOVLPS/MOVHPS, so this can stay the small focused acceptance for those forms.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T20:18:59Z.
I pushed
664e411to preserve executed source reads. The new native/lifted regression fails on the original Release generator, then passes with the fix in Debug and Release, alongside the 720 existing differential cases. The /O2 output performs one 16-byte source load between the two stores. The guarded output shows that the first store survives the read fault and the second remains untouched. The original contribution and controls are intact. Fresh Windows CI is pending.