aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-03-03 11:02:08 -0300
committerGitHub <noreply@github.com>2020-03-03 15:02:08 +0100
commitdc97457bf0121b9383054ca14d3c525b56b92634 (patch)
treeecd78f76805b16bb01ec8d81f99f1cb3a2a43895 /Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
parent3045c1a18644e50fd843dfce07d809e46d923ada (diff)
Initial support for double precision shader instructions. (#963)
* Implement DADD, DFMA and DMUL shader instructions * Rename FP to FP32 * Correct double immediate * Classic mistake
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
index 572068da..588ec216 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAluHelper.cs
@@ -85,12 +85,19 @@ namespace Ryujinx.Graphics.Shader.Instructions
context.Copy(GetNF(), context.ICompareLess(dest, Const(0)));
}
- public static void SetFPZnFlags(EmitterContext context, Operand dest, bool setCC)
+ public static void SetFPZnFlags(EmitterContext context, Operand dest, bool setCC, Instruction fpType = Instruction.FP32)
{
if (setCC)
{
- context.Copy(GetZF(), context.FPCompareEqual(dest, ConstF(0)));
- context.Copy(GetNF(), context.FPCompareLess (dest, ConstF(0)));
+ Operand zero = ConstF(0);
+
+ if (fpType == Instruction.FP64)
+ {
+ zero = context.FP32ConvertToFP64(zero);
+ }
+
+ context.Copy(GetZF(), context.FPCompareEqual(dest, zero, fpType));
+ context.Copy(GetNF(), context.FPCompareLess (dest, zero, fpType));
}
}
}