cpu: cover six packed FMA3 lowerings #671
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/677"
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 Leyukaka on 2026-11-22T19:26:54Z.
Change
This closes six coverage gaps in the packed FMA3 lowering of
tools/ffx_version_query.py. Each was a one-line mutation that passed everycpu_test onmain. Only the packed FMA fixture (tests/cpu/fma_packed.{asm,def,py}) and its description indocs/experiments.mdchange; the translator does not.The existing cases feed NaN operands, so they check NaN selection but not the arithmetic. Six new exports run on broadcast finite operands, and the check compares the full 32 result bytes of the native and translated functions:
vfmsub132ps ymm0, ymm1, ymmword ptr [r8]213operand ordervfnmadd132ps xmm0, xmm1, xmm2vfnmaddnegates the addend instead of the productvfmaddsub132ps xmm0, xmm1, xmm2vfmaddsublane parity invertedvfmadd132pdon1+2^-52,-1,1-2^-52pd132computed with two roundings (gives 0 instead of -2^-104)vfmadd213pd xmm0, xmm1, xmm2pdwrite keeps the old upper halfvfmadd132ps xmm0, xmm0, xmm2The inputs 2, 3 and 5 give different results for the three operand orders. Every existing NaN case is unchanged (190 to 196 compared cases).
Verification
On
4865fd0(branch onff7f68a), Windows 11 build 26300.9974, MSVC 14.44.35207, Python 3.14, on an FMA3-capable host:All 295 tests pass.
tests/docs_links_check.pypasses.Each mutation was applied to
tools/ffx_version_query.pyone at a time, and allcpu_tests were run. Onmain, all of them passed for each mutation. A control that dropped the product negation forvfnmaddwas caught bycpu_aot_fma_packed, so the run does detect a broken translator. On this branch, each of the six mutations failscpu_aot_fma_packed.Checklist
AI-assisted.