tooling: decode 29 gfx1013 SOPK and SOPP opcodes #1085
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1092"
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-24T00:50:58Z.
Change
Refs #938. Name nine additional SOPK immediate comparisons, decode the
s_call_b64destination as an SGPR pair, and name 19 SOPP system opcodes ongfx1013. Use a raw hexadecimal immediate for message and dependency-control
operands so the output is independent of LLVM's symbolic spelling.
Verification
Linux x86-64, commit
94044c6a.python3 -B tests/rdna2_tools_check.pypassed with 92 passes and 9 skips forchecks that require LLVM.
LLVM_LIB=libLLVM-15.so.1 LLVM_MC=llvm-mc-15 LLVM_OBJCOPY=llvm-objcopy-15 python3 -B tests/rdna2_tools_check.pypassed all 101 tests with LLVM 15.0.6.
ed983c1cand the new tests:python3 -B tests/rdna2_tools_check.py TestRdna2Disasm.test_sopk_compare_and_call_opcodes TestRdna2Disasm.test_sopp_system_opcodesreported 29 failing subtests. The same vectors pass with this commit.
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.pypasses the new tests and reproduces the same three LLVM 19 incompatibilities
as the baseline (
test_interp_f16_llvm_round_trip,test_llvm_comparison,test_source_built_records_after_s_endpgm).build-a-turno python3 -B tests/pixel_aot_check.py binary llvm-mc-15 llvm-objcopy-15 "$PWD/out/llvm15/usr/lib/x86_64-linux-gnu/libLLVM-15.so.1"exited 0 with the extracted LLVM 15.0.6 toolchain.
build-a-turno python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 "$PWD/out/llvm15/usr/lib/x86_64-linux-gnu/libLLVM-15.so.1"exited 0 with the extracted LLVM 15.0.6 toolchain.
build-a-turno python3 -B tests/pixel_aot_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.soexited 1 at the existing
v_cvt_f16_i16_e32 v1, 0xfff0encoding assertion.build-a-turno python3 -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.soexited 0.
git diff --checkpassed.Evidence and follow-up
The MIT-licensed test vectors are synthetic gfx1013 words. LLVM 15.0.6 and
LLVM 19.1.7 both reassemble all 29 expected instructions byte-for-byte. The
tests verify the instruction length and the offset of a following
s_endpgmand check the fallback for a reserved SOPP word.
AMD RDNA 2 ISA reference ·
LLVM 15 scalar instruction definitions
The four SOPP debug branches are outside this slice.
This change uses the existing disassembly and test entry points.
Checklist
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:58:22Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
94044c6a88ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:51:07Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
94044c6ℹ️ 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.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T01:38:21Z.
AI-assisted. Both review findings were addressed in
d9d453e3: docs/experiments.md now documents the SOPK and SOPP decoding coverage (forms, operand convention, reproduction command, decoding-only limits), and the new mnemonics, including s_sendmsg and s_call_b64, are registered in the scanner so they are counted as recognized by the translator-rejected path instead of unsupported opcodes.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:58:22Z.
Code review location:
tools/disasm_rdna2.py; line 272This expands the public binary/hex decoder by 29 gfx1013 instruction forms, but the commit updates neither
README.mdnordocs/experiments.md. RootAGENTS.mdexplicitly requires updating one of those documents when a public capability changes. Add a scoped note covering the newly decoded forms, raw-immediate convention, reproduction command, and decoding-only validation limits rather than leaving that information solely in the commit message.AGENTS.md reference: AGENTS.md:L171-L172
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T00:58:22Z.
Code review location:
tools/disasm_rdna2.py; line 143When the binary scanner consumes these newly decoded instructions,
is_opcode_recognized()intools/scan_unsupported_shaders.pystill consults a separate set that omitss_sendmsgand 15 other added mnemonics, includings_call_b64. For example, analyzing030090bf000081bfnow decodess_sendmsg 0x3; s_endpgmbut still producesunsupported_opcodes={'s_sendmsg': 1}and theunsupported_opcodescategory instead ofopcode_recognized_translator_rejected. Consequently, generated recognition totals continue counting these decoded ISA instructions as unrecognized. Register the new SOPP/SOPK names with the scanner and add an integration assertion; this does not require adding lowering support.Useful? React with 👍 / 👎.