summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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) {
122 SetRegister(bb, instr.gpr0, value); 122 SetRegister(bb, instr.gpr0, value);
123 break; 123 break;
124 } 124 }
125 case OpCode::Id::FMNMX_C:
126 case OpCode::Id::FMNMX_R:
127 case OpCode::Id::FMNMX_IMM: {
128 UNIMPLEMENTED_IF_MSG(instr.generates_cc,
129 "Condition codes generation in FMNMX is not implemented");
130
131 op_a = GetOperandAbsNegFloat(op_a, instr.alu.abs_a, instr.alu.negate_a);
132 op_b = GetOperandAbsNegFloat(op_b, instr.alu.abs_b, instr.alu.negate_b);
133
134 const Node condition = GetPredicate(instr.alu.fmnmx.pred, instr.alu.fmnmx.negate_pred != 0);
135
136 const Node min = Operation(OperationCode::FMin, NO_PRECISE, op_a, op_b);
137 const Node max = Operation(OperationCode::FMax, NO_PRECISE, op_a, op_b);
138
139 SetRegister(bb, instr.gpr0,
140 Operation(OperationCode::Select, NO_PRECISE, condition, min, max));
141 break;
142 }
125 default: 143 default:
126 UNIMPLEMENTED_MSG("Unhandled arithmetic instruction: {}", opcode->get().GetName()); 144 UNIMPLEMENTED_MSG("Unhandled arithmetic instruction: {}", opcode->get().GetName());
127 } 145 }