From af5c6e4ccb0cedc764fff0a62b46cd969c21b006 Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Fri, 21 Dec 2018 19:11:18 -0300
Subject: [PATCH] shader_decode: Implement IADD32I

---
 .../shader/decode/arithmetic_integer_immediate.cpp    | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/video_core/shader/decode/arithmetic_integer_immediate.cpp b/src/video_core/shader/decode/arithmetic_integer_immediate.cpp
index 57d9f54f7..a158d345a 100644
--- a/src/video_core/shader/decode/arithmetic_integer_immediate.cpp
+++ b/src/video_core/shader/decode/arithmetic_integer_immediate.cpp
@@ -24,6 +24,17 @@ u32 ShaderIR::DecodeArithmeticIntegerImmediate(BasicBlock& bb, u32 pc) {
     Node op_b = Immediate(static_cast<s32>(instr.alu.imm20_32));
 
     switch (opcode->get().GetId()) {
+    case OpCode::Id::IADD32I: {
+        UNIMPLEMENTED_IF_MSG(instr.op_32.generates_cc,
+                             "Condition codes generation in IADD32I is not implemented");
+        UNIMPLEMENTED_IF_MSG(instr.iadd32i.saturate, "IADD32I saturation is not implemented");
+
+        op_a = GetOperandAbsNegInteger(op_a, false, instr.iadd32i.negate_a, true);
+
+        const Node value = Operation(OperationCode::IAdd, PRECISE, op_a, op_b);
+        SetRegister(bb, instr.gpr0, value);
+        break;
+    }
     case OpCode::Id::LOP32I: {
         UNIMPLEMENTED_IF_MSG(instr.op_32.generates_cc,
                              "Condition codes generation in LOP32I is not implemented");