Repository navigation
cpu: lower all 60 VEX FMA3 scalar and packed instructions - #503
Conversation
4f81f30 to
c5626ec
Compare
|
Verification of
Two notes for coordination:
AI-assisted: run and summarized with Claude Code; outputs copied from the local runs. |
|
Rebased onto current Thanks for the independent Skylake verification. Coordination with #349: that PR lowers the 36 packed VEX FMA3 forms in Re-run after rebase (dev preset, Windows 11, MSVC):
|
c5626ec to
d9382c3
Compare
|
Re-checked the rebased head AI-assisted (Claude Code). |
|
I resolved the coverage-test conflict on your original branch in 1dce507. The FMA3 and shader coverage checks both remain registered. The native FMA3 test now reuses the existing CPUID/XGETBV probe and reports a capability skip when FMA or OS-enabled XMM/YMM state is unavailable. On Windows with MSVC 19.51, both the dev and release presets passed |
Summary
Adds AOT lowering in
tools/cpu_avx2_aot.pyfor all 60 VEX-encoded x64 FMA3 instructions listed indocs/coverage/x64_zen2.tsvgroupFMA(96iced_x86.Codevariants across scalarss/sdand packed 128-bit/256-bitps/pd, supporting both register and flat memoryop2operands):vfmadd,vfmsub,vfnmadd,vfnmsub(ss,sd,ps,pd) andvfmaddsub,vfmsubadd(ps,pd)132,213,231std::fmaf/std::fma, x86 semantic(a, b, c)NaN priority with QNaN quietening and sign preservation on negated-product forms, scalar upper-lane preservation (op0[127:32]/op0[127:64]), and VEX 128-bit upper-lane zeroing ([255:128]).Fixture & Coverage
tests/cpu/fma3_leaf.asm(; coverage: source cpu_aot_fma3) +tests/cpu/fma3_leaf.defwith 102 exports (all 96 register variants + 6 memory-operand variants coveringm32,m64,m128,m256) and anALTER_FMAmutation variant.tests/cpu/fma3_leaf_check.pyrunning 714 bit-exact differential comparisons (native hardware DLL vs lifted C++ DLL) covering single-rounding witnesses, signed zeros, infinities, subnormals, QNaN/SNaN priority, randomized inputs, mutation control, and 5 rejection controls (undefinedop0, nonvolatileymm6, EVEX FMA3, unsupportedRSPmemory base, and AMD FMA4).check_fma3_leaf()totests/form_coverage_check.pyverifying 60/60FMAcoverage.Test Commands & Results
ctest --preset dev --no-tests=error -R "^(cpu_aot_fma3|cpu_aot_avx2_regs)$" -V-> 2/2 passed (cpu_aot_fma3 passed (102 exports, 714 bit-exact differential evaluations))ctest --preset release --no-tests=error -R "^cpu_aot_fma3$" -V-> 1/1 passed at/O2.\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py-> passed (FMA 60/60).\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py-> passed.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py-> passed