rdna2spirv: support op_sel destination high half on v_interp_p2_f16 (SHADER-INTERP-P2-F16-OPSEL) #1743

Closed
github-bot wants to merge 1 commit from gh-pr/1743/head into gh-pr/1743/base
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 10:55 UTC · original
abnalstlll-byte:feat/shader-interp-p2-f16-opsel → main · +14 −4 · 2 files · 1 commits · closed without merging

Claimed in Issue #14: claiming: SHADER-INTERP-P2-F16-OPSEL (#14).

Summary

v_interp_p2_f16 in VOP3 form supports the op_sel destination bit (bit 14 of dword0 / op_sel:[..., 1]), which selects whether the 16-bit interpolated float is written to the low half (dhi=0, keeping high half) or high half (dhi=1, keeping low half) of the destination VGPR.

Previously tools/rdna2spirv.py:11479 hardcoded self.write_lo16, discarding the high half destination selection.

  • Route destination half selection via _, dhi = self.opsel_bits(mods, 3) and self.write_half16(a[0], ..., dhi).
  • When dhi=0 (default or no modifier), behavior is identical (write_lo16, keeping preset high half).
  • When dhi=1, write_half16 writes the 16-bit float into bits 31..16 while keeping bits 15..0 of vdst.

Verification

  • python -m unittest discover -s tests/semantic -p test_interp_f16_high.py: 6/6 tests PASS in 0.095s (including new test_p2_f16_destination_high_half_opsel).
  • python -m unittest discover -s tests/semantic -p test_interp_f16.py: 1/1 test PASS.
  • Clean-room check: python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_interp_f16_high.py -> 0 violations.
  • Merges cleanly onto latest main (bcaa13dad).

AI-assisted (Gemini 3.8 Flash High).

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 10:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1743) `abnalstlll-byte:feat/shader-interp-p2-f16-opsel` → `main` · +14 −4 · 2 files · 1 commits · closed without merging Claimed in Issue #14: `claiming: SHADER-INTERP-P2-F16-OPSEL` (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14). ### Summary `v_interp_p2_f16` in VOP3 form supports the `op_sel` destination bit (bit 14 of dword0 / `op_sel:[..., 1]`), which selects whether the 16-bit interpolated float is written to the low half (`dhi=0`, keeping high half) or high half (`dhi=1`, keeping low half) of the destination VGPR. Previously `tools/rdna2spirv.py:11479` hardcoded `self.write_lo16`, discarding the high half destination selection. - Route destination half selection via `_, dhi = self.opsel_bits(mods, 3)` and `self.write_half16(a[0], ..., dhi)`. - When `dhi=0` (default or no modifier), behavior is identical (`write_lo16`, keeping preset high half). - When `dhi=1`, `write_half16` writes the 16-bit float into bits 31..16 while keeping bits 15..0 of `vdst`. ### Verification - `python -m unittest discover -s tests/semantic -p test_interp_f16_high.py`: 6/6 tests PASS in 0.095s (including new `test_p2_f16_destination_high_half_opsel`). - `python -m unittest discover -s tests/semantic -p test_interp_f16.py`: 1/1 test PASS. - Clean-room check: `python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_interp_f16_high.py` -> 0 violations. - Merges cleanly onto latest `main` (`bcaa13dad`). AI-assisted (Gemini 3.8 Flash High).
_interp_p2_f16 in VOP3 form supports the op_sel destination bit (bit 14 of
dword0 / op_sel:[..., 1]), which selects whether the 16-bit interpolated float
is written to the low half (dhi=0, keeping high half) or high half (dhi=1,
keeping low half) of the destination VGPR.

Parse destination bit via opsel_bits(mods, 3) and emit via write_half16(..., dhi).
Adds synthetic unit test 	est_p2_f16_destination_high_half_opsel to verify
destination high half routing and low half preservation. Clean-room compliant.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:03:26 +00:00
github-bot closed this pull request 2026-11-26 10:03:26 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 10:56 UTC · original

Closing in favor of #1729 (@⁠Undefined3301), which was opened earlier for the same v_interp_p2_f16 destination op_sel fix.

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 10:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1743#issuecomment-7160381908) Closing in favor of #1729 (@⁠Undefined3301), which was opened earlier for the same v_interp_p2_f16 destination op_sel fix.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.