recomp: handle s_round_mode/s_setreg* rounding modes and verify non-fused MAD/MAC #90

Merged
certified-retart merged 1 commit from upstream-pr/91 into main 2026-11-23 10:47:31 +00:00
certified-retart commented 2026-11-23 08:42:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by certified-retart on 2026-11-23T08:42:26Z.


Fixes #73

Summary

Addresses the floating-point rounding and non-fused multiply-add gaps tracked in #73 without regressing retail graphics shaders that emit s_round_mode 0xC:

  1. s_round_mode, s_setreg_imm32_b32, and s_setreg_b32 (MODE[3:0]):
    • Removed all three instructions from the unconditional NOOPS list in crates/xcl/src/gpu/recomp/emit.rs and added a pre-scan (Em::configure_round_modes, called from
      ecomp::translate in mod.rs).
    • Zero-overhead NOOPs when exact: writes of default RNE (
<!-- greyfinch-sync:ivall/xcl:issue:6555536142 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/91). Originally posted by [certified-retart](https://github.com/certified-retart) on 2026-11-23T08:42:26Z. --- Fixes #73 ### Summary Addresses the floating-point rounding and non-fused multiply-add gaps tracked in #73 without regressing retail graphics shaders that emit s_round_mode 0xC: 1. **s_round_mode, s_setreg_imm32_b32, and s_setreg_b32 (MODE[3:0]):** - Removed all three instructions from the unconditional NOOPS list in crates/xcl/src/gpu/recomp/emit.rs and added a pre-scan (Em::configure_round_modes, called from ecomp::translate in mod.rs). - **Zero-overhead NOOPs when exact:** writes of default RNE (
upstream-sync closed this pull request 2026-11-24 06:57:07 +00:00
ivall commented 2026-11-24 07:00:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T10:48:07Z.


Merged – thanks, and thanks @MoonYueya for the measurements in #73.

Checked against the retail shader pack on the RX 9070: still 26 698 / 26 698 FSSM variants translated in full (no program is refused for a non-default mode), the same structuring as before. DXC on the programs that get the dynamic f16 mode (122 of a 1-in-40 sample of 670, XCL_SURVEY_ONLY=xcl_fp16_rm): 0 errors, median 0.84 s, max 6.1 s. Since the HLSL of those programs changes, they compile again on a title's first run (XDefiant's UI text was missing until its cache warmed up, then right).

One fix on top (697dbb1): #67 removed gpu_ready_wave32, so the new GPU tests gate on gpu_ready – they run on 32-lane GPUs through the split wave64 form. Tested on Windows 11 with an RX 9070 (RDNA4): cargo test --workspace green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with XCL_SPLIT_WAVE64=1; Unicorn Overlord and XDefiant run with this round merged. Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7098510241 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/91#issuecomment-7098510241). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T10:48:07Z. --- Merged – thanks, and thanks @MoonYueya for the measurements in #73. Checked against the retail shader pack on the RX 9070: still **26 698 / 26 698** FSSM variants translated in full (no program is refused for a non-default mode), the same structuring as before. DXC on the programs that get the dynamic f16 mode (122 of a 1-in-40 sample of 670, `XCL_SURVEY_ONLY=xcl_fp16_rm`): 0 errors, median 0.84 s, max 6.1 s. Since the HLSL of those programs changes, they compile again on a title's first run (XDefiant's UI text was missing until its cache warmed up, then right). One fix on top (697dbb1): #67 removed `gpu_ready_wave32`, so the new GPU tests gate on `gpu_ready` – they run on 32-lane GPUs through the split wave64 form. Tested on Windows 11 with an RX 9070 (RDNA4): `cargo test --workspace` green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with `XCL_SPLIT_WAVE64=1`; Unicorn Overlord and XDefiant run with this round merged. Thanks!
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
xcl-dev/xcl!90
No description provided.