From 4b5baea6c41776addd5bb92bf07fe83191c952fb Mon Sep 17 00:00:00 2001 From: Chad Date: Sun, 4 Oct 2026 18:47:31 -0500 Subject: [PATCH] fix(shader): refuse v_dot2_f32_f16 without op_sel_hi on the accumulator Its meaning for the f32 accumulator is not known, like op_sel and neg_hi, and the integer dots already refuse anything but op_sel_hi set on every source. Co-Authored-By: Claude Opus 5.5 --- core/libs/prx/libSceAgcDriver/tests/execution/Float16Dot.cpp | 3 ++- .../shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/Float16Dot.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/Float16Dot.cpp index 56d54ed41..7242e910c 100644 --- a/core/libs/prx/libSceAgcDriver/tests/execution/Float16Dot.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/execution/Float16Dot.cpp @@ -111,7 +111,7 @@ void CheckRefused(AgcDriver::VulkanDevice& device, std::uint32_t word0, const st } catch (const std::exception& error) { refusal = error.what(); } - Require(refusal.find("v_dot2_f32_f16 accumulator op_sel and neg_hi are not implemented") != std::string::npos, what + " was not refused"); + Require(refusal.find("v_dot2_f32_f16 accumulator op_sel, op_sel_hi and neg_hi are not implemented") != std::string::npos, what + " was not refused"); } float Dot(float aLow, float aHigh, float bLow, float bHigh, float c) { @@ -152,6 +152,7 @@ int main() { Check(); CheckRefused(*device, 0xcc13600au, "op_sel on the accumulator"); CheckRefused(*device, 0xcc13440au, "neg_hi on the accumulator"); + CheckRefused(*device, 0xcc13000au, "op_sel_hi cleared on the accumulator"); std::puts("v_dot2_f32_f16 tests passed"); return 0; } catch (const std::exception& error) { diff --git a/core/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cpp b/core/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cpp index cb44b5325..d36faa036 100644 --- a/core/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cpp +++ b/core/shader/recompiler/RdnaDecoder/src/RdnaVectorOpDecoder.cpp @@ -2200,8 +2200,8 @@ RdnaInstruction DecodeRdnaVop3p(std::uint32_t programCounter, std::span 2u) { instruction.source2 = DecodeRdnaScalarSource(src2, programCounter); } - if (instruction.op == RdnaOpcode::VDot2F32F16 && (((opSel | negHi) >> 2u) & 1u) != 0u) { - throw std::invalid_argument("VOP3P v_dot2_f32_f16 accumulator op_sel and neg_hi are not implemented"); + if (instruction.op == RdnaOpcode::VDot2F32F16 && ((((opSel | negHi) >> 2u) & 1u) != 0u || ((opSelHi >> 2u) & 1u) == 0u)) { + throw std::invalid_argument("VOP3P v_dot2_f32_f16 accumulator op_sel, op_sel_hi and neg_hi are not implemented"); } if (instruction.op == RdnaOpcode::VFmaF32 || instruction.op == RdnaOpcode::VDot2F32F16 || isMadMixF16(instruction.op) || isPackedVop3p(instruction.op) || isVop3pIntegerSaturate(instruction.op)) { instruction.destination.clamp = clamp != 0u;