Repository navigation
cpu: lower baseline 128-bit SSE3 and SSE4.1 floating-point instructions - #602
MarlomMedeiros wants to merge 3 commits into
Conversation
|
Native and translated agree; only the
Two related observations:
The head also no longer merges cleanly with AI-assisted: run and analyzed with Claude Code; outputs copied from the local run. |
3ba5fec to
e2526e1
Compare
|
Confirmed, and thanks for the detailed report. The diagnosis was right: for Fix (pushed in
AI-assisted: yes. All reported checks ran locally on the hardware listed. |
R0Y00
left a comment
There was a problem hiding this comment.
The improved dot-product reference is useful. The new packed memory path loads into an unaligned host temporary and then runs a register intrinsic, which can hide a guest alignment fault. A source-built native probe on an i9-14900HX (Windows build 26200) gave correct results for aligned DPPS and HADDPS sources, and both reported access violation reading 0xFFFFFFFFFFFFFFFF at a 4-byte misalignment inside readable storage. Please keep the register forms and the established narrow/unaligned moves, and restrict the packed memory forms unless their native alignment behavior is modeled and independently tested. Keep the existing width and NaN cases. This overlaps #375, so I am keeping the two changes in one review queue.
|
New independent evidence for e2526e1 after resolving the current main conflicts locally. On Windows build 26200.9974 (MSVC/ML64 19.51, dev preset), the native and lifted DPPS outputs agree at mask 0xff, but the test rejects their lane-specific NaNs. For a=4523c17f0000807f2301807f000080ff and b=2143c5ff0000807f0000803f00000000 both outputs were 4523c17f4523c17f0000c0ff2301c07f. The current check requires every enabled result lane to have the same payload. Please allow lane-specific quiet NaNs only for the already identified ambiguous multi-producer case, while continuing to compare native and lifted bits, disabled zero lanes and determinate results exactly. I also expanded the original alignment probe with aligned and +4 pointers into readable storage. All 16 packed m128 arithmetic, duplication, rounding, dot-product and blend forms accepted the aligned pointer and raised access violation at +4. LDDQU accepted both. This supports keeping LDDQU and the narrow forms separate from the aligned full-width path. The existing changes request still applies. |
Resolved on 3007320: generation preserves the aligned packed source fault, and native, translated and reference checks passed in dev and release.
|
I pushed 3007320 to your branch. The full-width legacy SSE3/4.1 memory path checks the actual 16-byte alignment and reuses the existing Windows alignment-fault path. Four new +4 misalignment cases preserve the same native and translated read fault and the untouched output. LDDQU and narrow sources retain the previous behavior. The dot-product reference now checks each enabled lane against the allowed result set while keeping native/lifted equality and disabled-zero bits exact. Windows dev and /O2 each passed the SSE3/4.1 fixture (950 comparisons, four mutations and the four new alignment controls) and the existing CMPXCHG fixture (120 comparisons plus its fault controls). The previous alignment review is resolved on this commit. GitHub CI is pending. |
Summary
tools/ffx_version_query.py: lower 22 legacy-encoding 128-bit SSE3/SSE4.1 floating-point instructions for trackedxmm0-xmm2(wide0-wide2):addsubps/pd,haddps/pd,hsubps/pd,movddup,movsldup,movshdup,lddqu,roundps/pd,roundss/sd,dpps,dppd,blendps/pd,blendvps/pd,insertps,extractps. FP arithmetic emits the matching host intrinsics; data movement is byte-level; upper YMM bytes are preserved. MMX, VEX, untracked XMM andmovntdqastay rejected.tests/cpu/sse34_fp.{asm,def,py}: source-built MASM fixture with 33 exports, three-way differential check (native DLL, lifted DLL, independent IEEE-754Fractionreference), NaN/denormal/-0.0 cases, immediate sweeps (all 256insertpsimm8 values, allblendps/blendpdimmediates, 16+1dppdand 18 representativedppsmasks, all four rounding modes plus the MXCSR-select and NO_EXC bits), narrow memory widths (m32/m64/m128 guarded), 4 mutated lifted controls that must mismatch, rejection checks (MMX, VEX,xmm3+,movntdqa), and a CPUID SSE3+SSE4.1 probe that exits 77 on incapable hosts.CMakeLists.txt: registerscpu_aot_sse34_fpwithSKIP_RETURN_CODE 77, same shape as the SSE2 batches.docs/experiments.md: records the forms, the fixture checks and the reproduction commands.Test plan
Commit under test:
3ba5feconcpu-sse34-fp(rebased on currentmain).cmake --build --preset dev --target cpu_sse34_fp_liftedctest --preset dev --no-tests=error -R '^cpu_aot_sse34_fp$' -V→ 1/1 Passed:950 baseline 128-bit SSE3/SSE4.1 FP cases across 33 exports matched native DLL and reference; 4 mutated controls mismatched as requiredlower():ctest --preset dev --no-tests=error -R 'cpu_aot_(sse2_int|sse2_sat_mul|sse41|sse41_int|sse41_extend|sse41_42_misc|string_ops|version_query|wide_arith)'→ 8/8 Passed.