shader: preserve untouched half in VOP1 B16 writes #370

Manually merged
github merged 1 commit from gh-pr/370/head into gh-pr/370/base 2026-11-26 09:18:08 +00:00
Owner

@⁠Techx3 on GitHub · 2026-08-28 22:52 UTC · original
Techx3:techx3/vop1-f16-preserve-high-half → main · +244 −90 · 8 files · 1 commits · merged 2026-08-30 15:33 UTC

Summary

  • treat base and DPP 16-bit VOP1 destinations as low-half writes
  • apply the same destination behavior to VOP3-encoded VOP1 instructions
  • preserve explicit SDWA DST_SEL and DST_UNUSED semantics
  • cover both base VOP1 and VOP3-encoded V_RCP_F16 with a runtime regression

Why

GFX10 16-bit VOP1 operations update one 16-bit lane of VDST. Writing the complete DWORD clears the untouched upper half; a later half-precision operation can then consume zero instead of the guest value and produce incorrect infinity or NaN results.

The decoder already models this behavior for low-half VOP2 FP16 instructions. This change applies the same destination selection to every implemented VOP1 instruction with a 16-bit result.

Scope

Only destination-lane preservation is changed. Arithmetic, rounding, overflow, and SDWA behavior remain separate.

Validation

  • built shader_recompiler_compute_tests and kyty_emulator in Release mode
  • shader_cfg: passed
  • shader_recompiler_compute: passed
  • VectorVop1F16PreservesHighHalf verifies base and VOP3 forms
**@⁠Techx3** on GitHub · 2026-08-28 22:52 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/370) `Techx3:techx3/vop1-f16-preserve-high-half` → `main` · +244 −90 · 8 files · 1 commits · merged 2026-08-30 15:33 UTC ## Summary - treat base and DPP 16-bit VOP1 destinations as low-half writes - apply the same destination behavior to VOP3-encoded VOP1 instructions - preserve explicit SDWA DST_SEL and DST_UNUSED semantics - cover both base VOP1 and VOP3-encoded V_RCP_F16 with a runtime regression ## Why GFX10 16-bit VOP1 operations update one 16-bit lane of VDST. Writing the complete DWORD clears the untouched upper half; a later half-precision operation can then consume zero instead of the guest value and produce incorrect infinity or NaN results. The decoder already models this behavior for low-half VOP2 FP16 instructions. This change applies the same destination selection to every implemented VOP1 instruction with a 16-bit result. ## Scope Only destination-lane preservation is changed. Arithmetic, rounding, overflow, and SDWA behavior remain separate. ## Validation - built shader_recompiler_compute_tests and kyty_emulator in Release mode - shader_cfg: passed - shader_recompiler_compute: passed - VectorVop1F16PreservesHighHalf verifies base and VOP3 forms
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:18:07 +00:00
github manually merged commit 0830d43449 into gh-pr/370/base 2026-11-26 09:18:08 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.