Repository navigation
feat(shader): VOP3 v_add/sub_nc_i32 (clamp), v_mul_lo_u16, 16-bit mads, v_ashrrev_i64 - #257
Merged
Merged
Conversation
This was referenced Oct 1, 2026
Merged
MixPrecision and SdwaDestination dispatch hand-assembled RDNA through the recompiler and compare every lane with a CPU model, but were never in ctest. Move them to tests/execution/, which is globbed into one test per file with the same target names, so new execution tests add a file and no CMake lines. They exit 77 (skipped) when the host has no Vulkan device; the Linux runner installs lavapipe and sets ANYPS5_REQUIRE_VULKAN=1 so they cannot skip there. Co-Authored-By: Claude <noreply@anthropic.com>
…6, v_mad_u16/i16/u32_u16/i32_i16, v_ashrrev_i64 These VOP3 opcodes threw in the decoder. v_add_nc_i32 and v_sub_nc_i32 are what compilers emit for signed saturating add/sub, so their clamp saturates to the int32 range. The 16-bit mads honour op_sel on their 16-bit sources; the u32_u16/i32_i16 forms take a 32-bit addend and write all 32 bits, so they do not get the 16-bit destination select. Co-Authored-By: Claude <noreply@anthropic.com>
adriadam10
force-pushed
the
feat/vop3-integer-gaps
branch
from
October 1, 2026 20:51
224c723 to
e144f43
Compare
This was referenced Oct 2, 2026
Merged
9 tasks done
This was referenced Oct 2, 2026
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
These VOP3 opcodes threw "VOP3 opcode is not implemented":
v_add_nc_i32,v_sub_nc_i32(0x37f, 0x376), including clamp: these are what compilers emit for signed saturating add/sub (sadd.sat/ssub.sat), so clamp saturates to[INT32_MIN, INT32_MAX](overflow from the sign bits, result(a >> 31) ^ 0x7fffffff). Other modifiers stay rejected.v_mul_lo_u16(0x305):integer16Binary(IMul32), op_sel on sources like the other 16-bit binaries.v_mad_u16,v_mad_i16(0x340, 0x35e): 16-bit result, op_sel on all three sources and the destination half.v_mad_u32_u16,v_mad_i32_i16(0x373, 0x375): 16x16 product plus a 32-bit addend, 32-bit result. They share the I16 ternary decode path butapplyNativeVop3I16TernarySelectorsno longer sets the 16-bit destination select or src2 op_sel for them (with it the result was truncated to 16 bits; the test caught that).v_ashrrev_i64(0x301): next to the existingv_lshrrev_b64.Found with an ISA sweep (every gfx1013 opcode from
llvm-mcthroughDecodeRdnaInstruction+TranslateInstruction).Test
agc_driver_vop3_integer: hand-assembled compute shader (words fromllvm-mc -mcpu=gfx1013), 64 lanes with edge inputs (INT32_MIN/MAX overflow pairs, -1, 0x8000 halves, shift counts 0/31/32/63/64) and pseudo-random ones, 14 results per lane checked against a C++ model, including the clamp and op_sel forms. 16-bit results are checked on the written half only. No cross-lane ops, so it runs on lavapipe in CI.Tested
Linux: passes on RADV (Radeon 660M) and lavapipe; without the change it fails with "VOP3 opcode is not implemented". Full ctest (99) passes.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)