Repository navigation
Recompiler: allow inline-constant and NULL mask operands in the per-lane form - #1864
Conversation
…ane form In the per-lane direct DXIL backend (xcl-dev#1745): - `bridge()` rejected `V_CNDMASK_B32` / `V_ADD_CO_CI_U32` / `V_SUB_CO_CI_U32` / `V_SUBREV_CO_CI_U32` whenever the mask operand was not an SGPR (`m > 127`, such as inline carry-in `0` = 128 or `-1` = 193, or `NULL` = 125), even though `dxil::Lw::read64` already decodes non-SGPR mask operands without touching any SGPR. - `src_bit()` accepted only SGPRs, `128` (0), and `193` (-1), refusing `NULL` (125), inline integer masks (`129..=192`, `194..=208`), and 32-bit literals (`255`). - `src()` and `src64()` missed `125` (`NULL`). `bridge()` now skips SGPR injection when `m > 127 || m == 125`, `src_bit()` extracts the lane's bit from `NULL`, inline integers (sign-extended to 64 bits for negative values), and 32-bit literals, and `src()`/`src64()` handle `125`. Assisted-by: Antigravity (Gemini 4 Neon)
|
NVIDIA test report for Tested
Regression run ( base ( this PR: Not tested: this code in the title: it is on the opt-in direct-DXIL path ( AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it. |
|
NVIDIA counterpart to the RX 9060 XT run: RTX 3070 8 GB (32-lane waves, no native wave64), driver 616.56, Windows 11, debug,
AI-assisted (Claude Code). Synthetic tests only. |
, xcl-dev#1869, xcl-dev#1898) Brings main to full parity with upstream/main (8e87fc7): - xcl-dev#1930: invalidate block-local DXIL CSE wave/quad cache across dx.op.discard (fixes xcl-dev#1891) - xcl-dev#1864: allow inline-constant and NULL mask operands in the per-lane form - xcl-dev#1869: avoid 2 - off underflow in s_setreg_b32 targeting HW_REG_MODE bit 3 - xcl-dev#1898: truncate s instead of returning native on special values in round_exact Conflict in crates/xcl/src/gpu/dxil/core_tests.rs resolved by keeping both tests (opt_folds_i64_bitcast_selects_and_commutative_cse and s_setreg_b32_mode_bit3_does_not_underflow). Assisted-by: Antigravity (Gemini 4)
Pulls in xcl-dev#1836 (graphics and two-pass PSO disk cache + lazy MS/GS + shader build coalescing), xcl-dev#1930 (DXIL CSE across discard), xcl-dev#1900, xcl-dev#1005, xcl-dev#1053, xcl-dev#1864, xcl-dev#1866, xcl-dev#1869, xcl-dev#1876, and xcl-dev#1898 while keeping our RDNA4 MSAA clamp (xcl-dev#1908), wave64 graphics Direct DXIL guard (xcl-dev#1913), atomic writable-range tracking, static-sampler cache keys, and 4M-group indirect dispatch clamp.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
In the per-lane direct DXIL backend (#1745):
bridge()rejectedV_CNDMASK_B32,V_ADD_CO_CI_U32,V_SUB_CO_CI_U32, andV_SUBREV_CO_CI_U32whenever the mask operand was not an SGPR (m > 127, such as inline carry-in0=128or-1=193, orNULL=125), even thoughdxil::Lw::read64already decodes non-SGPR mask operands without reading any SGPR.src_bit()accepted only SGPRs,128(0), and193(-1), refusingNULL(125), inline integer masks (129..=192,194..=208), and 32-bit literals (255).src()andsrc64()missed125(NULL).Part of #1269.
bridge()now skips SGPR injection whenm > 127 || m == 125,src_bit()extracts the lane's bit fromNULL, inline integers (sign-extended to 64 bits for negative values), and 32-bit literals, andsrc()/src64()handle125.What is in it
crates/xcl/src/gpu/recomp/lower.rs: handle125(NULL) insrc()/src64(), extendsrc_bit()for125,129..=192,194..=208, and255, and skip SGPR injection inbridge()whenm > 127 || m == 125.crates/xcl/src/gpu/recomp/lower_dxil.rs: GPU parity testconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(wave32 and wave64,V_ADD_CO_CI_U32with128/193/125,V_CNDMASK_B32with inline positive/negative/NULL masks, and mask SALU with inline mask).Tested
cargo test --workspace -- --test-threads=4on 15fff3b: 960 passed, 0 failed, 43 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpu;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record)const_and_null_mask_operands_agree_with_hlsl_on_the_gpubefore the change failed (wave32: unsupported V_ADD_CO_CI_U32 (V_ADD_CO_CI_U32: mask operand 128)); passes on both wave32 and native wave64 afterRegression run
main:
this PR:
Not tested
WaveSize(32)) GPUs (NVIDIA / Intel / wave32-only).AI use