shader: decode scalar ALU, lane ops, and integer multiply in disasm_rdna2 #884

Manually merged
github merged 1 commit from gh-pr/884/head into gh-pr/884/base 2026-11-26 22:25:42 +00:00
Owner

@⁠Holastor on GitHub · 2026-11-23 15:46 UTC · original
Holastor:shader/disasm-decode-sop-vop → main · +163 −11 · 3 files · 1 commits · merged 2026-11-23 15:59 UTC

Description

Decodes common scalar ALU, vector multiply, and lane operations in tools/disasm_rdna2.py for RDNA 2 / GFX10:

  • SOP1:
    • Bitwise and count operations: s_brev_b32, s_brev_b64, s_bcnt0_i32_b32, s_bcnt0_i32_b64, s_bcnt1_i32_b32, s_bcnt1_i32_b64, s_ff0_i32_b32, s_ff0_i32_b64, s_ff1_i32_b32, s_ff1_i32_b64, s_flbit_i32_b32, s_flbit_i32_b64, s_flbit_i32, s_flbit_i32_i64, s_sext_i32_i8, s_sext_i32_i16, s_bitset0_b64, s_bitset1_b64.
    • Control flow / PC / exception: s_getpc_b64 (SDST only), s_rfe_b64 (SSRC0 only).
    • Saveexec / wrexec families: s_and_saveexec_b64, s_or_saveexec_b64, s_xor_saveexec_b64, s_andn2_saveexec_b64, s_orn2_saveexec_b64, s_nand_saveexec_b64, s_nor_saveexec_b64, s_xnor_saveexec_b64, s_andn1_saveexec_b64, s_orn1_saveexec_b64, s_andn1_wrexec_b64, s_andn2_wrexec_b64, s_or_saveexec_b32, s_xor_saveexec_b32, s_andn2_saveexec_b32, s_orn2_saveexec_b32, s_nand_saveexec_b32, s_nor_saveexec_b32, s_xnor_saveexec_b32, s_andn1_saveexec_b32, s_orn1_saveexec_b32, s_andn1_wrexec_b32, s_andn2_wrexec_b32.
    • Bit replicate: s_bitreplicate_b64_b32.
    • Distinguishes 64-bit destination vs 64-bit source in SOP1 operand formatting (dst_64 vs src0_64).
  • SOP2:
    • Bitfield extraction: s_bfe_u32, s_bfe_i32, s_bfe_u64, s_bfe_i64.
    • Bitfield mask: s_bfm_b32, s_bfm_b64.
    • 64-bit arithmetic shift right: s_ashr_i64.
    • High integer multiplication: s_mul_hi_u32, s_mul_hi_i32.
  • VOP2:
    • 24-bit integer multiplication: v_mul_i32_i24_e32, v_mul_hi_i32_i24_e32, v_mul_u32_u24_e32, v_mul_hi_u32_u24_e32.
    • Legacy float MAC: v_mac_legacy_f32_e32.
    • Bitwise XNOR: v_xnor_b32_e32.
  • VOP3:
    • Lane operations: v_readlane_b32 (0x360) and v_writelane_b32 (0x361).
  • Scanner and tests:
    • Registers base opcodes in tools/scan_unsupported_shaders.py.
    • Adds golden test vectors and LLVM 15 comparison fixture instructions in tests/rdna2_tools_check.py.

Evidence

python -B tests/rdna2_tools_check.py
# Ran 75 tests in 1.068s: OK (skipped=1)

python -B tests/docs_links_check.py
# Checked 13 Markdown files and 179 links.

python -B tests/bidi_controls_check.py
# Checked 706 tracked source, script and build/CI files: no bidirectional controls.

python -B tests/form_coverage_check.py
# form coverage checks passed

python -B tests/pso_readiness_check.py
# PSO census, evidence states, and native hash control passed

python -B tests/shader_census_check.py
# Ran 7 tests in 0.263s: OK

python -B tests/shader_probe_check.py
# All controls passed
**@⁠Holastor** on GitHub · 2026-11-23 15:46 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/884) `Holastor:shader/disasm-decode-sop-vop` → `main` · +163 −11 · 3 files · 1 commits · merged 2026-11-23 15:59 UTC ### Description Decodes common scalar ALU, vector multiply, and lane operations in `tools/disasm_rdna2.py` for RDNA 2 / GFX10: - **SOP1**: - Bitwise and count operations: `s_brev_b32`, `s_brev_b64`, `s_bcnt0_i32_b32`, `s_bcnt0_i32_b64`, `s_bcnt1_i32_b32`, `s_bcnt1_i32_b64`, `s_ff0_i32_b32`, `s_ff0_i32_b64`, `s_ff1_i32_b32`, `s_ff1_i32_b64`, `s_flbit_i32_b32`, `s_flbit_i32_b64`, `s_flbit_i32`, `s_flbit_i32_i64`, `s_sext_i32_i8`, `s_sext_i32_i16`, `s_bitset0_b64`, `s_bitset1_b64`. - Control flow / PC / exception: `s_getpc_b64` (SDST only), `s_rfe_b64` (SSRC0 only). - Saveexec / wrexec families: `s_and_saveexec_b64`, `s_or_saveexec_b64`, `s_xor_saveexec_b64`, `s_andn2_saveexec_b64`, `s_orn2_saveexec_b64`, `s_nand_saveexec_b64`, `s_nor_saveexec_b64`, `s_xnor_saveexec_b64`, `s_andn1_saveexec_b64`, `s_orn1_saveexec_b64`, `s_andn1_wrexec_b64`, `s_andn2_wrexec_b64`, `s_or_saveexec_b32`, `s_xor_saveexec_b32`, `s_andn2_saveexec_b32`, `s_orn2_saveexec_b32`, `s_nand_saveexec_b32`, `s_nor_saveexec_b32`, `s_xnor_saveexec_b32`, `s_andn1_saveexec_b32`, `s_orn1_saveexec_b32`, `s_andn1_wrexec_b32`, `s_andn2_wrexec_b32`. - Bit replicate: `s_bitreplicate_b64_b32`. - Distinguishes 64-bit destination vs 64-bit source in SOP1 operand formatting (`dst_64` vs `src0_64`). - **SOP2**: - Bitfield extraction: `s_bfe_u32`, `s_bfe_i32`, `s_bfe_u64`, `s_bfe_i64`. - Bitfield mask: `s_bfm_b32`, `s_bfm_b64`. - 64-bit arithmetic shift right: `s_ashr_i64`. - High integer multiplication: `s_mul_hi_u32`, `s_mul_hi_i32`. - **VOP2**: - 24-bit integer multiplication: `v_mul_i32_i24_e32`, `v_mul_hi_i32_i24_e32`, `v_mul_u32_u24_e32`, `v_mul_hi_u32_u24_e32`. - Legacy float MAC: `v_mac_legacy_f32_e32`. - Bitwise XNOR: `v_xnor_b32_e32`. - **VOP3**: - Lane operations: `v_readlane_b32` (0x360) and `v_writelane_b32` (0x361). - **Scanner and tests**: - Registers base opcodes in `tools/scan_unsupported_shaders.py`. - Adds golden test vectors and LLVM 15 comparison fixture instructions in `tests/rdna2_tools_check.py`. ### Evidence ```powershell python -B tests/rdna2_tools_check.py # Ran 75 tests in 1.068s: OK (skipped=1) python -B tests/docs_links_check.py # Checked 13 Markdown files and 179 links. python -B tests/bidi_controls_check.py # Checked 706 tracked source, script and build/CI files: no bidirectional controls. python -B tests/form_coverage_check.py # form coverage checks passed python -B tests/pso_readiness_check.py # PSO census, evidence states, and native hash control passed python -B tests/shader_census_check.py # Ran 7 tests in 0.263s: OK python -B tests/shader_probe_check.py # All controls passed ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:25:39 +00:00
github manually merged commit 76b65b03dc into gh-pr/884/base 2026-11-26 22:25:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.