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

Closed
leonida/mandy
abnalstlll-byte wants to merge 0 commits from feat/shader-interp-p2-f16-opsel into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

abnalstlll-byte commented 2026-11-25 10:55:29 +00:00

Claimed in Issue #14: claiming: SHADER-INTERP-P2-F16-OPSEL (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142482665).

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).

Claimed in Issue #14: `claiming: SHADER-INTERP-P2-F16-OPSEL` (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142482665). ### 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 commented 2026-11-25 10:56:45 +00:00

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

Closing in favor of #1729 (@Undefined3301), which was opened earlier for the same v_interp_p2_f16 destination op_sel fix.
Sign in to join this conversation.
No description provided.