Skip to content

[upstream #1159] Recompiler: honour 32-bit SSRC0 in salu64 (s_bfm_b64) - #3

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1159
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1159

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

salu64 checked o.size == 32 for ins[1] (shift amounts and s_bfe controls) but unconditionally called read64 on ins[0]. In s_bfm_b64, SSRC0 is a 32-bit operand (rdna2_spec.rs), so passing m0 (124), exec_hi (127), or s105 failed translation with Err("op") because code64 rejects them as 64-bit register pairs.

This uses the same o.size == 32 check for both salu64 source operands.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: read 32-bit ins[0] operands with read() instead of read64() in salu64.
  • crates/xcl/src/gpu/recomp/tests.rs: add GPU test gpu_s_bfm_b64_accepts_32bit_ssrc0 testing S_BFM_B64 with m0 and s105 across wave32 and split wave64 (verified failing translation before the fix).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)
  • cargo test -p xcl --lib gpu_s_bfm_b64_accepts_32bit_ssrc0: 1 passed, 0 failed across wave32 and split wave64 (failed with s_bfm_b64: op before the fix)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: 04ca7f808558acf8f595580bf0d941ac740479e1
gpu: NVIDIA GeForce RTX 5080
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1648 (PresentX 1648)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14462 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited emit.rs, wrote the fix and GPU test, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.

Mirror of xcl-dev#1159 (auto-synced, do not edit).

salu64 checked o.size == 32 for ins[1] (shift amounts / bfe controls)
but unconditionally called read64 on ins[0]. In s_bfm_b64, SSRC0 is a
32-bit operand (rdna2_spec.rs), so passing m0 (124), exec_hi (127), or
s105 failed translation with Err(op) because code64 rejects them as
64-bit register pairs.

Use the same o.size == 32 check for both salu64 source operands, with a
GPU test for s_bfm_b64 using m0 and s105 across wave32 and split wave64.

Assisted-by: OpenCode (Gemini 4 Neon)
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#1159 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants