diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs index 77df3d8dad..92354cece3 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs @@ -125,8 +125,8 @@ namespace Ryujinx.Graphics.Shader.Instructions { // Add carry, or subtract borrow. res = context.IAdd(res, isSubtraction - ? context.BitwiseNot(GetCF(context)) - : context.BitwiseAnd(GetCF(context), Const(1))); + ? context.BitwiseNot(GetCF()) + : context.BitwiseAnd(GetCF(), Const(1))); } SetIaddFlags(context, res, srcA, srcB, op.SetCondCode, op.Extended, isSubtraction); @@ -693,7 +693,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (extended) { // Add with carry. - res = context.IAdd(res, context.BitwiseAnd(GetCF(context), Const(1))); + res = context.IAdd(res, context.BitwiseAnd(GetCF(), Const(1))); } else { @@ -806,7 +806,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (!extended || isSubtraction) { // C = d < a - context.Copy(GetCF(context), context.ICompareLessUnsigned(res, srcA)); + context.Copy(GetCF(), context.ICompareLessUnsigned(res, srcA)); } else { @@ -814,9 +814,9 @@ namespace Ryujinx.Graphics.Shader.Instructions Operand tempC0 = context.ICompareEqual (res, srcA); Operand tempC1 = context.ICompareLessUnsigned(res, srcA); - tempC0 = context.BitwiseAnd(tempC0, GetCF(context)); + tempC0 = context.BitwiseAnd(tempC0, GetCF()); - context.Copy(GetCF(context), context.BitwiseOr(tempC0, tempC1)); + context.Copy(GetCF(), context.BitwiseOr(tempC0, tempC1)); } // V = (d ^ a) & ~(a ^ b) < 0 @@ -827,7 +827,7 @@ namespace Ryujinx.Graphics.Shader.Instructions Operand tempV = context.BitwiseAnd(tempV0, tempV1); - context.Copy(GetVF(context), context.ICompareLess(tempV, Const(0))); + context.Copy(GetVF(), context.ICompareLess(tempV, Const(0))); SetZnFlags(context, res, setCC: true, extended: extended); } diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs index da5c7fed2f..572068dad3 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs @@ -71,26 +71,26 @@ namespace Ryujinx.Graphics.Shader.Instructions // previous result when extended is specified, to ensure // we have ZF set only if all words are zero, and not just // the last one. - Operand oldZF = GetZF(context); + Operand oldZF = GetZF(); Operand res = context.BitwiseAnd(context.ICompareEqual(dest, Const(0)), oldZF); - context.Copy(GetZF(context), res); + context.Copy(GetZF(), res); } else { - context.Copy(GetZF(context), context.ICompareEqual(dest, Const(0))); + context.Copy(GetZF(), context.ICompareEqual(dest, Const(0))); } - context.Copy(GetNF(context), context.ICompareLess(dest, Const(0))); + context.Copy(GetNF(), context.ICompareLess(dest, Const(0))); } public static void SetFPZnFlags(EmitterContext context, Operand dest, bool setCC) { if (setCC) { - context.Copy(GetZF(context), context.FPCompareEqual(dest, ConstF(0))); - context.Copy(GetNF(context), context.FPCompareLess (dest, ConstF(0))); + context.Copy(GetZF(), context.FPCompareEqual(dest, ConstF(0))); + context.Copy(GetNF(), context.FPCompareLess (dest, ConstF(0))); } } } diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs index c024fe0212..0b96d7518e 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs @@ -169,10 +169,10 @@ namespace Ryujinx.Graphics.Shader.Instructions { case Condition.Equal: case Condition.EqualUnordered: - return GetZF(context); + return GetZF(); case Condition.NotEqual: case Condition.NotEqualUnordered: - return context.BitwiseNot(GetZF(context)); + return context.BitwiseNot(GetZF()); } return Const(IrConsts.True); diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs index 4bf9303c09..5123a6e2af 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitHelper.cs @@ -9,22 +9,22 @@ namespace Ryujinx.Graphics.Shader.Instructions { static class InstEmitHelper { - public static Operand GetZF(EmitterContext context) + public static Operand GetZF() { return Register(0, RegisterType.Flag); } - public static Operand GetNF(EmitterContext context) + public static Operand GetNF() { return Register(1, RegisterType.Flag); } - public static Operand GetCF(EmitterContext context) + public static Operand GetCF() { return Register(2, RegisterType.Flag); } - public static Operand GetVF(EmitterContext context) + public static Operand GetVF() { return Register(3, RegisterType.Flag); }