Repository navigation
fix(recompiler): read f16 inline constants as half values and honour VOP3 f16 op_sel - #162
Merged
boykopovar merged 1 commit intoSep 30, 2026
Conversation
…VOP3 f16 op_sel A float inline constant (4.0, 2.0, -4.0...) read by an f16 operation is the half value in the low 16 bits (LLVM getInlineEncodingV216); it was the low half of the f32 bits, 0. op_sel[0..2] now selects the high half of v_fma/min3/max3/med3_f16 sources. GTA V's CAS sharpen computed rcp(1 + 4w) as rcp(0) and stored black. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
8 of 9 tasks
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Sep 30, 2026
…s half values and honour VOP3 f16 op_sel)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
getInlineEncodingV216documents. It was read as the low half of the f32 bits, which is 0.op_sel[0..2]now selects the high half of thev_fma_f16,v_min3_f16,v_max3_f16andv_med3_f16sources. The decoder already set it, but the read ignored it.Found in GTA V's FidelityFX CAS sharpen pass:
v_fma_f16 v38, 4.0, v22, 1.0computed1 + 4was 0, so the pass returnedrcp(0)and stored a black frame.Tested
Windows 11 Pro, AMD Ryzen 5 7600 (6-core), NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository