cpu: preserve packed FMA sources until writeback #643

Merged
R0Y00 merged 1 commit from upstream-pr/649 into main 2026-11-22 17:40:23 +00:00
R0Y00 commented 2026-11-22 17:32:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-22T17:32:52Z.


Change

Preserve the old packed FMA3 register operands until all lanes are computed. Read lane bytes directly from the source arrays and stage the result in a separate zero-initialized array before writing it back. The full-width memory load and the 128-bit upper-half clearing are retained.

Verification

On main at 40560a6, the Windows Release job (MSVC 19.52.37029) failed cpu_aot_fma_packed at the first vfmadd132ps_op case. The lifted bytes differ from native even on finite lanes. The observed output is consistent with a zeroed old destination. Failing Release job

On Windows 11 build 26200, Core i9-14900HX, MSVC 19.51.36244, the baseline 824370f passed the focused packed test. With this patch, both dev and release passed the scalar and packed tests with 192 and 190 bit-exact comparisons respectively, no skips:

cmake --build --preset release --target cpu_fma_packed_lifted cpu_fma_scalar_lifted
ctest --preset release --no-tests=error -R '^cpu_aot_fma_(packed|scalar)$' -V
cmake --build --preset dev --target cpu_fma_packed_lifted cpu_fma_scalar_lifted
ctest --preset dev --no-tests=error -R '^cpu_aot_fma_(packed|scalar)$' -V
python -B tests/form_coverage_check.py

The existing test remains the CI regression check on MSVC 19.52, including finite lanes, NaNs, 128-bit upper-half clearing, a memory operand and EVEX rejection.

Refs #349.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6545497649 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/649). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T17:32:52Z. --- ## Change Preserve the old packed FMA3 register operands until all lanes are computed. Read lane bytes directly from the source arrays and stage the result in a separate zero-initialized array before writing it back. The full-width memory load and the 128-bit upper-half clearing are retained. ## Verification On main at `40560a6`, the Windows Release job (MSVC 19.52.37029) failed `cpu_aot_fma_packed` at the first `vfmadd132ps_op` case. The lifted bytes differ from native even on finite lanes. The observed output is consistent with a zeroed old destination. [Failing Release job](https://github.com/R0Y00/Xbox2Windows/actions/runs/45048261432/job/137287648199) On Windows 11 build 26200, Core i9-14900HX, MSVC 19.51.36244, the baseline `824370f` passed the focused packed test. With this patch, both `dev` and `release` passed the scalar and packed tests with 192 and 190 bit-exact comparisons respectively, no skips: ```powershell cmake --build --preset release --target cpu_fma_packed_lifted cpu_fma_scalar_lifted ctest --preset release --no-tests=error -R '^cpu_aot_fma_(packed|scalar)$' -V cmake --build --preset dev --target cpu_fma_packed_lifted cpu_fma_scalar_lifted ctest --preset dev --no-tests=error -R '^cpu_aot_fma_(packed|scalar)$' -V python -B tests/form_coverage_check.py ``` The existing test remains the CI regression check on MSVC 19.52, including finite lanes, NaNs, 128-bit upper-half clearing, a memory operand and EVEX rejection. Refs #349. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:44:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!643
No description provided.