tooling: decode v_mqsad_u32_u8 in the RDNA2 disassembler #1363
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1370"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:27:03Z.
What
tools/disasm_rdna2.py: adds VOP3 opcode 0x175,v_mqsad_u32_u8. Before this it decoded asv_vop3_175 v0, v4, v6, v8("Unknown VOP3 opcode 0x175"). It now printsv_mqsad_u32_u8 v[0:3], v[4:5], v6, v[8:11]: a four-register destination and accumulator (src2), a register-pair src0 and a one-register src1.VOP3_RESTRICTED_MODIFIERS["v_mqsad_u32_u8"] = (True, False): clamp is accepted; abs, neg and omod are refused (llvm-mc 19 rejects them; the assembler also rejects an SGPR, constant or special-register src2, so the decoder refuses those words too).<invalid VGPR quad>, the way a pair past v255 already prints<invalid VGPR pair>. The two duplicated destination formatters in the VOP3 path now share one helper.tests/rdna2_tools_check.py: ten golden vectors encoded by llvm-mc 19.1.7 (clamp, vcc, s[2:3], exec/m0, literal, inline constants, null, ttmp pair, v[252:255] quad) join the existing golden/round-trip tests; 0x175 joins the neighbour-name test and the llvm modifier grid; new refused forms (abs, neg, omod, SGPR and inline-constant accumulator); a test that the quad stops at v255; the binary-scan test lists the mnemonic. Two existing tests used 0x175 as an "unknown opcode" example, so they now use 0x179, and the table-driven synthetic-forms test handles four-register widths.docs/experiments.md: one paragraph next to the existing disassembler note.Why
The disassembler is the oracle for shader tracing. An opcode that prints as
v_vop3_175with single registers hides both the instruction and its operand widths. The sibling forms 0x172 and 0x173 were added the same way.Tested
Windows:
ctest --test-dir <build> -C Release -R "^rdna2_tools_check$" --output-on-failure(the CMake testrdna2_tools_checkrunspython -B tests/rdna2_tools_check.py; CI sets LLVM_LIB=libLLVM-15 for it).Run on Linux (only llvm-mc 19.1.7 is installed here; LLVM 15 was not run):
LLVM_LIB=/usr/lib/llvm-19/lib/libLLVM-19.so LLVM_MC=llvm-mc-19 LLVM_OBJCOPY=llvm-objcopy-19 python3 -B tests/rdna2_tools_check.py: 139 tests; the new and changed tests pass. Six tests fail identically on unmodified origin/main with LLVM 19 (test_llvm_comparison, test_source_built_records_after_s_endpgm, test_interp_f16_llvm_round_trip, test_vop1_vop2_sdwa_llvm_round_trip, test_vop1_vop2_dpp_llvm_round_trip): LLVM 19 versus 15 differences, unrelated.Not covered:
tools/pixel_aot.pydoes not lower v_mqsad_u32_u8 (unchanged, and docs/experiments.md already says so). Known gap left alone: odd SGPR src0 encodings (llvm prints the aligned pair) and a few reserved src codes print differently from llvm for every pair-source VOP3 op; this is shared decode code and not specific to this opcode.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:34:58Z.
Verified on Windows Server 2025 (Build 26100) at commit
b70f516a668a0255e3d1640cc18cb277815a0d83:tests/rdna2_tools_check.pyok (4.19s)Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T09:35:11Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
b70f516ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.