aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-07-03 20:48:44 -0300
committerGitHub <noreply@github.com>2020-07-04 01:48:44 +0200
commite13154c83d52d9e1c26c55bc5655a5df641e26a9 (patch)
tree302fcc3171027124bec9cc154ef482fd491cf7e9 /Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
parent76e5af967a39879187214f0973d226eba126e93f (diff)
Implement shader LEA instruction and improve bindless image load/store (#1355)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
index 7c3d55c4..e55f1f32 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
@@ -384,6 +384,27 @@ namespace Ryujinx.Graphics.Shader.Instructions
context.Copy(Register(op.Predicate0), p1Res);
}
+ public static void Lea(EmitterContext context)
+ {
+ OpCodeAlu op = (OpCodeAlu)context.CurrOp;
+
+ bool negateA = op.RawOpCode.Extract(45);
+
+ int shift = op.RawOpCode.Extract(39, 5);
+
+ Operand srcA = GetSrcA(context);
+ Operand srcB = GetSrcB(context);
+
+ srcA = context.ShiftLeft(srcA, Const(shift));
+ srcA = context.INegate(srcA, negateA);
+
+ Operand res = context.IAdd(srcA, srcB);
+
+ context.Copy(GetDest(context), res);
+
+ // TODO: CC, X
+ }
+
public static void Lop(EmitterContext context)
{
IOpCodeLop op = (IOpCodeLop)context.CurrOp;