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

Closed
abnalstlll-byte wants to merge 1 commit from upstream-pr/1743 into main
abnalstlll-byte commented 2026-11-25 10:55:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T10:55:29Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5489949820 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1743). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T10:55:29Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T10:56:45Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7160381908 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1743#issuecomment-7160381908). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T10:56:45Z. --- Closing in favor of #1729 (@Undefined3301), which was opened earlier for the same v_interp_p2_f16 destination op_sel fix.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1743
No description provided.