aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Tests/Cpu/CpuTestSimd.cs
diff options
context:
space:
mode:
authorLDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com>2020-05-27 18:51:59 +0200
committerGitHub <noreply@github.com>2020-05-27 18:51:59 +0200
commit83d94b21d077e2d31faee74711ff38e0c0499afa (patch)
tree6cffcac67c60616ec3e480fed1742278855f7491 /Ryujinx.Tests/Cpu/CpuTestSimd.cs
parent5795bb15282498b3824a5d15fe1ff78b85a18c23 (diff)
Add FMaxNmV & FMinNmV Inst.s with Test. (#1279)
Successful unit testing on Windows (debug and release mode).
Diffstat (limited to 'Ryujinx.Tests/Cpu/CpuTestSimd.cs')
-rw-r--r--Ryujinx.Tests/Cpu/CpuTestSimd.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/Ryujinx.Tests/Cpu/CpuTestSimd.cs b/Ryujinx.Tests/Cpu/CpuTestSimd.cs
index 904ec0ae..f8a61b15 100644
--- a/Ryujinx.Tests/Cpu/CpuTestSimd.cs
+++ b/Ryujinx.Tests/Cpu/CpuTestSimd.cs
@@ -913,6 +913,15 @@ namespace Ryujinx.Tests.Cpu
};
}
+ private static uint[] _F_Max_Min_Nm_V_V_4SS_()
+ {
+ return new uint[]
+ {
+ 0x6E30C800u, // FMAXNMV S0, V0.4S
+ 0x6EB0C800u // FMINNMV S0, V0.4S
+ };
+ }
+
private static uint[] _F_Mov_Ftoi_SW_()
{
return new uint[]
@@ -2143,6 +2152,28 @@ namespace Ryujinx.Tests.Cpu
}
[Test, Pairwise] [Explicit]
+ public void F_Max_Min_Nm_V_V_4SS([ValueSource("_F_Max_Min_Nm_V_V_4SS_")] uint opcodes,
+ [Values(0u)] uint rd,
+ [Values(1u, 0u)] uint rn,
+ [ValueSource("_2S_F_")] ulong z,
+ [ValueSource("_2S_F_")] ulong a)
+ {
+ opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0);
+
+ V128 v0 = MakeVectorE0E1(z, z);
+ V128 v1 = MakeVectorE0E1(a, a);
+
+ int rnd = (int)TestContext.CurrentContext.Random.NextUInt();
+
+ int fpcr = rnd & (1 << (int)Fpcr.Fz);
+ fpcr |= rnd & (1 << (int)Fpcr.Dn);
+
+ SingleOpcode(opcodes, v0: v0, v1: v1, fpcr: fpcr);
+
+ CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc);
+ }
+
+ [Test, Pairwise] [Explicit]
public void F_Mov_Ftoi_SW([ValueSource("_F_Mov_Ftoi_SW_")] uint opcodes,
[Values(0u, 31u)] uint rd,
[Values(1u)] uint rn,