diff options
| author | 2018-12-20 23:56:45 -0300 | |
|---|---|---|
| committer | 2019-01-15 17:54:50 -0300 | |
| commit | 5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e (patch) | |
| tree | 757c037b7ae4aa6a34a5cd04e4270bd9804326c1 /src | |
| parent | shader_decode: Implement MUFU (diff) | |
| download | yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar.gz yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.tar.xz yuzu-5e6a0a08c14df8e1993f4f72b1bbfd388a5ea48e.zip | |
shader_decode: Implement FMNMX_C, FMNMX_R and FMNMX_IMM
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/decode/arithmetic.cpp | 18 |
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 | } |