shader: lower the remaining no-carry 32-bit add and sub forms in pixel_aot #576
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/582"
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 JB2WIN on 2026-11-22T14:06:46Z.
Change
tools/pixel_aot.pynow lowers the remaining 32-bit no-carry add/sub forms. This builds on #495 (VOP2v_add/sub_nc_u32_e32) and #570 (v_subrev_nc_u32_e32):v_add_nc_u32_e64,v_sub_nc_u32_e64,v_subrev_nc_u32_e64v_add_nc_i32andv_sub_nc_i32, in the unsuffixed spelling LLVM 15 prints. These are 32-bit wraparound with no clamp, so they produce the same bits as the u32 forms.The add/sub/subrev lowering is now one table branch (subrev =
b - a) instead of #570's separate subrev branch. #570'scheck_subrev_u32_drawis unchanged.Refused and tested as rejections, each paired with its accepted spelling:
clampon these formsabs/negon an e64 sourcev_add_nc_i32_e64: the explicit suffix is not the printed form, andgfx1013.tsvhas no row for itquad_perm/dpp8, which the existing DPP table already lowersFloat-written inline constants are taken as their binary32 bits, as for the #495 forms. This is now pinned for
1.0and-1.0. The scanner pattern andKNOWN_RDNA2_BASE_OPCODEScover the family. The scanner'sINTEGER_SOURCEclass is coarser than the translator and also acceptsv106, as before.Changed expectation: the e64 rows in the
bad_vop2rejection list (from #495/#570) are removed because e64 is now accepted. The new static group asserts their lowering.Semantics:
subrev= src1 − src0 follows the translator's existing convention. It matches LLVM 15 TableGen (VOP2Instructions.td:V_SUBREV_U32has revOpv_sub_u32, and the REV patterns swap operands; gfx10V_SUBREV_NC_U32encodes that pseudo). The draws check consistency with this convention on desktop GPUs. I could not check it against the RDNA 2 ISA PDF.AI-assisted (Claude Code).
Verification
Head is rebased on
bbebcad. Windows 11 (10.0.26200.9974), NVIDIA GeForce RTX 3080 (driver 32.0.16.2124, debug layer on) and WARP 10.0.26100.9818.draw-integer-ncwith CTestpixel_aot_integer_nc_{hardware,warp}(about 3.3 s / 0.8 s). It uses lossless integer readback and 11 draws: 3 groups × 5 rows (A, B). Every input and result is a normal binary32 pattern or ±0, and the test asserts this. The rows cover unsigned wrap, signed overflow, borrow, sub ≠ subrev, high-bit wrap, inline constants and VGPR-first operands.pixel_mismatchon both adapters. Dev-time mutation (subrev asa - b) fails both tests and was reverted.ctest --preset dev --no-tests=error -R "^(pixel_aot_|rdna2_tools_check$|pso_readiness)": 22/22.ctest --preset dev --no-tests=error(ond4c7656, before the last trivial rebase): 279 tests, 0 failed. Skips:bvh_wave64_hardware,bvh_wave64_warp,wave_shuffle_warp.tests/pixel_aot_check.py binarywith LLVM 15.0.7, locally: exit 0.tests/pixel_aot_check.py(controls),rdna2_tools_check.py,form_coverage_check.pyanddocs_links_check.pyall pass.Evidence and follow-up
KNOWN_RDNA2_BASE_OPCODES).dashboard.svgis not regenerated.🤖 Generated with Claude Code