shader: lower RDNA2 vector reverse subtract v_subrev_nc_u32 in pixel_aot #570
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!570
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/570/head"
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?
@stan495 on GitHub · 2026-11-22 12:57 UTC · original
stan495:shader/lower-v-subrev-nc-u32→main· +47 −8 · 6 files · 2 commits · merged 2026-11-22 13:39 UTCChange
Lower the RDNA2 VOP2 vector reverse subtract instruction
v_subrev_nc_u32(_e32opcode0x27) intools/pixel_aot.py, evaluatingb - awith modulo-32 integer wrapping throughasfloat. This completes the non-carry vector addition/subtraction trio in VOP2 alongsidev_add_nc_u32andv_sub_nc_u32.SUPPORTED_INSTRUCTIONS_REGEXintools/scan_unsupported_shaders.pyso the scanner recognizesv_subrev_nc_u32_e32as supported.0x27and scanner recognition assertions intests/rdna2_tools_check.py.("VOP2", "v_subrev_nc_u32")intests/form_coverage_check.py.VOP2_INT_OPSandvop2_integer_groupintests/pixel_aot_check.py, asserting reverse operand order(asuint(alu20) - asuint(params[0].w)).tests/pixel_aot_check.pyverifying that unsupported_e64encoding and float modifiers (abs) onv_subrev_nc_u32are rejected.docs/experiments.md.Verification
Tested commit
9f95f16on Windows 11 Build 26200.9711, AMD Ryzen 7 7800X3D + AMD Radeon RX 7900 XTX (driver 32.0.32029.2010), Visual Studio 2022 17.14, and Microsoft Basic Render Driver (WARP).Commands and results:
Negative controls:
In
tests/pixel_aot_check.py,must_rejectverifies thatv_subrev_nc_u32_e64(unsupported encoding) andv_subrev_nc_u32_e32 v12, abs(v18), v18(illegal float modifier on integer operand) are both refused.Evidence and follow-up
The lowering completes the non-carry integer vector addition and subtraction group in
pixel_aot.py. The operand ordering follows the AMD RDNA 2 ISA definition forV_SUBREV_NC_U32(D.u = S1.u - S0.u), anddocs/experiments.mdhas been updated to document the 9 VOP2 integer instructions.Reproduction command:
Checklist
AI-assisted: yes.