cpu: preserve packed FMA destination inputs in optimized builds #644

Closed
R0Y00 wants to merge 1 commit from upstream-pr/650 into main
R0Y00 commented 2026-11-22 17:35:00 +00:00 (Migrated from github.com)

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


Change

Follow up on #349. The Windows release job on MSVC 19.52.37029.0 reported that vfmadd132ps returned the addend for finite lanes and lost the old destination's signaling NaN. The same mismatch appeared in unrelated PRs #643, #644, and #645.

Read each local lane through a byte pointer, keep the old destination live throughout the operation, and assign the separately initialized result vector after all lanes have been evaluated. The existing differential still checks finite cancellation, NaN bit patterns, the memory form, and upper-YMM clearing.

Verification

Local Windows build 26200, MSVC 19.51.36244.0, commit ea56b89:

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)$' --output-on-failure

Both tests passed. The local configure used /Z7 for its compiler checks. The Windows CI run on MSVC 19.52 will verify the toolset on which the original regression appeared.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6545519572 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/650). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T17:35:00Z. --- ## Change Follow up on #349. The Windows `release` job on MSVC 19.52.37029.0 reported that `vfmadd132ps` returned the addend for finite lanes and lost the old destination's signaling NaN. The same mismatch appeared in unrelated PRs #643, #644, and #645. Read each local lane through a byte pointer, keep the old destination live throughout the operation, and assign the separately initialized result vector after all lanes have been evaluated. The existing differential still checks finite cancellation, NaN bit patterns, the memory form, and upper-YMM clearing. ## Verification Local Windows build 26200, MSVC 19.51.36244.0, commit `ea56b89`: ```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)$' --output-on-failure ``` Both tests passed. The local configure used `/Z7` for its compiler checks. The Windows CI run on MSVC 19.52 will verify the toolset on which the original regression appeared.
upstream-sync closed this pull request 2026-11-24 06:44:09 +00:00
R0Y00 commented 2026-11-24 06:48:37 +00:00 (Migrated from github.com)

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


Closing as superseded by #649. The equivalent lane-read and separate-writeback fix is on main in 2bb9ee0, and the post-merge Windows Release run passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7083260920 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/650#issuecomment-7083260920). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-22T17:59:45Z. --- Closing as superseded by #649. The equivalent lane-read and separate-writeback fix is on main in 2bb9ee0, and the post-merge Windows Release run passed.

Pull request closed

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!644
No description provided.