feat(shader): apply f16 and f64 output modifiers when denormals flushed #15243
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15243"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-11-02T22:02:08Z.
What
core/shader/recompiler/Translation/src/TranslationContext/OperandAccess.cppthrewoutput modifier on an f16 or f64 result with f16/f64 output denormals flushed is not implementedwhen an instruction with precisionf16(scalar or packed) orf64had an output modifier (mul:2,mul:4,div:2) in a shader with output denormals flushed in itsFLOAT_MODE.This implements the output modifier scaling for
f16andf64underFLOAT_MODEdenormal flush semantics matching AMD RDNA2 (gfx1035/gfx1036):f16, appliesmul:2,mul:4(exponent addition) anddiv:2(exponent subtraction) inscaleF16ResultandscaleF16Bits. On intermediate values exceeding the half float range, respects the F32 finite boundary so intermediate values correctly scale back into valid F16 range.sign), ensuring-0.0and negative denormals flush to negative zero rather than being converted to+0.0.Float64Instructions.cpp,float64Operationexplicitly clearsdestination.omod = 0ufor non-U64 operations before callingwriteOperand, ensuring f64-to-f32 conversions such asv_cvt_f32_f64correctly ignore output modifiers on hardware.Float16Modifiers.cppexecution test to verify scaled output results under flushed float mode (including ternary scaled outputsv_min3_f16,v_max3_f16,v_med3_f16, andv_div_fixup_f16) instead of asserting refusal.docs/dev/debt/shader.md. Reducesunsupported_throwsintools/progress.pyfrom 149 to 148.Tested
4f00ef87f0).agc_driver_float16_modifiers Passed 2.98 sec).ctest --test-dir /tmp/anyps5_build -R "vector_half_double_output_modifiers" -Vpassed (1/1 tests passed, 0.00s).ctest --test-dir /tmp/anyps5_build -R "^(agc_driver_float16_modifiers|agc_driver_f64_rounding)$" -Vpassed.ctest --test-dir /tmp/anyps5_build -R "^vector_"passed.python3 tools/check_conventions.py --base origin/mainclean (0 errors; expecteddebt-lengthwarning at 1,687 chars preserving existing context while detailing hardware evidence).python3 tools/progress.pyconfirmsunsupported_throwsdecreases from 149 to 148.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)