From 6904764aab4ef8ce8f17e8bc82a95deb1708d57d Mon Sep 17 00:00:00 2001 From: "Daniel R." <47796739+polybiusproxy@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:52:48 +0100 Subject: [PATCH] shader_recompiler/frontend: implement `V_MIN3_U32` --- src/shader_recompiler/frontend/translate/translate.h | 1 + src/shader_recompiler/frontend/translate/vector_alu.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/shader_recompiler/frontend/translate/translate.h b/src/shader_recompiler/frontend/translate/translate.h index fd5a5889..f0403890 100644 --- a/src/shader_recompiler/frontend/translate/translate.h +++ b/src/shader_recompiler/frontend/translate/translate.h @@ -221,6 +221,7 @@ public: void V_FMA_F64(const GcnInst& inst); void V_MIN3_F32(const GcnInst& inst); void V_MIN3_I32(const GcnInst& inst); + void V_MIN3_U32(const GcnInst& inst); void V_MAX3_F32(const GcnInst& inst); void V_MAX3_U32(bool is_signed, const GcnInst& inst); void V_MED3_F32(const GcnInst& inst); diff --git a/src/shader_recompiler/frontend/translate/vector_alu.cpp b/src/shader_recompiler/frontend/translate/vector_alu.cpp index 7ac3131c..eb90c256 100644 --- a/src/shader_recompiler/frontend/translate/vector_alu.cpp +++ b/src/shader_recompiler/frontend/translate/vector_alu.cpp @@ -347,6 +347,8 @@ void Translator::EmitVectorAlu(const GcnInst& inst) { return V_MIN3_F32(inst); case Opcode::V_MIN3_I32: return V_MIN3_I32(inst); + case Opcode::V_MIN3_U32: + return V_MIN3_U32(inst); case Opcode::V_MAX3_F32: return V_MAX3_F32(inst); case Opcode::V_MAX3_I32: @@ -1064,6 +1066,13 @@ void Translator::V_MIN3_I32(const GcnInst& inst) { SetDst(inst.dst[0], ir.SMin(src0, ir.SMin(src1, src2))); } +void Translator::V_MIN3_U32(const GcnInst& inst) { + const IR::U32 src0{GetSrc(inst.src[0])}; + const IR::U32 src1{GetSrc(inst.src[1])}; + const IR::U32 src2{GetSrc(inst.src[2])}; + SetDst(inst.dst[0], ir.UMin(src0, ir.UMin(src1, src2))); +} + void Translator::V_MAX3_F32(const GcnInst& inst) { const IR::F32 src0{GetSrc(inst.src[0])}; const IR::F32 src1{GetSrc(inst.src[1])};