shader: lower 8 ternary integer ALU instructions in pixel_aot (VOP3) #766

Manually merged
github merged 2 commits from gh-pr/766/head into gh-pr/766/base 2026-11-26 22:16:57 +00:00
Owner

@⁠MrSkelee on GitHub · 2026-11-23 01:48 UTC · original
MrSkelee:feature/shader-vop3-ternary-int → main · +177 −3 · 5 files · 2 commits · merged 2026-11-23 03:11 UTC

Lowers 8 ternary 32-bit integer and bitwise vector ALU instructions in tools/pixel_aot.py (VOP3):

  • v_add3_u32: (src0 + src1 + src2)
  • v_or3_b32: (src0 | src1 | src2)
  • v_xor3_b32: (src0 ^ src1 ^ src2)
  • v_and_or_b32: ((src0 & src1) | src2)
  • v_xad_u32: ((src0 ^ src1) + src2)
  • v_lshl_or_b32: ((src0 << (src1 & 31)) | src2)
  • v_lshl_add_u32: ((src0 << (src1 & 31)) + src2)
  • v_add_lshl_u32: ((src0 + src1) << (src2 & 31))

Highlights

  • Operand Validation & Rejection Controls: Enforces arity 3, rejects invalid _e32 encodings, out-of-range registers (> v255), and float modifiers (abs, -, clamp).
  • Binary Roundtrip: Added both groups to check_binary() for LLVM 15 assembly and disassembly validation.
  • Offscreen Readback (WARP & Hardware): Added dedicated check_vop3_ternary_int_draws testing 60 parameter cases across two groups with aliased destination/source registers, 1-bit mutation detection, and negative control verification.

Verification

ctest --preset dev -R "pixel_aot_vop3_ternary_int_warp" -V
ctest --preset release -R "pixel_aot_vop3_ternary_int_warp" -V
python -B tests/rdna2_tools_check.py
**@⁠MrSkelee** on GitHub · 2026-11-23 01:48 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/766) `MrSkelee:feature/shader-vop3-ternary-int` → `main` · +177 −3 · 5 files · 2 commits · merged 2026-11-23 03:11 UTC Lowers 8 ternary 32-bit integer and bitwise vector ALU instructions in `tools/pixel_aot.py` (VOP3): - `v_add3_u32`: `(src0 + src1 + src2)` - `v_or3_b32`: `(src0 | src1 | src2)` - `v_xor3_b32`: `(src0 ^ src1 ^ src2)` - `v_and_or_b32`: `((src0 & src1) | src2)` - `v_xad_u32`: `((src0 ^ src1) + src2)` - `v_lshl_or_b32`: `((src0 << (src1 & 31)) | src2)` - `v_lshl_add_u32`: `((src0 << (src1 & 31)) + src2)` - `v_add_lshl_u32`: `((src0 + src1) << (src2 & 31))` ### Highlights - **Operand Validation & Rejection Controls**: Enforces arity 3, rejects invalid `_e32` encodings, out-of-range registers (> v255), and float modifiers (`abs`, `-`, `clamp`). - **Binary Roundtrip**: Added both groups to `check_binary()` for LLVM 15 assembly and disassembly validation. - **Offscreen Readback (WARP & Hardware)**: Added dedicated `check_vop3_ternary_int_draws` testing 60 parameter cases across two groups with aliased destination/source registers, 1-bit mutation detection, and negative control verification. ### Verification ```powershell ctest --preset dev -R "pixel_aot_vop3_ternary_int_warp" -V ctest --preset release -R "pixel_aot_vop3_ternary_int_warp" -V python -B tests/rdna2_tools_check.py ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:16:56 +00:00
github manually merged commit efa9556162 into gh-pr/766/base 2026-11-26 22:16:57 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.