aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-04-25 10:40:29 -0300
committerGitHub <noreply@github.com>2020-04-25 23:40:29 +1000
commit1c9aba6de1520aea5480c032e0ff5664ac1bb36f (patch)
treeb07db92c05deff32a585f3fac282ad9763cd8f37
parent34d19f381cd496ec5e6d4fb13b45d47c141b7a63 (diff)
Fix mode and Reg08.H1 decoding on XMAD instruction (#1156)
-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);