aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs23
1 files changed, 11 insertions, 12 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
index 5a919c77..7c3d55c4 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
@@ -598,24 +598,23 @@ namespace Ryujinx.Graphics.Shader.Instructions
bool signedA = context.CurrOp.RawOpCode.Extract(48);
bool signedB = context.CurrOp.RawOpCode.Extract(49);
bool highA = context.CurrOp.RawOpCode.Extract(53);
- bool highB = false;
- XmadCMode mode;
+ bool isReg = (op is OpCodeAluReg) && !(op is OpCodeAluRegCbuf);
+ bool isImm = (op is OpCodeAluImm);
- if (op is OpCodeAluReg)
+ XmadCMode mode = isReg || isImm
+ ? (XmadCMode)context.CurrOp.RawOpCode.Extract(50, 3)
+ : (XmadCMode)context.CurrOp.RawOpCode.Extract(50, 2);
+
+ bool highB = false;
+
+ if (isReg)
{
highB = context.CurrOp.RawOpCode.Extract(35);
-
- mode = (XmadCMode)context.CurrOp.RawOpCode.Extract(50, 3);
}
- else
+ else if (!isImm)
{
- mode = (XmadCMode)context.CurrOp.RawOpCode.Extract(50, 2);
-
- if (!(op is OpCodeAluImm))
- {
- highB = context.CurrOp.RawOpCode.Extract(52);
- }
+ highB = context.CurrOp.RawOpCode.Extract(52);
}
Operand srcA = GetSrcA(context);