gfx2hlsl: allow component-wise float VALU ops from proven uniform sources for v_readfirstlane_b32 #3791

Manually merged
github merged 2 commits from github-bot/gh-3789 into main 2026-12-02 02:00:51 +00:00 AGit
Owner

@⁠Holastor on GitHub · 2026-12-01 22:34 UTC · original
Holastor:dxil/readfirstlane-uniform-analysis → main · +15 −4 · 2 files · 2 commits · merged 2026-12-02 01:56 UTC

Summary

Extends UNIFORM_VALU in tools/startup/gfx2hlsl.py to cover component-wise single-precision float conversions, arithmetic, transcendental, and clamp/min/max instructions (v_cvt_f32_i32, v_add_f32, v_sub_f32, v_subrev_f32, v_fmamk_f32, v_mad_f32, v_madak_f32, v_madmk_f32, v_rcp_iflag_f32, v_rsq_f32, v_sqrt_f32, v_exp_f32, v_floor_f32, v_trunc_f32, v_fract_f32, v_rndne_f32, v_sin_f32, v_cos_f32, v_min_f32, v_max_f32, v_min3_f32, v_max3_f32) when all source operands are proven uniform under an active EXEC mask.

  • Preserves existing EXEC provenance, source/output modifier (abs/neg/clamp/mul/div), and uniform_expr checks.
  • Intentionally excludes 2-operand read-modify-write accumulators (v_fmac_f32, v_mac_f32) that implicitly read dst.
  • On a local dry-run over 509 refused shaders, 6 programs cleared every v_readfirstlane_b32 site completely and advanced to later checks, while larger .c67 programs advanced past their initial uniform float chains to downstream non-uniform/wave-read sites.

Verification

  • python -B tests/startup_gfx2hlsl_readfirstlane_uniform_check.py (0 failed; added positive tests for v_cvt_f32_i32, v_add_f32 / v_sub_f32 with neg/clamp, and v_mad_f32 + v_floor_f32, plus negative controls for v_fmac_f32_e32 and varying v_add_f32)
  • python -B tests/startup_compute_readfirstlane_check.py (passed)
  • python -B tests/startup_gfx2hlsl_readfirstlane_recompute_check.py (0 failed)
  • python -B tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.py (0 failed)
  • python -B tests/docs_links_check.py and python -B tests/bidi_controls_check.py (passed)
**@⁠Holastor** on GitHub · 2026-12-01 22:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3789) `Holastor:dxil/readfirstlane-uniform-analysis` → `main` · +15 −4 · 2 files · 2 commits · merged 2026-12-02 01:56 UTC ## Summary Extends `UNIFORM_VALU` in `tools/startup/gfx2hlsl.py` to cover component-wise single-precision float conversions, arithmetic, transcendental, and clamp/min/max instructions (`v_cvt_f32_i32`, `v_add_f32`, `v_sub_f32`, `v_subrev_f32`, `v_fmamk_f32`, `v_mad_f32`, `v_madak_f32`, `v_madmk_f32`, `v_rcp_iflag_f32`, `v_rsq_f32`, `v_sqrt_f32`, `v_exp_f32`, `v_floor_f32`, `v_trunc_f32`, `v_fract_f32`, `v_rndne_f32`, `v_sin_f32`, `v_cos_f32`, `v_min_f32`, `v_max_f32`, `v_min3_f32`, `v_max3_f32`) when all source operands are proven uniform under an active `EXEC` mask. - Preserves existing `EXEC` provenance, source/output modifier (`abs`/`neg`/`clamp`/`mul`/`div`), and `uniform_expr` checks. - Intentionally excludes 2-operand read-modify-write accumulators (`v_fmac_f32`, `v_mac_f32`) that implicitly read `dst`. - On a local dry-run over 509 refused shaders, 6 programs cleared every `v_readfirstlane_b32` site completely and advanced to later checks, while larger `.c67` programs advanced past their initial uniform float chains to downstream non-uniform/wave-read sites. ## Verification - `python -B tests/startup_gfx2hlsl_readfirstlane_uniform_check.py` (0 failed; added positive tests for `v_cvt_f32_i32`, `v_add_f32` / `v_sub_f32` with `neg`/`clamp`, and `v_mad_f32` + `v_floor_f32`, plus negative controls for `v_fmac_f32_e32` and varying `v_add_f32`) - `python -B tests/startup_compute_readfirstlane_check.py` (passed) - `python -B tests/startup_gfx2hlsl_readfirstlane_recompute_check.py` (0 failed) - `python -B tests/startup_gfx2hlsl_readfirstlane_load_recompute_check.py` (0 failed) - `python -B tests/docs_links_check.py` and `python -B tests/bidi_controls_check.py` (passed)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 22:37:55 +00:00
github manually merged commit 3ecfbad7aa into main 2026-12-02 02:00:51 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.