aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
index 588ec216..7fe969a0 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
@@ -100,5 +100,15 @@ namespace Ryujinx.Graphics.Shader.Instructions
context.Copy(GetNF(), context.FPCompareLess (dest, zero, fpType));
}
}
+
+ public static Operand AddWithCarry(EmitterContext context, Operand lhs, Operand rhs, out Operand carryOut)
+ {
+ Operand result = context.IAdd(lhs, rhs);
+
+ // C = Rd < Rn
+ carryOut = context.INegate(context.ICompareLessUnsigned(result, lhs));
+
+ return result;
+ }
}
} \ No newline at end of file