Repository navigation
Conversation
…rands
In RDNA2 ISA, a 32-bit literal constant (code 255) used for a 64-bit
signed integer (i64) operand is sign-extended to 64 bits, while u64 /
b64 literals are zero-extended and f64 literals occupy the upper 32
bits. code64 only distinguished f64 vs non-f64, so negative 32-bit
literals on _i64 instructions (v_cmp*_i64, v_ashrrev_i64, s_ashr_i64,
s_bfe_i64, s_flbit_i32_i64, v_mad_i64_i32) were zero-extended instead.
Replace the `f64: bool` parameter on code64/read64 with `Lit64 { U64,
I64, F64 }`, sign-extending 32-bit literals for i64 instructions, with
a GPU test across wave32 and split wave64.
Assisted-by: OpenCode (Gemini 4 Neon)
|
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on One more than the baseline; sign-extending 32-bit literals for 64-bit forms is exercised and green. Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Tested — xcl-dev/xcl PR #1258 was open at STOR-WINLAB ran Windows 11 Enterprise Evaluation 25H2 x64 (
& "L:\XclTooling\verify-pr1523-1362129-t3-cf2e05e7\target\debug\build\xcl\77aca8ccb20e299f\out\xcl-77aca8ccb20e299f.exe" gpu::recomp::tests::gpu_i64_literal_is_sign_extended --exact --nocapture --test-threads=1Result — 1 passed, 0 failed, 0 ignored, 0 GPU skips, 728 filtered out, 0.56s. The fixture and wrapper both exited 0. The stock fixture ran standalone wave32. Both comparison masks read back as Not tested — Native or split wave64, direct DXIL, other adapters, the full suite, and retail smoke. AI use — T3 Code / Codex ( |
|
Independent native wave64 GPU check of exact PR head Tested
This is the focused GPU regression only. I did not run the full workspace suite, direct DXIL mode, or a paired title smoke on this PR; the existing RX 6800M full-suite baseline has GPU device-suspension failures unrelated to this focused test. AI-assisted checkout, testing, log verification, and report drafting with OpenAI Codex (GPT-6). No game data was used. |
|
@b3IKK this PR fixes the HLSL path; the direct-DXIL path ( A direct-path change with a GPU test is on a branch you are welcome to take into this PR: upipibi@6fd538f3 ( RTX 3070 8 GB, driver 616.56, Windows 11, debug, on AI-assisted (Claude Code, Claude Opus 5.5): found it by porting VIctory #447's fix, wrote the change and test, ran them, wrote this. |
In RDNA2 ISA, a 32-bit literal constant (
code == 255) used for a 64-bit signed integer (i64) operand is sign-extended to 64 bits, whileu64/b64literals are zero-extended andf64literals occupy the upper 32 bits.code64only distinguishedf64vs non-f64, so negative 32-bit literals on_i64instructions (v_cmp*_i64,v_ashrrev_i64,s_ashr_i64,s_bfe_i64,s_flbit_i32_i64,v_mad_i64_i32) were zero-extended instead.This replaces
f64: booloncode64/read64withLit64 { U64, I64, F64 }, sign-extending 32-bit literals fori64instructions while keepingu64/b64andf64unchanged.What is in it
crates/xcl/src/gpu/recomp/emit.rs: addLit64 { U64, I64, F64 }and sign-extend 32-bit literals incode64/read64fori64operations insalu64andvalu64.crates/xcl/src/gpu/recomp/tests.rs: add GPU testgpu_i64_literal_is_sign_extendedcoveringV_CMP_EQ_I64,V_ASHRREV_I64,S_ASHR_I64,V_MAD_I64_I32, andV_CMP_EQ_U64control across wave32 and split wave64 (verified failing before the fix).Tested
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): 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no 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_i64_literal_is_sign_extended: 1 passed, 0 failed across wave32 and split wave64 (failed on the GPU before the fix)Regression run
main:
PR:
Not tested
AI use
emit.rs, wrote the fix and GPU test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.