aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs')
-rw-r--r--src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs b/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs
index 41365c62..132ddfd0 100644
--- a/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs
+++ b/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs
@@ -25,6 +25,24 @@ namespace Ryujinx.Tests.Cpu
};
}
+ private static uint[] UQAddSub16()
+ {
+ return new[]
+ {
+ 0xe6600f10u, // UQADD16 R0, R0, R0
+ 0xe6600f70u, // UQSUB16 R0, R0, R0
+ };
+ }
+
+ private static uint[] UQAddSub8()
+ {
+ return new[]
+ {
+ 0xe6600f90u, // UQADD8 R0, R0, R0
+ 0xe6600ff0u, // UQSUB8 R0, R0, R0
+ };
+ }
+
private static uint[] SsatUsat()
{
return new[]
@@ -183,6 +201,42 @@ namespace Ryujinx.Tests.Cpu
}
[Test, Pairwise]
+ public void U_Q_AddSub_16([ValueSource(nameof(UQAddSub16))] uint opcode,
+ [Values(0u, 0xdu)] uint rd,
+ [Values(1u)] uint rm,
+ [Values(2u)] uint rn,
+ [Random(RndCnt)] uint w0,
+ [Random(RndCnt)] uint w1,
+ [Random(RndCnt)] uint w2)
+ {
+ opcode |= ((rm & 15) << 0) | ((rd & 15) << 12) | ((rn & 15) << 16);
+
+ uint sp = TestContext.CurrentContext.Random.NextUInt();
+
+ SingleOpcode(opcode, r0: w0, r1: w1, r2: w2, sp: sp);
+
+ CompareAgainstUnicorn();
+ }
+
+ [Test, Pairwise]
+ public void U_Q_AddSub_8([ValueSource(nameof(UQAddSub8))] uint opcode,
+ [Values(0u, 0xdu)] uint rd,
+ [Values(1u)] uint rm,
+ [Values(2u)] uint rn,
+ [Random(RndCnt)] uint w0,
+ [Random(RndCnt)] uint w1,
+ [Random(RndCnt)] uint w2)
+ {
+ opcode |= ((rm & 15) << 0) | ((rd & 15) << 12) | ((rn & 15) << 16);
+
+ uint sp = TestContext.CurrentContext.Random.NextUInt();
+
+ SingleOpcode(opcode, r0: w0, r1: w1, r2: w2, sp: sp);
+
+ CompareAgainstUnicorn();
+ }
+
+ [Test, Pairwise]
public void Uadd8_Sel([Values(0u)] uint rd,
[Values(1u)] uint rm,
[Values(2u)] uint rn,