summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-12-21 03:56:45 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-01-15 21:54:50 +0100
commit5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e (patch)
tree757c037b7ae4aa6a34a5cd04e4270bd9804326c1 /src/video_core/shader/decode
parentshader_decode: Implement MUFU (diff)
downloadyuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar
yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar.gz
yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar.bz2
yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar.lz
yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar.xz
yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar.zst
yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.zip
Diffstat (limited to 'src/video_core/shader/decode')
-rw-r--r--src/video_core/shader/decode/arithmetic.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/arithmetic.cpp b/src/video_core/shader/decode/arithmetic.cpp
index fb688c324..0b6654397 100644
--- a/src/video_core/shader/decode/arithmetic.cpp
+++ b/src/video_core/shader/decode/arithmetic.cpp
@@ -122,6 +122,24 @@ u32 ShaderIR::DecodeArithmetic(BasicBlock& bb, u32 pc) {
SetRegister(bb, instr.gpr0, value);
break;
}
+ case OpCode::Id::FMNMX_C:
+ case OpCode::Id::FMNMX_R:
+ case OpCode::Id::FMNMX_IMM: {
+ UNIMPLEMENTED_IF_MSG(instr.generates_cc,
+ "Condition codes generation in FMNMX is not implemented");
+
+ op_a = GetOperandAbsNegFloat(op_a, instr.alu.abs_a, instr.alu.negate_a);
+ op_b = GetOperandAbsNegFloat(op_b, instr.alu.abs_b, instr.alu.negate_b);
+
+ const Node condition = GetPredicate(instr.alu.fmnmx.pred, instr.alu.fmnmx.negate_pred != 0);
+
+ const Node min = Operation(OperationCode::FMin, NO_PRECISE, op_a, op_b);
+ const Node max = Operation(OperationCode::FMax, NO_PRECISE, op_a, op_b);
+
+ SetRegister(bb, instr.gpr0,
+ Operation(OperationCode::Select, NO_PRECISE, condition, min, max));
+ break;
+ }
default:
UNIMPLEMENTED_MSG("Unhandled arithmetic instruction: {}", opcode->get().GetName());
}