feat(shader): decode VOP3 F32 interpolation instructions #1524

Closed
SandBoss wants to merge 2 commits from upstream-pr/1524 into main
SandBoss commented 2026-10-08 11:03:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandBoss on 2026-10-08T11:03:31Z.


PR title

feat(shader): decode VOP3 F32 interpolation instructions

PR description

What

Add canonical, unmodified VOP3 encodings for the existing interpolation instructions:

  • V_INTERP_P1_F32 (0x200)
  • V_INTERP_P2_F32 (0x201)
  • V_INTERP_MOV_F32 (0x202)

Decode the attribute/channel and vector or parameter selector into the existing interpolation operand representation. Preserve the VOP3 family and two-word instruction length, and route VOP3 interpolation through the existing interpolation translator.

Reject source/output modifiers, the attribute high bit, noncanonical unused-source fields, invalid vector sources, and reserved parameter selectors rather than silently approximating them.

Register vector_interp_e64 with CTest. The shader progress counter is unchanged: this extends encodings of existing opcodes, not the unique opcode inventory.

Encoding provenance: LLVM's VOP3Interp_gfx10, opcode assignments, and GFX10 assembler fixtures. Translation semantics are reused from this project's VINTRP implementation. Limitations and lack of hardware confirmation are recorded in TechnicalDebt.md.

Related: #697 adds different, F16 interpolation opcodes. This change does not require that PR, but both touch decoder/dispatch code and may need conflict resolution.

Tested

Windows, isolated C++20 regression harness, MinGW GCC 13.2.0, based on e79c971f99acd6987b1d6545e9ba57c00b11fe04.

  • 660 combinations of opcode, attribute, channel, destination and source passed decoded-operand checks and E32/E64 IR equivalence checks with barycentrics enabled and disabled.
  • Malformed, modifier and truncated-instruction cases are rejected.
  • The same regression failed before the changes: VOP3 opcode is not implemented.
  • Rollback restored the original source hashes and reproduced the same failure.

No title or homebrew, console hardware, Linux execution, or SPIR-V backend validation was tested. Full-project configuration failed on missing SDL2/FFmpeg submodules; the supported GCC 15.2.0 build and full CTest suite still need to run.

The split patch passed git apply --check --ignore-space-change against the touched files from upstream main at 3c054008b8211405583e60c47eb13ca026e8eb10. That revision has not been compiled or tested with this change.

Checklist

  • Based on current main; no other open PR implements the same functions — rebase and reconfirm before submission.
  • One topic per PR; follow-ups go in a new PR.
  • No comments added to code.
  • Unsupported paths fail explicitly; no silent stubs added.
  • No investigation notes or images added to the repository; known limitations are in TechnicalDebt.md.
  • No new third-party dependencies.
  • Generic behaviour, not specific to one title.
  • Depends on: none.
  • AI-assisted: yes, written with OpenAI Codex. Human review is still required.

Patch refresh — 2026-10-08

The patch was regenerated against the user checkout at 4b2413fb5716bb56101e777536fe374e49ba90a2. Updated documentation context are preserved. Patch line endings are now LF. git apply --check --ignore-space-change --whitespace=error-all succeeds with empty stderr on that checkout; actual application also succeeds on a disposable copy. The focused runtime test results above are from the earlier tested base, not a new test run on this revision.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4785771300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1524). Originally posted by [SandBoss](https://github.com/SandBoss) on 2026-10-08T11:03:31Z. --- # PR title feat(shader): decode VOP3 F32 interpolation instructions # PR description ### What Add canonical, unmodified VOP3 encodings for the existing interpolation instructions: - `V_INTERP_P1_F32` (`0x200`) - `V_INTERP_P2_F32` (`0x201`) - `V_INTERP_MOV_F32` (`0x202`) Decode the attribute/channel and vector or parameter selector into the existing interpolation operand representation. Preserve the VOP3 family and two-word instruction length, and route VOP3 interpolation through the existing interpolation translator. Reject source/output modifiers, the attribute high bit, noncanonical unused-source fields, invalid vector sources, and reserved parameter selectors rather than silently approximating them. Register `vector_interp_e64` with CTest. The shader progress counter is unchanged: this extends encodings of existing opcodes, not the unique opcode inventory. Encoding provenance: LLVM's [VOP3Interp_gfx10](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/VOPInstructions.td), [opcode assignments](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/VOP3Instructions.td), and [GFX10 assembler fixtures](https://github.com/llvm/llvm-project/blob/main/llvm/test/MC/AMDGPU/gfx10_asm_vop3.s). Translation semantics are reused from this project's VINTRP implementation. Limitations and lack of hardware confirmation are recorded in `TechnicalDebt.md`. Related: #697 adds different, F16 interpolation opcodes. This change does not require that PR, but both touch decoder/dispatch code and may need conflict resolution. ### Tested Windows, isolated C++20 regression harness, MinGW GCC 13.2.0, based on `e79c971f99acd6987b1d6545e9ba57c00b11fe04`. - 660 combinations of opcode, attribute, channel, destination and source passed decoded-operand checks and E32/E64 IR equivalence checks with barycentrics enabled and disabled. - Malformed, modifier and truncated-instruction cases are rejected. - The same regression failed before the changes: `VOP3 opcode is not implemented`. - Rollback restored the original source hashes and reproduced the same failure. No title or homebrew, console hardware, Linux execution, or SPIR-V backend validation was tested. Full-project configuration failed on missing SDL2/FFmpeg submodules; the supported GCC 15.2.0 build and full CTest suite still need to run. The split patch passed `git apply --check --ignore-space-change` against the touched files from upstream `main` at `3c054008b8211405583e60c47eb13ca026e8eb10`. That revision has not been compiled or tested with this change. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions — rebase and reconfirm before submission. - [x] One topic per PR; follow-ups go in a new PR. - [x] No comments added to code. - [x] Unsupported paths fail explicitly; no silent stubs added. - [x] No investigation notes or images added to the repository; known limitations are in `TechnicalDebt.md`. - [x] No new third-party dependencies. - [x] Generic behaviour, not specific to one title. - [x] Depends on: none. - [x] AI-assisted: yes, written with OpenAI Codex. Human review is still required. ### Patch refresh — 2026-10-08 The patch was regenerated against the user checkout at `4b2413fb5716bb56101e777536fe374e49ba90a2`. Updated documentation context are preserved. Patch line endings are now LF. `git apply --check --ignore-space-change --whitespace=error-all` succeeds with empty stderr on that checkout; actual application also succeeds on a disposable copy. The focused runtime test results above are from the earlier tested base, not a new test run on this revision.
klosixgaming-arch commented 2026-10-08 11:15:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:15:36Z.

Review: COMMENTED


Good implementation of VOP3 F32 interpolation instruction decoding. The comprehensive testing (660 combinations) and proper validation of edge cases is excellent.

Strengths:

  • Thorough testing covering all opcode/attribute/channel/destination/source combinations
  • Proper rejection of malformed, modifier, and truncated instructions
  • Good documentation in TechnicalDebt about encoding provenance and limitations
  • Correct reuse of existing VINTRP translation semantics

Minor notes:

  1. The PR mentions potential conflict with #697 (F16 interpolation opcodes) - worth coordinating if both are being worked on simultaneously
  2. No hardware validation was performed, which is appropriately documented

This looks ready to merge once CI passes and any rebase conflicts are resolved.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5455698894 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1524#pullrequestreview-5455698894). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T11:15:36Z. **Review:** COMMENTED --- Good implementation of VOP3 F32 interpolation instruction decoding. The comprehensive testing (660 combinations) and proper validation of edge cases is excellent. **Strengths:** - Thorough testing covering all opcode/attribute/channel/destination/source combinations - Proper rejection of malformed, modifier, and truncated instructions - Good documentation in TechnicalDebt about encoding provenance and limitations - Correct reuse of existing VINTRP translation semantics **Minor notes:** 1. The PR mentions potential conflict with #697 (F16 interpolation opcodes) - worth coordinating if both are being worked on simultaneously 2. No hardware validation was performed, which is appropriately documented This looks ready to merge once CI passes and any rebase conflicts are resolved.
klosixgaming-arch commented 2026-10-08 11:22:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-08T11:22:08Z.

Review: APPROVED


Solid implementation of VOP3 F32 interpolation instruction decoding. This extends the decoder's capabilities while maintaining compatibility with existing VINTRP semantics.

Strengths:

  • Clean addition of canonical VOP3 encodings for existing interpolation opcodes
  • Proper validation and rejection of non-canonical forms (modifiers, attribute high bit, invalid sources)
  • Comprehensive test coverage: 660 combinations plus malformed/modifier/truncation guards
  • Good documentation with LLVM source references for encoding provenance
  • Correct routing through the existing interpolation translator

Technical notes:

  • The approach of treating these as additional encodings rather than new unique opcodes is correct for the progress counter
  • Proper handling of both E32 and E64 instruction formats
  • Test cases properly verify IR equivalence between VOP3 and VINTRP forms

This will improve compatibility with shaders using VOP3 interpolation instructions. Ready to merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5455780300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1524#pullrequestreview-5455780300). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-08T11:22:08Z. **Review:** APPROVED --- Solid implementation of VOP3 F32 interpolation instruction decoding. This extends the decoder's capabilities while maintaining compatibility with existing VINTRP semantics. **Strengths:** - Clean addition of canonical VOP3 encodings for existing interpolation opcodes - Proper validation and rejection of non-canonical forms (modifiers, attribute high bit, invalid sources) - Comprehensive test coverage: 660 combinations plus malformed/modifier/truncation guards - Good documentation with LLVM source references for encoding provenance - Correct routing through the existing interpolation translator **Technical notes:** - The approach of treating these as additional encodings rather than new unique opcodes is correct for the progress counter - Proper handling of both E32 and E64 instruction formats - Test cases properly verify IR equivalence between VOP3 and VINTRP forms This will improve compatibility with shaders using VOP3 interpolation instructions. Ready to merge.
SandBoss commented 2026-10-08 12:43:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandBoss on 2026-10-08T12:43:04Z.


ok, i think this can be merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6060118573 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1524#issuecomment-6060118573). Originally posted by [SandBoss](https://github.com/SandBoss) on 2026-10-08T12:43:04Z. --- ok, i think this can be merged.
oneandonlydean commented 2026-10-09 08:54:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:54:26Z.


Closing: no title is shown reaching a VOP3 v_interp_*_f32 on main, and the forms accepted here (no modifiers) are the ones normally encoded as VINTRP. Reopen with the title ID and the VOP3 opcode is not implemented line if one hits it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077700479 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1524#issuecomment-6077700479). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:54:26Z. --- Closing: no title is shown reaching a VOP3 `v_interp_*_f32` on main, and the forms accepted here (no modifiers) are the ones normally encoded as VINTRP. Reopen with the title ID and the `VOP3 opcode is not implemented` line if one hits it.

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
boykopovar/AnyPS5!1524
No description provided.