diff --git a/src/Ryujinx.Tests/Cpu/CpuTest.cs b/src/Ryujinx.Tests/Cpu/CpuTest.cs index 55a3de7702..860aabe522 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTest.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTest.cs @@ -6,12 +6,15 @@ using Ryujinx.Memory; using Ryujinx.Tests.Unicorn; using System; using Xunit; +using Xunit.Abstractions; using MemoryPermission = Ryujinx.Tests.Unicorn.MemoryPermission; namespace Ryujinx.Tests.Cpu { public class CpuTest : IDisposable { + private readonly ITestOutputHelper _testOutputHelper; + protected static readonly ulong Size = MemoryBlock.GetPageSize(); #pragma warning disable CA2211 // Non-constant fields should not be visible protected static ulong CodeBaseAddress = Size; @@ -37,8 +40,9 @@ namespace Ryujinx.Tests.Cpu private bool _usingMemory; - protected CpuTest() + public CpuTest(ITestOutputHelper testOutputHelper) { + _testOutputHelper = testOutputHelper; Setup(); } @@ -473,7 +477,7 @@ namespace Ryujinx.Tests.Cpu Assert.Equal(_unicornEmu.Q[0].GetFloat(3), _context.GetV(0).Extract(3), 1f); }); - Console.WriteLine(fpTolerances); + _testOutputHelper.WriteLine(fpTolerances.ToString()); } else { @@ -494,7 +498,7 @@ namespace Ryujinx.Tests.Cpu _unicornEmu.Q[0].GetDouble(1), 1d); }); - Console.WriteLine(fpTolerances); + _testOutputHelper.WriteLine(fpTolerances.ToString()); } else { diff --git a/src/Ryujinx.Tests/Cpu/CpuTest32.cs b/src/Ryujinx.Tests/Cpu/CpuTest32.cs index 84fab8bd2f..c8071ac3f5 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTest32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTest32.cs @@ -6,12 +6,15 @@ using Ryujinx.Memory; using Ryujinx.Tests.Unicorn; using System; using Xunit; +using Xunit.Abstractions; using MemoryPermission = Ryujinx.Tests.Unicorn.MemoryPermission; namespace Ryujinx.Tests.Cpu { public class CpuTest32 : IDisposable { + private readonly ITestOutputHelper _testOutputHelper; + protected static readonly uint Size = (uint)MemoryBlock.GetPageSize(); #pragma warning disable CA2211 // Non-constant fields should not be visible protected static uint CodeBaseAddress = Size; @@ -31,8 +34,9 @@ namespace Ryujinx.Tests.Cpu private bool _usingMemory; - public CpuTest32() + public CpuTest32(ITestOutputHelper testOutputHelper) { + _testOutputHelper = testOutputHelper; Setup(); } @@ -506,7 +510,7 @@ namespace Ryujinx.Tests.Cpu Assert.Equal(_unicornEmu.Q[0].GetFloat(3), _context.GetV(0).Extract(3), 1f); }); - Console.WriteLine(fpTolerances); + _testOutputHelper.WriteLine(fpTolerances.ToString()); } else { @@ -525,7 +529,7 @@ namespace Ryujinx.Tests.Cpu Assert.Equal(_unicornEmu.Q[0].GetDouble(1), _context.GetV(0).Extract(1), 1d); }); - Console.WriteLine(fpTolerances); + _testOutputHelper.WriteLine(fpTolerances.ToString()); } else { diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAlu.cs b/src/Ryujinx.Tests/Cpu/CpuTestAlu.cs index 30bf295d16..59025c98a6 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAlu.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAlu.cs @@ -3,12 +3,17 @@ using System; using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Alu")] public sealed class CpuTestAlu : CpuTest { + public CpuTestAlu(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Alu #region "Helper methods" @@ -105,30 +110,11 @@ namespace Ryujinx.Tests.Cpu } #endregion - private static readonly uint[] _testData_rd = { 0u, 31u }; - private static readonly uint[] _testData_rn = { 1u, 31u }; - private static readonly ulong[] _testData_xn = - { - 0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, - 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul, - }; - private static readonly uint[] _testData_wn = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - public static readonly MatrixTheoryData TestData_CLS_x = new(_testData_rd, _testData_rn, GenLeadingSignsX()); - public static readonly MatrixTheoryData TestData_CLS_w = new(_testData_rd, _testData_rn, GenLeadingSignsW()); - public static readonly MatrixTheoryData TestData_CLZ_x = new(_testData_rd, _testData_rn, GenLeadingZerosX()); - public static readonly MatrixTheoryData TestData_CLZ_w = new(_testData_rd, _testData_rn, GenLeadingZerosW()); - - public static readonly MatrixTheoryData TestData_64bit = new(_testData_rd, _testData_rn, _testData_xn); - public static readonly MatrixTheoryData TestData_32bit = new(_testData_rd, _testData_rn, _testData_wn); - - [Theory(DisplayName = "CLS , ")] - [MemberData(nameof(TestData_CLS_x))] - public void Cls_64bit(uint rd, uint rn, ulong xn) + [SkippableTheory(DisplayName = "CLS , ")] + [PairwiseData] + public void Cls_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(GenLeadingSignsX))] ulong xn) { uint opcode = 0xDAC01400; // CLS X0, X0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -140,9 +126,11 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "CLS , ")] - [MemberData(nameof(TestData_CLS_w))] - public void Cls_32bit(uint rd, uint rn, uint wn) + [SkippableTheory(DisplayName = "CLS , ")] + [PairwiseData] + public void Cls_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(GenLeadingSignsW))] uint wn) { uint opcode = 0x5AC01400; // CLS W0, W0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -154,9 +142,11 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "CLZ , ")] - [MemberData(nameof(TestData_CLZ_x))] - public void Clz_64bit(uint rd, uint rn, ulong xn) + [SkippableTheory(DisplayName = "CLZ , ")] + [PairwiseData] + public void Clz_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(GenLeadingZerosX))] ulong xn) { uint opcode = 0xDAC01000; // CLZ X0, X0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -168,9 +158,11 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "CLZ , ")] - [MemberData(nameof(TestData_CLZ_w))] - public void Clz_32bit(uint rd, uint rn, uint wn) + [SkippableTheory(DisplayName = "CLZ , ")] + [PairwiseData] + public void Clz_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(GenLeadingZerosW))] uint wn) { uint opcode = 0x5AC01000; // CLZ W0, W0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -182,9 +174,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "RBIT , ")] - [MemberData(nameof(TestData_64bit))] - public void Rbit_64bit(uint rd, uint rn, ulong xn) + [SkippableTheory(DisplayName = "RBIT , ")] + [PairwiseData] + public void Rbit_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn) { uint opcode = 0xDAC00000; // RBIT X0, X0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -196,9 +191,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "RBIT , ")] - [MemberData(nameof(TestData_32bit))] - public void Rbit_32bit(uint rd, uint rn, uint wn) + [SkippableTheory(DisplayName = "RBIT , ")] + [PairwiseData] + public void Rbit_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn) { uint opcode = 0x5AC00000; // RBIT W0, W0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -210,9 +208,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "REV16 , ")] - [MemberData(nameof(TestData_64bit))] - public void Rev16_64bit(uint rd, uint rn, ulong xn) + [SkippableTheory(DisplayName = "REV16 , ")] + [PairwiseData] + public void Rev16_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn) { uint opcode = 0xDAC00400; // REV16 X0, X0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -224,9 +225,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "REV16 , ")] - [MemberData(nameof(TestData_32bit))] - public void Rev16_32bit(uint rd, uint rn, uint wn) + [SkippableTheory(DisplayName = "REV16 , ")] + [PairwiseData] + public void Rev16_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn) { uint opcode = 0x5AC00400; // REV16 W0, W0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -238,9 +242,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "REV32 , ")] - [MemberData(nameof(TestData_64bit))] - public void Rev32_64bit(uint rd, uint rn, ulong xn) + [SkippableTheory(DisplayName = "REV32 , ")] + [PairwiseData] + public void Rev32_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn) { uint opcode = 0xDAC00800; // REV32 X0, X0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -252,9 +259,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "REV , ")] - [MemberData(nameof(TestData_32bit))] - public void Rev32_32bit(uint rd, uint rn, uint wn) + [SkippableTheory(DisplayName = "REV , ")] + [PairwiseData] + public void Rev32_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn) { uint opcode = 0x5AC00800; // REV W0, W0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -266,9 +276,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "REV64 , ")] - [MemberData(nameof(TestData_64bit))] - public void Rev64_64bit(uint rd, uint rn, ulong xn) + [SkippableTheory(DisplayName = "REV64 , ")] + [PairwiseData] + public void Rev64_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn) { uint opcode = 0xDAC00C00; // REV64 X0, X0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs b/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs index e2a3fc917e..573a09c54c 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAlu32.cs @@ -2,12 +2,17 @@ using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Alu32")] public sealed class CpuTestAlu32 : CpuTest32 { + public CpuTestAlu32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Alu32 #region "ValueSource (Opcodes)" @@ -60,19 +65,12 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly uint[] _testData_rd = {0u, 0xdu}; - private static readonly uint[] _testData_rm = {1u, 0xdu}; - private static readonly uint[] _testData_wn = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - public static readonly MatrixTheoryData TestData_32bit = new(_testData_rd, _testData_rm, _testData_wn); - [Theory(DisplayName = "RBIT , ")] - [MemberData(nameof(TestData_32bit))] - public void Rbit_32bit(uint rd, uint rm, uint wn) + [PairwiseData] + public void Rbit_32bit([CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u, 0xdu)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn) { uint opcode = 0xe6ff0f30u; // RBIT R0, R0 opcode |= ((rm & 15) << 0) | ((rd & 15) << 12); @@ -84,11 +82,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Lsr = new(LsrLslAsrRor(), _testData_wn, RangeUtils.RangeData(0, 31, 1)); - [Theory] - [MemberData(nameof(TestData_Lsr))] - public void Lsr_Lsl_Asr_Ror(uint opcode, uint shiftValue, int shiftAmount) + [PairwiseData] + public void Lsr_Lsl_Asr_Ror([CombinatorialMemberData(nameof(LsrLslAsrRor))] uint opcode, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint shiftValue, + [CombinatorialRange(0, 31, 1)] int shiftAmount) { uint rd = 0; uint rm = 1; @@ -100,21 +99,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_Sh_rm = - { - 1u, - }; - - private static readonly uint[] _testData_Sh_rn = - { - 2u, - }; - - public static readonly MatrixTheoryData TestData_Sh = new(_testData_rd, _testData_Sh_rm, _testData_Sh_rn, Random.Shared.NextUIntEnumerable(RndCnt), Random.Shared.NextUIntEnumerable(RndCnt), Random.Shared.NextUIntEnumerable(RndCnt)); - [Theory] - [MemberData(nameof(TestData_Sh))] - public void Shadd8(uint rd, uint rm, uint rn, uint w0, uint w1, uint w2) + [PairwiseData] + public void Shadd8([CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u)] uint rm, + [CombinatorialValues(2u)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint w0, + [CombinatorialRandomData(Count = RndCnt)] uint w1, + [CombinatorialRandomData(Count = RndCnt)] uint w2) { uint opcode = 0xE6300F90u; // SHADD8 R0, R0, R0 @@ -128,8 +120,13 @@ namespace Ryujinx.Tests.Cpu } [Theory] - [MemberData(nameof(TestData_Sh))] - public void Shsub8(uint rd, uint rm, uint rn, uint w0, uint w1, uint w2) + [PairwiseData] + public void Shsub8([CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u)] uint rm, + [CombinatorialValues(2u)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint w0, + [CombinatorialRandomData(Count = RndCnt)] uint w1, + [CombinatorialRandomData(Count = RndCnt)] uint w2) { uint opcode = 0xE6300FF0u; // SHSUB8 R0, R0, R0 @@ -142,16 +139,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_sat = - { - 0u, 7u, 8u, 0xfu, 0x10u, 0x1fu, - }; - - public static readonly MatrixTheoryData TestData_Ssat = new(SsatUsat(), _testData_rd, _testData_rm, _testData_sat, _testData_sat, _testData_wn); - [Theory] - [MemberData(nameof(TestData_Ssat))] - public void Ssat_Usat(uint opcode, uint rd, uint rn, uint sat, uint shift, uint wn) + [PairwiseData] + public void Ssat_Usat([CombinatorialMemberData(nameof(SsatUsat))] uint opcode, + [CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u, 0xdu)] uint rn, + [CombinatorialValues(0u, 7u, 8u, 0xfu, 0x10u, 0x1fu)] uint sat, + [CombinatorialValues(0u, 7u, 8u, 0xfu, 0x10u, 0x1fu)] uint shift, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn) { opcode |= ((rn & 15) << 0) | ((shift & 31) << 7) | ((rd & 15) << 12) | ((sat & 31) << 16); @@ -162,16 +158,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_sat16 = - { - 0u, 7u, 8u, 0xfu, - }; - - public static readonly MatrixTheoryData TestData_Ssat16 = new(Ssat16Usat16(), _testData_rd, _testData_rm, _testData_sat16, _testData_wn); - [Theory] - [MemberData(nameof(TestData_Ssat16))] - public void Ssat16_Usat16(uint opcode, uint rd, uint rn, uint sat, uint wn) + [PairwiseData] + public void Ssat16_Usat16([CombinatorialMemberData(nameof(Ssat16Usat16))] uint opcode, + [CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u, 0xdu)] uint rn, + [CombinatorialValues(0u, 7u, 8u, 0xfu)] uint sat, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn) { opcode |= ((rn & 15) << 0) | ((rd & 15) << 12) | ((sat & 15) << 16); @@ -182,11 +176,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Su = new(SuHAddSub8(), _testData_rd, _testData_Sh_rm, _testData_Sh_rn, Random.Shared.NextUIntEnumerable(RndCnt), Random.Shared.NextUIntEnumerable(RndCnt), Random.Shared.NextUIntEnumerable(RndCnt)); - [Theory] - [MemberData(nameof(TestData_Su))] - public void SU_H_AddSub_8(uint opcode, uint rd, uint rm, uint rn, uint w0, uint w1, uint w2) + [PairwiseData] + public void SU_H_AddSub_8([CombinatorialMemberData(nameof(SuHAddSub8))] uint opcode, + [CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u)] uint rm, + [CombinatorialValues(2u)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint w0, + [CombinatorialRandomData(Count = RndCnt)] uint w1, + [CombinatorialRandomData(Count = RndCnt)] uint w2) { opcode |= ((rm & 15) << 0) | ((rd & 15) << 12) | ((rn & 15) << 16); @@ -197,16 +195,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_Uadd_rd= - { - 0u, - }; - - public static readonly MatrixTheoryData TestData_Uadd = new(_testData_Uadd_rd, _testData_Sh_rm, _testData_Sh_rn, Random.Shared.NextUIntEnumerable(RndCnt), Random.Shared.NextUIntEnumerable(RndCnt), Random.Shared.NextUIntEnumerable(RndCnt)); - [Theory] - [MemberData(nameof(TestData_Uadd))] - public void Uadd8_Sel(uint rd, uint rm, uint rn, uint w0, uint w1, uint w2) + [PairwiseData] + public void Uadd8_Sel([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rm, + [CombinatorialValues(2u)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint w0, + [CombinatorialRandomData(Count = RndCnt)] uint w1, + [CombinatorialRandomData(Count = RndCnt)] uint w2) { uint opUadd8 = 0xE6500F90; // UADD8 R0, R0, R0 uint opSel = 0xE6800FB0; // SEL R0, R0, R0 diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs index a1c0b6d841..cdf5d2b09d 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary.cs @@ -10,6 +10,10 @@ namespace Ryujinx.Tests.Cpu [Collection("AluBinary")] public sealed class CpuTestAluBinary : CpuTest { + public CpuTestAluBinary(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if AluBinary public struct CrcTest : IXunitSerializable { @@ -71,35 +75,13 @@ namespace Ryujinx.Tests.Cpu } #endregion - private static readonly ulong[] _testData_xn = - { - 0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, - 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul, - }; - private static readonly uint[] _testData_wn = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - private static readonly uint[] _testData_Crc32_rd = - { - 0u, - }; - private static readonly uint[] _testData_Crc32_rn = - { - 1u, - }; - private static readonly uint[] _testData_Crc32_rm = - { - 2u, - }; - - public static readonly MatrixTheoryData TestData_Crc32 = new(_testData_Crc32_rd, _testData_Crc32_rn, _testData_Crc32_rm, RangeUtils.RangeData(0u, 3u, 1u), _CRC32_Test_Values_()); - [Theory] - [MemberData(nameof(TestData_Crc32))] - public void Crc32_b_h_w_x(uint rd, uint rn, uint rm, uint size, CrcTest test) + [CombinatorialData] + public void Crc32_b_h_w_x([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(2u)] uint rm, + [CombinatorialRange(0u, 3u, 1u)] uint size, + [CombinatorialMemberData(nameof(_CRC32_Test_Values_))] CrcTest test) { uint opcode = 0x1AC04000; // CRC32B W0, W0, W0 @@ -117,32 +99,19 @@ namespace Ryujinx.Tests.Cpu ExecutionContext context = GetContext(); ulong result = context.GetX((int)rd); - Assert.True(result == test.Results[size]); + Assert.Equal(test.Results[size], result); } - private static readonly uint[] _testData_Crc32x_rd = - { - 0u, 31u, - }; - private static readonly uint[] _testData_Crc32x_rn = - { - 1u, 31u, - }; - private static readonly uint[] _testData_Crc32x_rm = - { - 2u, 31u, - }; - - private static readonly uint[] _testData_Crc32x_wn = - { - 0x00000000u, 0xFFFFFFFFu, - }; - - public static readonly MatrixTheoryData TestData_Crc32x = new(_testData_Crc32x_rd, _testData_Crc32x_rn, _testData_Crc32x_rm, _testData_Crc32x_wn, _testData_xn); - - [Theory(DisplayName = "CRC32X , , ", Skip = "Unicorn fails.")] - [MemberData(nameof(TestData_Crc32x))] - public void Crc32x(uint rd, uint rn, uint rm, uint wn, ulong xm) + [SkippableTheory(DisplayName = "CRC32X , , ", Skip = "Unicorn fails.")] + [PairwiseData] + public void Crc32x([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((ulong)0x00_00_00_00_00_00_00_00, + (ulong)0x7F_FF_FF_FF_FF_FF_FF_FF, + 0x80_00_00_00_00_00_00_00, + 0xFF_FF_FF_FF_FF_FF_FF_FF)] ulong xm) { uint opcode = 0x9AC04C00; // CRC32X W0, W0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -154,11 +123,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Crc32w = new(_testData_Crc32x_rd, _testData_Crc32x_rn, _testData_Crc32x_rm, _testData_Crc32x_wn, _testData_wn); - - [Theory(DisplayName = "CRC32W , , ", Skip = "Unicorn fails.")] - [MemberData(nameof(TestData_Crc32w))] - public void Crc32w(uint rd, uint rn, uint rm, uint wn, uint wm) + [SkippableTheory(DisplayName = "CRC32W , , ", Skip = "Unicorn fails.")] + [PairwiseData] + public void Crc32w([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((uint)0x00_00_00_00, (uint)0x7F_FF_FF_FF, + 0x80_00_00_00, 0xFF_FF_FF_FF)] uint wm) { uint opcode = 0x1AC04800; // CRC32W W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -170,17 +142,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly ushort[] _testData_Crc32h_wm = - { - 0x00_00, 0x7F_FF, - 0x80_00, 0xFF_FF, - }; - - public static readonly MatrixTheoryData TestData_Crc32h = new(_testData_Crc32x_rd, _testData_Crc32x_rn, _testData_Crc32x_rm, _testData_Crc32x_wn, _testData_Crc32h_wm); - - [Theory(DisplayName = "CRC32H , , ", Skip = "Unicorn fails.")] - [MemberData(nameof(TestData_Crc32h))] - public void Crc32h(uint rd, uint rn, uint rm, uint wn, ushort wm) + [SkippableTheory(DisplayName = "CRC32H , , ", Skip = "Unicorn fails.")] + [PairwiseData] + public void Crc32h([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((ushort)0x00_00, (ushort)0x7F_FF, + (ushort)0x80_00, (ushort)0xFF_FF)] ushort wm) { uint opcode = 0x1AC04400; // CRC32H W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -192,17 +161,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly byte[] _testData_Crc32b_wm = - { - 0x00, 0x7F, - 0x80, 0xFF, - }; - - public static readonly MatrixTheoryData TestData_Crc32b = new(_testData_Crc32x_rd, _testData_Crc32x_rn, _testData_Crc32x_rm, _testData_Crc32x_wn, _testData_Crc32b_wm); - - [Theory(DisplayName = "CRC32B , , ", Skip = "Unicorn fails.")] - [MemberData(nameof(TestData_Crc32b))] - public void Crc32b(uint rd, uint rn, uint rm, uint wn, byte wm) + [SkippableTheory(DisplayName = "CRC32B , , ", Skip = "Unicorn fails.")] + [PairwiseData] + public void Crc32b([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((byte)0x00, (byte)0x7F, + (byte)0x80, (byte)0xFF)] byte wm) { uint opcode = 0x1AC04000; // CRC32B W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -214,9 +180,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "CRC32CX , , ")] - [MemberData(nameof(TestData_Crc32x))] - public void Crc32cx(uint rd, uint rn, uint rm, uint wn, ulong xm) + [SkippableTheory(DisplayName = "CRC32CX , , ")] + [PairwiseData] + public void Crc32cx([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((ulong)0x00_00_00_00_00_00_00_00, + (ulong)0x7F_FF_FF_FF_FF_FF_FF_FF, + 0x80_00_00_00_00_00_00_00, + 0xFF_FF_FF_FF_FF_FF_FF_FF)] ulong xm) { uint opcode = 0x9AC05C00; // CRC32CX W0, W0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -228,9 +201,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "CRC32CW , , ")] - [MemberData(nameof(TestData_Crc32w))] - public void Crc32cw(uint rd, uint rn, uint rm, uint wn, uint wm) + [SkippableTheory(DisplayName = "CRC32CW , , ")] + [PairwiseData] + public void Crc32cw([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((uint)0x00_00_00_00, (uint)0x7F_FF_FF_FF, + 0x80_00_00_00, 0xFF_FF_FF_FF)] uint wm) { uint opcode = 0x1AC05800; // CRC32CW W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -242,9 +220,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "CRC32CH , , ")] - [MemberData(nameof(TestData_Crc32h))] - public void Crc32ch(uint rd, uint rn, uint rm, uint wn, ushort wm) + [SkippableTheory(DisplayName = "CRC32CH , , ")] + [PairwiseData] + public void Crc32ch([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((ushort)0x00_00, (ushort)0x7F_FF, + (ushort)0x80_00, (ushort)0xFF_FF)] ushort wm) { uint opcode = 0x1AC05400; // CRC32CH W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -256,9 +239,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "CRC32CB , , ")] - [MemberData(nameof(TestData_Crc32b))] - public void Crc32cb(uint rd, uint rn, uint rm, uint wn, byte wm) + [SkippableTheory(DisplayName = "CRC32CB , , ")] + [PairwiseData] + public void Crc32cb([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues((byte)0x00, (byte)0x7F, + (byte)0x80, (byte)0xFF)] byte wm) { uint opcode = 0x1AC05000; // CRC32CB W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -270,11 +258,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Sdiv64 = new(_testData_Crc32x_rd, _testData_Crc32x_rn, _testData_Crc32x_rm, _testData_xn, _testData_xn); - - [Theory(DisplayName = "SDIV , , ")] - [MemberData(nameof(TestData_Sdiv64))] - public void Sdiv_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm) + [SkippableTheory(DisplayName = "SDIV , , ")] + [PairwiseData] + public void Sdiv_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9AC00C00; // SDIV X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -286,11 +278,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Sdiv32 = new(_testData_Crc32x_rd, _testData_Crc32x_rn, _testData_Crc32x_rm, _testData_wn, _testData_wn); - - [Theory(DisplayName = "SDIV , , ")] - [MemberData(nameof(TestData_Sdiv32))] - public void Sdiv_32bit(uint rd, uint rn, uint rm, uint wn, uint wm) + [SkippableTheory(DisplayName = "SDIV , , ")] + [PairwiseData] + public void Sdiv_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { uint opcode = 0x1AC00C00; // SDIV W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -302,9 +298,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "UDIV , , ")] - [MemberData(nameof(TestData_Sdiv64))] - public void Udiv_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm) + [SkippableTheory(DisplayName = "UDIV , , ")] + [PairwiseData] + public void Udiv_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9AC00800; // UDIV X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -316,9 +318,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "UDIV , , ")] - [MemberData(nameof(TestData_Sdiv32))] - public void Udiv_32bit(uint rd, uint rn, uint rm, uint wn, uint wm) + [SkippableTheory(DisplayName = "UDIV , , ")] + [PairwiseData] + public void Udiv_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { uint opcode = 0x1AC00800; // UDIV W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs index 1057e7ff7d..dbfb56b0bb 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluBinary32.cs @@ -11,6 +11,10 @@ namespace Ryujinx.Tests.Cpu [Collection("AluBinary32")] public sealed class CpuTestAluBinary32 : CpuTest32 { + public CpuTestAluBinary32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if AluBinary32 public struct CrcTest32 : IXunitSerializable { @@ -83,24 +87,13 @@ namespace Ryujinx.Tests.Cpu } #endregion - private static uint[] _testData_rd = - { - 0u, - }; - private static uint[] _testData_rn = - { - 1u, - }; - private static uint[] _testData_rm = - { - 2u, - }; - - public static readonly MatrixTheoryData TestData = new(_testData_rd, _testData_rn, _testData_rm, RangeUtils.RangeData(0u, 2u, 1u), _CRC32_Test_Values_()); - [Theory] - [MemberData(nameof(TestData))] - public void Crc32_Crc32c_b_h_w(uint rd, uint rn, uint rm, uint size, CrcTest32 test) + [CombinatorialData] + public void Crc32_Crc32c_b_h_w([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(2u)] uint rm, + [CombinatorialRange(0u, 2u, 1u)] uint size, + [CombinatorialMemberData(nameof(_CRC32_Test_Values_))] CrcTest32 test) { // Unicorn does not yet support 32bit crc instructions, so test against a known table of results/values. @@ -118,7 +111,7 @@ namespace Ryujinx.Tests.Cpu ExecutionContext context = GetContext(); ulong result = context.GetX((int)rd); - Assert.True(result == test.Results[size]); + Assert.Equal(test.Results[size], result); } #endif } diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluImm.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluImm.cs index d57f202775..fc435a191f 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluImm.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluImm.cs @@ -2,47 +2,27 @@ using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("AluImm")] public sealed class CpuTestAluImm : CpuTest { + public CpuTestAluImm(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if AluImm - private static readonly uint[] _testData_rd = - { - 0u, 31u, - }; - private static readonly uint[] _testData_rn = - { - 1u, 31u, - }; - private static readonly ulong[] _testData_xnSp = - { - 0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, - 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul, - }; - private static readonly uint[] _testData_imm = - { - 0u, 4095u, - }; - private static readonly uint[] _testData_shift = - { - 0b00u, 0b01u, // - }; - private static readonly uint[] _testData_wnWsp = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - public static readonly MatrixTheoryData TestData_64 = new(_testData_rd, _testData_rn, _testData_xnSp, _testData_imm, _testData_shift); - public static readonly MatrixTheoryData TestData_32 = new(_testData_rd, _testData_rn, _testData_wnWsp, _testData_imm, _testData_shift); - - [Theory(DisplayName = "ADD , , #{, }")] - [MemberData(nameof(TestData_64))] - public void Add_64bit(uint rd, uint rn, ulong xnSp, uint imm, uint shift) + [SkippableTheory(DisplayName = "ADD , , #{, }")] + [PairwiseData] + public void Add_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0x91000000; // ADD X0, X0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -60,9 +40,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ADD , , #{, }")] - [MemberData(nameof(TestData_32))] - public void Add_32bit(uint rd, uint rn, uint wnWsp, uint imm, uint shift) + [SkippableTheory(DisplayName = "ADD , , #{, }")] + [PairwiseData] + public void Add_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0x11000000; // ADD W0, W0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -80,9 +65,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ADDS , , #{, }")] - [MemberData(nameof(TestData_64))] - public void Adds_64bit(uint rd, uint rn, ulong xnSp, uint imm, uint shift) + [SkippableTheory(DisplayName = "ADDS , , #{, }")] + [PairwiseData] + public void Adds_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0xB1000000; // ADDS X0, X0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -100,9 +90,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ADDS , , #{, }")] - [MemberData(nameof(TestData_32))] - public void Adds_32bit(uint rd, uint rn, uint wnWsp, uint imm, uint shift) + [SkippableTheory(DisplayName = "ADDS , , #{, }")] + [PairwiseData] + public void Adds_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0x31000000; // ADDS W0, W0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -120,20 +115,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_N1_imms = - { - 0u, 31u, 32u, 62u, // - }; - private static readonly uint[] _testData_N1_immr = - { - 0u, 31u, 32u, 63u, // - }; - - public static readonly MatrixTheoryData TestData_N1 = new(_testData_rd, _testData_rn, _testData_xnSp, _testData_N1_imms, _testData_N1_immr); - - [Theory(DisplayName = "AND , , #")] - [MemberData(nameof(TestData_N1))] - public void And_N1_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "AND , , #")] + [PairwiseData] + public void And_N1_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 31u, 32u, 62u)] uint imms, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint immr) // { uint opcode = 0x92400000; // AND X0, X0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -146,20 +135,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static uint[] _testData_N0_imms = - { - 0u, 15u, 16u, 30u, // - }; - private static uint[] _testData_N0_immr = - { - 0u, 15u, 16u, 31u, // - }; - - public static readonly MatrixTheoryData TestData_N0 = new(_testData_rd, _testData_rn, _testData_xnSp, _testData_N0_imms, _testData_N0_immr); - - [Theory(DisplayName = "AND , , #")] - [MemberData(nameof(TestData_N0))] - public void And_N0_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "AND , , #")] + [PairwiseData] + public void And_N0_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0x92000000; // AND X0, X0, #0x100000001 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -172,11 +155,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Add32 = new(_testData_rd, _testData_rd, _testData_wnWsp, _testData_N0_imms, _testData_N0_immr); - - [Theory(DisplayName = "AND , , #")] - [MemberData(nameof(TestData_Add32))] - public void And_32bit(uint rd, uint rn, uint wn, uint imms, uint immr) + [SkippableTheory(DisplayName = "AND , , #")] + [PairwiseData] + public void And_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0x12000000; // AND W0, W0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -189,9 +175,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ANDS , , #")] - [MemberData(nameof(TestData_N1))] - public void Ands_N1_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "ANDS , , #")] + [PairwiseData] + public void Ands_N1_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 31u, 32u, 62u)] uint imms, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint immr) // { uint opcode = 0xF2400000; // ANDS X0, X0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -204,9 +195,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ANDS , , #")] - [MemberData(nameof(TestData_N1))] - public void Ands_N0_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "ANDS , , #")] + [PairwiseData] + public void Ands_N0_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0xF2000000; // ANDS X0, X0, #0x100000001 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -219,9 +215,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ANDS , , #")] - [MemberData(nameof(TestData_Add32))] - public void Ands_32bit(uint rd, uint rn, uint wn, uint imms, uint immr) + [SkippableTheory(DisplayName = "ANDS , , #")] + [PairwiseData] + public void Ands_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0x72000000; // ANDS W0, W0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -234,9 +235,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "EOR , , #")] - [MemberData(nameof(TestData_N1))] - public void Eor_N1_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "EOR , , #")] + [PairwiseData] + public void Eor_N1_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 31u, 32u, 62u)] uint imms, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint immr) // { uint opcode = 0xD2400000; // EOR X0, X0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -249,9 +255,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "EOR , , #")] - [MemberData(nameof(TestData_N0))] - public void Eor_N0_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "EOR , , #")] + [PairwiseData] + public void Eor_N0_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0xD2000000; // EOR X0, X0, #0x100000001 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -264,9 +275,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "EOR , , #")] - [MemberData(nameof(TestData_Add32))] - public void Eor_32bit(uint rd, uint rn, uint wn, uint imms, uint immr) + [SkippableTheory(DisplayName = "EOR , , #")] + [PairwiseData] + public void Eor_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0x52000000; // EOR W0, W0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -279,9 +295,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ORR , , #")] - [MemberData(nameof(TestData_N1))] - public void Orr_N1_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "ORR , , #")] + [PairwiseData] + public void Orr_N1_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 31u, 32u, 62u)] uint imms, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint immr) // { uint opcode = 0xB2400000; // ORR X0, X0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -294,9 +315,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ORR , , #")] - [MemberData(nameof(TestData_N0))] - public void Orr_N0_64bit(uint rd, uint rn, ulong xn, uint imms, uint immr) + [SkippableTheory(DisplayName = "ORR , , #")] + [PairwiseData] + public void Orr_N0_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0xB2000000; // ORR X0, X0, #0x100000001 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -309,9 +335,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ORR , , #")] - [MemberData(nameof(TestData_Add32))] - public void Orr_32bit(uint rd, uint rn, uint wn, uint imms, uint immr) + [SkippableTheory(DisplayName = "ORR , , #")] + [PairwiseData] + public void Orr_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 30u)] uint imms, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr) // { uint opcode = 0x32000000; // ORR W0, W0, #0x1 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -324,20 +355,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_Sub_imm = - { - 0u, 4095u, - }; - private static readonly uint[] _testData_Sub_shift = - { - 0b00u, 0b01u, // - }; - - public static readonly MatrixTheoryData TestData_Sub64 = new(_testData_rd, _testData_rn, _testData_xnSp, _testData_Sub_imm, _testData_Sub_shift); - - [Theory(DisplayName = "SUB , , #{, }")] - [MemberData(nameof(TestData_Sub64))] - public void Sub_64bit(uint rd, uint rn, ulong xnSp, uint imm, uint shift) + [SkippableTheory(DisplayName = "SUB , , #{, }")] + [PairwiseData] + public void Sub_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0xD1000000; // SUB X0, X0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -355,11 +380,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Sub32 = new(_testData_rd, _testData_rn, _testData_wnWsp, _testData_Sub_imm, _testData_Sub_shift); - - [Theory(DisplayName = "SUB , , #{, }")] - [MemberData(nameof(TestData_Sub32))] - public void Sub_32bit(uint rd, uint rn, uint wnWsp, uint imm, uint shift) + [SkippableTheory(DisplayName = "SUB , , #{, }")] + [PairwiseData] + public void Sub_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0x51000000; // SUB W0, W0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -377,9 +405,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SUBS , , #{, }")] - [MemberData(nameof(TestData_Sub64))] - public void Subs_64bit(uint rd, uint rn, ulong xnSp, uint imm, uint shift) + [SkippableTheory(DisplayName = "SUBS , , #{, }")] + [PairwiseData] + public void Subs_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0xF1000000; // SUBS X0, X0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -397,9 +430,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SUBS , , #{, }")] - [MemberData(nameof(TestData_Sub32))] - public void Subs_32bit(uint rd, uint rn, uint wnWsp, uint imm, uint shift) + [SkippableTheory(DisplayName = "SUBS , , #{, }")] + [PairwiseData] + public void Subs_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift) // { uint opcode = 0x71000000; // SUBS W0, W0, #0, LSL #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluImm32.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluImm32.cs index 3bdf24efad..e760dba5d5 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluImm32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluImm32.cs @@ -2,12 +2,17 @@ using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("AluImm32")] public sealed class CpuTestAluImm32 : CpuTest32 { + public CpuTestAluImm32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if AluImm32 #region "ValueSource (Opcodes)" @@ -35,25 +40,14 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; - private static readonly uint[] _testData_rd = - { - 0u, 13u, - }; - private static readonly uint[] _testData_rn = - { - 1u, 13u, - }; - private static readonly bool[] _testData_carry = - { - false, - true, - }; - - public static readonly MatrixTheoryData TestData = new(Opcodes(), _testData_rd, _testData_rn, Random.Shared.NextUIntEnumerable(RndCnt), Random.Shared.NextUIntEnumerable(RndCnt), _testData_carry); - [Theory] - [MemberData(nameof(TestData))] - public void TestCpuTestAluImm32(uint opcode, uint rd, uint rn, uint imm, uint wn, bool carryIn) + [PairwiseData] + public void TestCpuTestAluImm32([CombinatorialMemberData(nameof(Opcodes))] uint opcode, + [CombinatorialValues(0u, 13u)] uint rd, + [CombinatorialValues(1u, 13u)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint imm, + [CombinatorialRandomData(Count = RndCnt)] uint wn, + [CombinatorialValues(true, false)] bool carryIn) { opcode |= ((imm & 0xfff) << 0) | ((rn & 15) << 16) | ((rd & 15) << 12); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluRs.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluRs.cs index a31a7f7b2c..fd6a89d5cb 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluRs.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluRs.cs @@ -2,42 +2,29 @@ using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("AluRs")] public sealed class CpuTestAluRs : CpuTest { + public CpuTestAluRs(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if AluRs - private static readonly uint[] _testData_rd = - { - 0u, 31u, - }; - private static readonly uint[] _testData_rn = - { - 1u, 31u, - }; - private static readonly uint[] _testData_rm = - { - 2u, 31u, - }; - private static readonly ulong[] _testData_xn = - { - 0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, - 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul, - }; - private static readonly bool[] _testData_bools = - { - false, - true, - }; - - public static readonly MatrixTheoryData TestData_Adc = new(_testData_rd, _testData_rn, _testData_rm, _testData_xn, _testData_xn, _testData_bools); - - [Theory(DisplayName = "ADC , , ")] - [MemberData(nameof(TestData_Adc))] - public void Adc_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, bool carryIn) + [SkippableTheory(DisplayName = "ADC , , ")] + [PairwiseData] + public void Adc_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + bool carryIn) { uint opcode = 0x9A000000; // ADC X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -49,16 +36,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_wn = { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - public static readonly MatrixTheoryData TestData_Adc32 = new(_testData_rd, _testData_rn, _testData_rm, _testData_wn, _testData_wn, _testData_bools); - - [Theory(DisplayName = "ADC , , ")] - [MemberData(nameof(TestData_Adc32))] - public void Adc_32bit(uint rd, uint rn, uint rm, uint wn, uint wm, bool carryIn) + [SkippableTheory(DisplayName = "ADC , , ")] + [PairwiseData] + public void Adc_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + bool carryIn) { uint opcode = 0x1A000000; // ADC W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -70,9 +57,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ADCS , , ")] - [MemberData(nameof(TestData_Adc))] - public void Adcs_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, bool carryIn) + [SkippableTheory(DisplayName = "ADCS , , ")] + [PairwiseData] + public void Adcs_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + bool carryIn) { uint opcode = 0xBA000000; // ADCS X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -84,9 +78,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ADCS , , ")] - [MemberData(nameof(TestData_Adc32))] - public void Adcs_32bit(uint rd, uint rn, uint rm, uint wn, uint wm, bool carryIn) + [SkippableTheory(DisplayName = "ADCS , , ")] + [PairwiseData] + public void Adcs_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + bool carryIn) { uint opcode = 0x3A000000; // ADCS W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -98,20 +99,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_shift = - { - 0b00u, 0b01u, 0b10u, // - }; - private static readonly uint[] _testData_amount = - { - 0u, 31u, 32u, 63u, - }; - - public static readonly MatrixTheoryData TestData_Add = new(_testData_rd, _testData_rn, _testData_rm, _testData_xn, _testData_xn, _testData_shift, _testData_amount); - - [Theory(DisplayName = "ADD , , {, #}")] - [MemberData(nameof(TestData_Add))] - public void Add_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, uint shift, uint amount) + [SkippableTheory(DisplayName = "ADD , , {, #}")] + [PairwiseData] + public void Add_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0x8B000000; // ADD X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -124,11 +122,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Add32 = new(_testData_rd, _testData_rn, _testData_rm, _testData_wn, _testData_wn, _testData_shift, _testData_amount); - - [Theory(DisplayName = "ADD , , {, #}")] - [MemberData(nameof(TestData_Add32))] - public void Add_32bit(uint rd, uint rn, uint rm, uint wn, uint wm, uint shift, uint amount) + [SkippableTheory(DisplayName = "ADD , , {, #}")] + [PairwiseData] + public void Add_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x0B000000; // ADD W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -141,9 +145,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ADDS , , {, #}")] - [MemberData(nameof(TestData_Add))] - public void Adds_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, uint shift, uint amount) + [SkippableTheory(DisplayName = "ADDS , , {, #}")] + [PairwiseData] + public void Adds_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xAB000000; // ADDS X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -156,9 +168,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ADDS , , {, #}")] - [MemberData(nameof(TestData_Add32))] - public void Adds_32bit(uint rd, uint rn, uint rm, uint wn, uint wm, uint shift, uint amount) + [SkippableTheory(DisplayName = "ADDS , , {, #}")] + [PairwiseData] + public void Adds_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x2B000000; // ADDS W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -171,15 +191,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_And_shift = { - 0b00u, 0b01u, 0b10u, 0b11u, // - }; - - public static readonly MatrixTheoryData TestData_And = new(_testData_rd, _testData_rn, _testData_rm, _testData_xn, _testData_xn, _testData_And_shift, _testData_amount); - - [Theory(DisplayName = "AND , , {, #}")] - [MemberData(nameof(TestData_And))] - public void And_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, uint shift, uint amount) + [SkippableTheory(DisplayName = "AND , , {, #}")] + [PairwiseData] + public void And_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0x8A000000; // AND X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -192,11 +214,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_And32 = new(_testData_rd, _testData_rn, _testData_rm, _testData_wn, _testData_wn, _testData_And_shift, _testData_amount); - - [Theory(DisplayName = "AND , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void And_32bit(uint rd, uint rn, uint rm, uint wn, uint wm, uint shift, uint amount) + [SkippableTheory(DisplayName = "AND , , {, #}")] + [PairwiseData] + public void And_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x0A000000; // AND W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -209,9 +237,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ANDS , , {, #}")] - [MemberData(nameof(TestData_And))] - public void Ands_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, uint shift, uint amount) + [SkippableTheory(DisplayName = "ANDS , , {, #}")] + [PairwiseData] + public void Ands_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xEA000000; // ANDS X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -224,9 +260,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ANDS , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void Ands_32bit(uint rd, uint rn, uint rm, uint wn, uint wm, uint shift, uint amount) + [SkippableTheory(DisplayName = "ANDS , , {, #}")] + [PairwiseData] + public void Ands_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x6A000000; // ANDS W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -239,16 +283,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly ulong[] _testData_xm = { - 0ul, 31ul, 32ul, 63ul, 0x7FFFFFFFFFFFFFFFul, - 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul, - }; - - public static readonly MatrixTheoryData TestData_Asrv = new(_testData_rd, _testData_rn, _testData_rm, _testData_xn, _testData_xm); - - [Theory(DisplayName = "ASRV , , ")] - [MemberData(nameof(TestData_Asrv))] - public void Asrv_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm) + [SkippableTheory(DisplayName = "ASRV , , ")] + [PairwiseData] + public void Asrv_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0ul, 31ul, 32ul, 63ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9AC02800; // ASRV X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -260,16 +303,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_wm = { - 0u, 15u, 16u, 31u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - public static readonly MatrixTheoryData TestData_Asrv32 = new(_testData_rd, _testData_rn, _testData_rm, _testData_wn, _testData_wm); - - [Theory(DisplayName = "ASRV , , ")] - [MemberData(nameof(TestData_Asrv32))] - public void Asrv_32bit(uint rd, uint rn, uint rm, uint wn, uint wm) + [SkippableTheory(DisplayName = "ASRV , , ")] + [PairwiseData] + public void Asrv_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 31u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { uint opcode = 0x1AC02800; // ASRV W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -281,9 +323,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "BIC , , {, #}")] - [MemberData(nameof(TestData_And))] - public void Bic_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, uint shift, uint amount) + [SkippableTheory(DisplayName = "BIC , , {, #}")] + [PairwiseData] + public void Bic_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0x8A200000; // BIC X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -296,9 +346,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "BIC , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void Bic_32bit(uint rd, uint rn, uint rm, uint wn, uint wm, uint shift, uint amount) + [SkippableTheory(DisplayName = "BIC , , {, #}")] + [PairwiseData] + public void Bic_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x0A200000; // BIC W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -311,9 +369,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "BICS , , {, #}")] - [MemberData(nameof(TestData_And))] - public void Bics_64bit(uint rd, uint rn, uint rm, ulong xn, ulong xm, uint shift, uint amount) + [SkippableTheory(DisplayName = "BICS , , {, #}")] + [PairwiseData] + public void Bics_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xEA200000; // BICS X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -326,15 +392,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "BICS , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void Bics_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "BICS , , {, #}")] + [PairwiseData] + public void Bics_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x6A200000; // BICS W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -347,15 +415,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "EON , , {, #}")] - [MemberData(nameof(TestData_And))] - public void Eon_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "EON , , {, #}")] + [PairwiseData] + public void Eon_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xCA200000; // EON X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -368,15 +438,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "EON , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void Eon_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "EON , , {, #}")] + [PairwiseData] + public void Eon_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x4A200000; // EON W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -389,15 +461,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "EOR , , {, #}")] - [MemberData(nameof(TestData_And))] - public void Eor_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "EOR , , {, #}")] + [PairwiseData] + public void Eor_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xCA000000; // EOR X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -410,15 +484,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "EOR , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void Eor_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "EOR , , {, #}")] + [PairwiseData] + public void Eor_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x4A000000; // EOR W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -431,16 +507,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Extr = new(_testData_rd, _testData_rn, _testData_rm, _testData_xn, _testData_xn, _testData_amount); - - [Theory(DisplayName = "EXTR , , , #")] - [MemberData(nameof(TestData_Extr))] - public void Extr_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, - uint lsb) + [SkippableTheory(DisplayName = "EXTR , , , #")] + [PairwiseData] + public void Extr_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0u, 31u, 32u, 63u)] uint lsb) { uint opcode = 0x93C00000; // EXTR X0, X0, X0, #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -453,16 +529,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Extr32 = new(_testData_rd, _testData_rn, _testData_rm, _testData_wn, _testData_wn, _testData_amount); - - [Theory(DisplayName = "EXTR , , , #")] - [MemberData(nameof(TestData_Extr32))] - public void Extr_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint lsb) + [SkippableTheory(DisplayName = "EXTR , , , #")] + [PairwiseData] + public void Extr_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint lsb) { uint opcode = 0x13800000; // EXTR W0, W0, W0, #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -475,13 +551,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "LSLV , , ")] - [MemberData(nameof(TestData_Asrv))] - public void Lslv_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm) + [SkippableTheory(DisplayName = "LSLV , , ")] + [PairwiseData] + public void Lslv_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0ul, 31ul, 32ul, 63ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9AC02000; // LSLV X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -493,13 +571,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "LSLV , , ")] - [MemberData(nameof(TestData_Asrv32))] - public void Lslv_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm) + [SkippableTheory(DisplayName = "LSLV , , ")] + [PairwiseData] + public void Lslv_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 31u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { uint opcode = 0x1AC02000; // LSLV W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -511,13 +591,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "LSRV , , ")] - [MemberData(nameof(TestData_Asrv))] - public void Lsrv_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm) + [SkippableTheory(DisplayName = "LSRV , , ")] + [PairwiseData] + public void Lsrv_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0ul, 31ul, 32ul, 63ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9AC02400; // LSRV X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -529,13 +611,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "LSRV , , ")] - [MemberData(nameof(TestData_Asrv32))] - public void Lsrv_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm) + [SkippableTheory(DisplayName = "LSRV , , ")] + [PairwiseData] + public void Lsrv_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 31u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { uint opcode = 0x1AC02400; // LSRV W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -547,15 +631,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ORN , , {, #}")] - [MemberData(nameof(TestData_And))] - public void Orn_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "ORN , , {, #}")] + [PairwiseData] + public void Orn_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xAA200000; // ORN X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -568,15 +654,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ORN , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void Orn_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "ORN , , {, #}")] + [PairwiseData] + public void Orn_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x2A200000; // ORN W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -589,15 +677,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ORR , , {, #}")] - [MemberData(nameof(TestData_And))] - public void Orr_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "ORR , , {, #}")] + [PairwiseData] + public void Orr_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xAA000000; // ORR X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -610,15 +700,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "ORR , , {, #}")] - [MemberData(nameof(TestData_And32))] - public void Orr_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "ORR , , {, #}")] + [PairwiseData] + public void Orr_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x2A000000; // ORR W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -631,13 +723,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "RORV , , ")] - [MemberData(nameof(TestData_Asrv))] - public void Rorv_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm) + [SkippableTheory(DisplayName = "RORV , , ")] + [PairwiseData] + public void Rorv_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0ul, 31ul, 32ul, 63ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9AC02C00; // RORV X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -649,13 +743,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "RORV , , ")] - [MemberData(nameof(TestData_Asrv32))] - public void Rorv_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm) + [SkippableTheory(DisplayName = "RORV , , ")] + [PairwiseData] + public void Rorv_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 31u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { uint opcode = 0x1AC02C00; // RORV W0, W0, W0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -667,13 +763,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SBC , , ")] - [MemberData(nameof(TestData_Adc))] - public void Sbc_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, + [SkippableTheory(DisplayName = "SBC , , ")] + [PairwiseData] + public void Sbc_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, bool carryIn) { uint opcode = 0xDA000000; // SBC X0, X0, X0 @@ -686,13 +784,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SBC , , ")] - [MemberData(nameof(TestData_Adc32))] - public void Sbc_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, + [SkippableTheory(DisplayName = "SBC , , ")] + [PairwiseData] + public void Sbc_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, bool carryIn) { uint opcode = 0x5A000000; // SBC W0, W0, W0 @@ -705,13 +805,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SBCS , , ")] - [MemberData(nameof(TestData_Adc))] - public void Sbcs_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, + [SkippableTheory(DisplayName = "SBCS , , ")] + [PairwiseData] + public void Sbcs_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, bool carryIn) { uint opcode = 0xFA000000; // SBCS X0, X0, X0 @@ -724,13 +826,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SBCS , , ")] - [MemberData(nameof(TestData_Adc32))] - public void Sbcs_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, + [SkippableTheory(DisplayName = "SBCS , , ")] + [PairwiseData] + public void Sbcs_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, bool carryIn) { uint opcode = 0x7A000000; // SBCS W0, W0, W0 @@ -743,15 +847,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SUB , , {, #}")] - [MemberData(nameof(TestData_Add))] - public void Sub_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "SUB , , {, #}")] + [PairwiseData] + public void Sub_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xCB000000; // SUB X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -764,15 +870,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SUB , , {, #}")] - [MemberData(nameof(TestData_Add32))] - public void Sub_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "SUB , , {, #}")] + [PairwiseData] + public void Sub_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x4B000000; // SUB W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -785,15 +893,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SUBS , , {, #}")] - [MemberData(nameof(TestData_Add))] - public void Subs_64bit(uint rd, - uint rn, - uint rm, - ulong xn, - ulong xm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "SUBS , , {, #}")] + [PairwiseData] + public void Subs_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 31u, 32u, 63u)] uint amount) { uint opcode = 0xEB000000; // SUBS X0, X0, X0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -806,15 +916,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory(DisplayName = "SUBS , , {, #}")] - [MemberData(nameof(TestData_Add32))] - public void Subs_32bit(uint rd, - uint rn, - uint rm, - uint wn, - uint wm, - uint shift, // - uint amount) + [SkippableTheory(DisplayName = "SUBS , , {, #}")] + [PairwiseData] + public void Subs_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { uint opcode = 0x6B000000; // SUBS W0, W0, W0, LSL #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluRs32.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluRs32.cs index 1fe083b645..a4b1ac2c1d 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluRs32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluRs32.cs @@ -2,12 +2,17 @@ using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("AluRs32")] public sealed class CpuTestAluRs32 : CpuTest32 { + public CpuTestAluRs32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if AluRs32 #region "ValueSource (Opcodes)" @@ -36,34 +41,18 @@ namespace Ryujinx.Tests.Cpu } #endregion - private static readonly uint[] _testData_rd = - { - 0u, 13u, - }; - private static readonly uint[] _testData_rn = - { - 1u, 13u, - }; - private static readonly uint[] _testData_rm = - { - 2u, 13u, - }; - private static readonly uint[] _testData_wn = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - private static readonly bool[] _testData_carry = - { - false, - true, - }; - - public static readonly MatrixTheoryData TestData = new(_Adc_Adcs_Rsc_Rscs_Sbc_Sbcs_(), _testData_rd, _testData_rn, _testData_rm, _testData_wn, _testData_wn, _testData_carry); [Theory] - [MemberData(nameof(TestData))] - public void Adc_Adcs_Rsc_Rscs_Sbc_Sbcs(uint opcode, uint rd, uint rn, uint rm, uint wn, uint wm, bool carryIn) + [PairwiseData] + public void Adc_Adcs_Rsc_Rscs_Sbc_Sbcs([CombinatorialMemberData(nameof(_Adc_Adcs_Rsc_Rscs_Sbc_Sbcs_))] uint opcode, + [CombinatorialValues(0u, 13u)] uint rd, + [CombinatorialValues(1u, 13u)] uint rn, + [CombinatorialValues(2u, 13u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + bool carryIn) { opcode |= ((rm & 15) << 0) | ((rn & 15) << 16) | ((rd & 15) << 12); @@ -74,20 +63,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_shift = - { - 0b00u, 0b01u, 0b10u, 0b11u, // - }; - private static readonly uint[] _testData_amount = - { - 0u, 15u, 16u, 31u, - }; - - public static readonly MatrixTheoryData TestData_Add = new(_Add_Adds_Rsb_Rsbs_(), _testData_rd, _testData_rn, _testData_rm, _testData_wn, _testData_wn, _testData_shift, _testData_amount); - [Theory] - [MemberData(nameof(TestData_Add))] - public void Add_Adds_Rsb_Rsbs(uint opcode, uint rd, uint rn, uint rm, uint wn, uint wm, uint shift, uint amount) + [PairwiseData] + public void Add_Adds_Rsb_Rsbs([CombinatorialMemberData(nameof(_Add_Adds_Rsb_Rsbs_))] uint opcode, + [CombinatorialValues(0u, 13u)] uint rd, + [CombinatorialValues(1u, 13u)] uint rn, + [CombinatorialValues(2u, 13u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint shift, // + [CombinatorialValues(0u, 15u, 16u, 31u)] uint amount) { opcode |= ((rm & 15) << 0) | ((rn & 15) << 16) | ((rd & 15) << 12); opcode |= ((shift & 3) << 5) | ((amount & 31) << 7); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestAluRx.cs b/src/Ryujinx.Tests/Cpu/CpuTestAluRx.cs index 03c1a2f4fb..65ad8ba9f5 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestAluRx.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestAluRx.cs @@ -1,24 +1,31 @@ -// #define AluRx +#define AluRx +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("AluRx")] public sealed class CpuTestAluRx : CpuTest { + public CpuTestAluRx(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if AluRx - [Test, Pairwise, Description("ADD , , {, {#}}")] - public void Add_X_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADD , , {, {#}}")] + [PairwiseData] + public void Add_X_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, + [CombinatorialValues((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, 0x8000000000000000, 0xFFFFFFFFFFFFFFFF)] ulong xm, - [Values(0b011u, 0b111u)] uint extend, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0b011u, 0b111u)] uint extend, // + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x8B206000; // ADD X0, X0, X0, UXTX #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -26,7 +33,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: xm, x31: x31); } @@ -38,17 +45,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD , , {, {#}}")] - public void Add_W_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADD , , {, {#}}")] + [PairwiseData] + public void Add_W_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x8B200000; // ADD X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -56,7 +64,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: wm, x31: x31); } @@ -68,17 +76,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD , , {, {#}}")] - public void Add_H_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADD , , {, {#}}")] + [PairwiseData] + public void Add_H_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x8B200000; // ADD X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -86,7 +95,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: wm, x31: x31); } @@ -98,17 +107,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD , , {, {#}}")] - public void Add_B_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADD , , {, {#}}")] + [PairwiseData] + public void Add_B_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x8B200000; // ADD X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -116,7 +126,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: wm, x31: x31); } @@ -128,17 +138,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD , , {, {#}}")] - public void Add_W_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "ADD , , {, {#}}")] + [PairwiseData] + public void Add_W_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x0B200000; // ADD W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -146,7 +157,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wnWsp, x2: wm, x31: w31); } @@ -158,17 +169,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD , , {, {#}}")] - public void Add_H_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "ADD , , {, {#}}")] + [PairwiseData] + public void Add_H_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x0B200000; // ADD W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -176,7 +188,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wnWsp, x2: wm, x31: w31); } @@ -188,17 +200,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD , , {, {#}}")] - public void Add_B_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "ADD , , {, {#}}")] + [PairwiseData] + public void Add_B_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x0B200000; // ADD W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -206,7 +219,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wnWsp, x2: wm, x31: w31); } @@ -218,16 +231,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDS , , {, {#}}")] - public void Adds_X_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADDS , , {, {#}}")] + [PairwiseData] + public void Adds_X_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, + [CombinatorialValues((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, 0x8000000000000000, 0xFFFFFFFFFFFFFFFF)] ulong xm, - [Values(0b011u, 0b111u)] uint extend, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0b011u, 0b111u)] uint extend, // + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xAB206000; // ADDS X0, X0, X0, UXTX #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -238,17 +252,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDS , , {, {#}}")] - public void Adds_W_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADDS , , {, {#}}")] + [PairwiseData] + public void Adds_W_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xAB200000; // ADDS X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -259,17 +274,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDS , , {, {#}}")] - public void Adds_H_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADDS , , {, {#}}")] + [PairwiseData] + public void Adds_H_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xAB200000; // ADDS X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -280,17 +296,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDS , , {, {#}}")] - public void Adds_B_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "ADDS , , {, {#}}")] + [PairwiseData] + public void Adds_B_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xAB200000; // ADDS X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -301,17 +318,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDS , , {, {#}}")] - public void Adds_W_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "ADDS , , {, {#}}")] + [PairwiseData] + public void Adds_W_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x2B200000; // ADDS W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -322,17 +340,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDS , , {, {#}}")] - public void Adds_H_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "ADDS , , {, {#}}")] + [PairwiseData] + public void Adds_H_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x2B200000; // ADDS W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -343,17 +362,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDS , , {, {#}}")] - public void Adds_B_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "ADDS , , {, {#}}")] + [PairwiseData] + public void Adds_B_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x2B200000; // ADDS W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -364,16 +384,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , {, {#}}")] - public void Sub_X_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUB , , {, {#}}")] + [PairwiseData] + public void Sub_X_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, + [CombinatorialValues((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, 0x8000000000000000, 0xFFFFFFFFFFFFFFFF)] ulong xm, - [Values(0b011u, 0b111u)] uint extend, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0b011u, 0b111u)] uint extend, // + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xCB206000; // SUB X0, X0, X0, UXTX #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -381,7 +402,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: xm, x31: x31); } @@ -393,17 +414,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , {, {#}}")] - public void Sub_W_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUB , , {, {#}}")] + [PairwiseData] + public void Sub_W_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xCB200000; // SUB X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -411,7 +433,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: wm, x31: x31); } @@ -423,17 +445,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , {, {#}}")] - public void Sub_H_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUB , , {, {#}}")] + [PairwiseData] + public void Sub_H_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xCB200000; // SUB X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -441,7 +464,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: wm, x31: x31); } @@ -453,17 +476,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , {, {#}}")] - public void Sub_B_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUB , , {, {#}}")] + [PairwiseData] + public void Sub_B_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xCB200000; // SUB X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -471,7 +495,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xnSp, x2: wm, x31: x31); } @@ -483,17 +507,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , {, {#}}")] - public void Sub_W_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SUB , , {, {#}}")] + [PairwiseData] + public void Sub_W_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x4B200000; // SUB W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -501,7 +526,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wnWsp, x2: wm, x31: w31); } @@ -513,17 +538,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , {, {#}}")] - public void Sub_H_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SUB , , {, {#}}")] + [PairwiseData] + public void Sub_H_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x4B200000; // SUB W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -531,7 +557,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wnWsp, x2: wm, x31: w31); } @@ -543,17 +569,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , {, {#}}")] - public void Sub_B_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SUB , , {, {#}}")] + [PairwiseData] + public void Sub_B_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x4B200000; // SUB W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -561,7 +588,7 @@ namespace Ryujinx.Tests.Cpu if (rn != 31) { - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wnWsp, x2: wm, x31: w31); } @@ -573,16 +600,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBS , , {, {#}}")] - public void Subs_X_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUBS , , {, {#}}")] + [PairwiseData] + public void Subs_X_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, + [CombinatorialValues((ulong)0x0000000000000000, (ulong)0x7FFFFFFFFFFFFFFF, 0x8000000000000000, 0xFFFFFFFFFFFFFFFF)] ulong xm, - [Values(0b011u, 0b111u)] uint extend, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0b011u, 0b111u)] uint extend, // + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xEB206000; // SUBS X0, X0, X0, UXTX #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -593,17 +621,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBS , , {, {#}}")] - public void Subs_W_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUBS , , {, {#}}")] + [PairwiseData] + public void Subs_W_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xEB200000; // SUBS X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -614,17 +643,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBS , , {, {#}}")] - public void Subs_H_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUBS , , {, {#}}")] + [PairwiseData] + public void Subs_H_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xEB200000; // SUBS X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -635,17 +665,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBS , , {, {#}}")] - public void Subs_B_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SUBS , , {, {#}}")] + [PairwiseData] + public void Subs_B_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xnSp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0xEB200000; // SUBS X0, X0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -656,17 +687,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBS , , {, {#}}")] - public void Subs_W_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SUBS , , {, {#}}")] + [PairwiseData] + public void Subs_W_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((uint)0x00000000, (uint)0x7FFFFFFF, + [CombinatorialValues((uint)0x00000000, (uint)0x7FFFFFFF, 0x80000000, 0xFFFFFFFF)] uint wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x6B200000; // SUBS W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -677,17 +709,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBS , , {, {#}}")] - public void Subs_H_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SUBS , , {, {#}}")] + [PairwiseData] + public void Subs_H_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((ushort)0x0000, (ushort)0x7FFF, + [CombinatorialValues((ushort)0x0000, (ushort)0x7FFF, (ushort)0x8000, (ushort)0xFFFF)] ushort wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x6B200000; // SUBS W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -698,17 +731,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBS , , {, {#}}")] - public void Subs_B_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SUBS , , {, {#}}")] + [PairwiseData] + public void Subs_B_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wnWsp, - [Values((byte)0x00, (byte)0x7F, + [CombinatorialValues((byte)0x00, (byte)0x7F, (byte)0x80, (byte)0xFF)] byte wm, - [Values(0b000u, 0b001u, 0b010u, 0b011u, // - [Values(0u, 1u, 2u, 3u, 4u)] uint amount) + [CombinatorialValues(0u, 1u, 2u, 3u, 4u)] uint amount) { uint opcode = 0x6B200000; // SUBS W0, W0, W0, UXTB #0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestBf32.cs b/src/Ryujinx.Tests/Cpu/CpuTestBf32.cs index 21b3e6edaf..fc397b9756 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestBf32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestBf32.cs @@ -2,34 +2,27 @@ using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Bf32")] public sealed class CpuTestBf32 : CpuTest32 { + public CpuTestBf32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Bf32 private const int RndCnt = 2; - private static readonly uint[] _testData_rd = - { - 0u, 0xdu, - }; - private static readonly uint[] _testData_wd = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - private static readonly uint[] _testData_lsb = - { - 0u, 15u, 16u, 31u, - }; - - public static readonly MatrixTheoryData TestData_Bfc = new(_testData_rd, _testData_wd, _testData_lsb, _testData_lsb); - [Theory(DisplayName = "BFC , #, #")] - [MemberData(nameof(TestData_Bfc))] - public void Bfc(uint rd, uint wd, uint lsb, uint msb) + [PairwiseData] + public void Bfc([CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wd, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint lsb, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint msb) { msb = Math.Max(lsb, msb); // Don't test unpredictable for now. uint opcode = 0xe7c0001fu; // BFC R0, #0, #1 @@ -43,16 +36,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_rn = - { - 1u, 0xdu, - }; - - public static readonly MatrixTheoryData TestData_Bfi = new(_testData_rd, _testData_rn, Random.Shared.NextUIntEnumerable(RndCnt), _testData_wd, _testData_lsb, _testData_lsb); - [Theory(DisplayName = "BFI , , #, #")] - [MemberData(nameof(TestData_Bfi))] - public void Bfi(uint rd, uint rn, uint wd, uint wn, uint lsb, uint msb) + [PairwiseData] + public void Bfi([CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u, 0xdu)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint wd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint lsb, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint msb) { msb = Math.Max(lsb, msb); // Don't test unpredictable for now. uint opcode = 0xe7c00010u; // BFI R0, R0, #0, #1 @@ -68,8 +60,14 @@ namespace Ryujinx.Tests.Cpu } [Theory(DisplayName = "UBFX , , #, #")] - [MemberData(nameof(TestData_Bfi))] - public void Ubfx(uint rd, uint rn, uint wd, uint wn, uint lsb, uint widthm1) + [PairwiseData] + public void Ubfx([CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u, 0xdu)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint wd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint lsb, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint widthm1) { if (lsb + widthm1 > 31) { @@ -88,8 +86,14 @@ namespace Ryujinx.Tests.Cpu } [Theory(DisplayName = "SBFX , , #, #")] - [MemberData(nameof(TestData_Bfi))] - public void Sbfx(uint rd, uint rn, uint wd, uint wn, uint lsb, uint widthm1) + [PairwiseData] + public void Sbfx([CombinatorialValues(0u, 0xdu)] uint rd, + [CombinatorialValues(1u, 0xdu)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint wd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint lsb, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint widthm1) { if (lsb + widthm1 > 31) { diff --git a/src/Ryujinx.Tests/Cpu/CpuTestBfm.cs b/src/Ryujinx.Tests/Cpu/CpuTestBfm.cs index 2e7b6ddc16..08ed2a80e0 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestBfm.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestBfm.cs @@ -1,125 +1,137 @@ -// #define Bfm +#define Bfm +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Bfm")] public sealed class CpuTestBfm : CpuTest { + public CpuTestBfm(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Bfm private const int RndCnt = 2; - [Test, Pairwise, Description("BFM , , #, #")] - public void Bfm_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Random(RndCnt)] ulong xd, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "BFM , , #, #")] + [PairwiseData] + public void Bfm_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] ulong xd, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0u, 31u, 32u, 63u)] uint immr, - [Values(0u, 31u, 32u, 63u)] uint imms) + [CombinatorialValues(0u, 31u, 32u, 63u)] uint immr, + [CombinatorialValues(0u, 31u, 32u, 63u)] uint imms) { uint opcode = 0xB3400000; // BFM X0, X0, #0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((immr & 63) << 16) | ((imms & 63) << 10); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x0: xd, x1: xn, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BFM , , #, #")] - public void Bfm_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Random(RndCnt)] uint wd, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "BFM , , #, #")] + [PairwiseData] + public void Bfm_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialRandomData(Count = RndCnt)] uint wd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0u, 15u, 16u, 31u)] uint immr, - [Values(0u, 15u, 16u, 31u)] uint imms) + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint imms) { uint opcode = 0x33000000; // BFM W0, W0, #0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((immr & 63) << 16) | ((imms & 63) << 10); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x0: wd, x1: wn, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SBFM , , #, #")] - public void Sbfm_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SBFM , , #, #")] + [PairwiseData] + public void Sbfm_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0u, 31u, 32u, 63u)] uint immr, - [Values(0u, 31u, 32u, 63u)] uint imms) + [CombinatorialValues(0u, 31u, 32u, 63u)] uint immr, + [CombinatorialValues(0u, 31u, 32u, 63u)] uint imms) { uint opcode = 0x93400000; // SBFM X0, X0, #0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((immr & 63) << 16) | ((imms & 63) << 10); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SBFM , , #, #")] - public void Sbfm_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SBFM , , #, #")] + [PairwiseData] + public void Sbfm_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0u, 15u, 16u, 31u)] uint immr, - [Values(0u, 15u, 16u, 31u)] uint imms) + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint imms) { uint opcode = 0x13000000; // SBFM W0, W0, #0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((immr & 63) << 16) | ((imms & 63) << 10); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UBFM , , #, #")] - public void Ubfm_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "UBFM , , #, #")] + [PairwiseData] + public void Ubfm_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0u, 31u, 32u, 63u)] uint immr, - [Values(0u, 31u, 32u, 63u)] uint imms) + [CombinatorialValues(0u, 31u, 32u, 63u)] uint immr, + [CombinatorialValues(0u, 31u, 32u, 63u)] uint imms) { uint opcode = 0xD3400000; // UBFM X0, X0, #0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((immr & 63) << 16) | ((imms & 63) << 10); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UBFM , , #, #")] - public void Ubfm_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "UBFM , , #, #")] + [PairwiseData] + public void Ubfm_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0u, 15u, 16u, 31u)] uint immr, - [Values(0u, 15u, 16u, 31u)] uint imms) + [CombinatorialValues(0u, 15u, 16u, 31u)] uint immr, + [CombinatorialValues(0u, 15u, 16u, 31u)] uint imms) { uint opcode = 0x53000000; // UBFM W0, W0, #0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((immr & 63) << 16) | ((imms & 63) << 10); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x31: w31); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestCcmpImm.cs b/src/Ryujinx.Tests/Cpu/CpuTestCcmpImm.cs index e46cb9d1aa..213a22c287 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestCcmpImm.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestCcmpImm.cs @@ -1,22 +1,34 @@ -// #define CcmpImm +#define CcmpImm +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("CcmpImm")] public sealed class CpuTestCcmpImm : CpuTest { -#if CcmpImm - private const int RndCntNzcv = 2; + public CpuTestCcmpImm(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } - [Test, Pairwise, Description("CCMN , #, #, ")] - public void Ccmn_64bit([Values(1u, 31u)] uint rn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, +#if CcmpImm + + public static readonly uint[] RandomNzcv = + { + Random.Shared.NextUInt(15u), + Random.Shared.NextUInt(15u), + }; + + [SkippableTheory(DisplayName = "CCMN , #, #, ")] + [PairwiseData] + public void Ccmn_64bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0u, 31u)] uint imm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -25,20 +37,21 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5); opcode |= ((imm & 31) << 16) | ((cond & 15) << 12) | ((nzcv & 15) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CCMN , #, #, ")] - public void Ccmn_32bit([Values(1u, 31u)] uint rn, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CCMN , #, #, ")] + [PairwiseData] + public void Ccmn_32bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0u, 31u)] uint imm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -47,20 +60,21 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5); opcode |= ((imm & 31) << 16) | ((cond & 15) << 12) | ((nzcv & 15) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CCMP , #, #, ")] - public void Ccmp_64bit([Values(1u, 31u)] uint rn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "CCMP , #, #, ")] + [PairwiseData] + public void Ccmp_64bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0u, 31u)] uint imm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -69,20 +83,21 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5); opcode |= ((imm & 31) << 16) | ((cond & 15) << 12) | ((nzcv & 15) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CCMP , #, #, ")] - public void Ccmp_32bit([Values(1u, 31u)] uint rn, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CCMP , #, #, ")] + [PairwiseData] + public void Ccmp_32bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0u, 31u)] uint imm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -91,7 +106,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5); opcode |= ((imm & 31) << 16) | ((cond & 15) << 12) | ((nzcv & 15) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x31: w31); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestCcmpReg.cs b/src/Ryujinx.Tests/Cpu/CpuTestCcmpReg.cs index cff338881b..2535110b2f 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestCcmpReg.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestCcmpReg.cs @@ -1,24 +1,35 @@ -// #define CcmpReg +#define CcmpReg +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("CcmpReg")] public sealed class CpuTestCcmpReg : CpuTest { -#if CcmpReg - private const int RndCntNzcv = 2; + public CpuTestCcmpReg(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } - [Test, Pairwise, Description("CCMN , , #, ")] - public void Ccmn_64bit([Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, +#if CcmpReg + public static readonly uint[] RandomNzcv = + { + Random.Shared.NextUInt(15u), + Random.Shared.NextUInt(15u), + }; + + [SkippableTheory(DisplayName = "CCMN , , #, ")] + [PairwiseData] + public void Ccmn_64bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -27,22 +38,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5); opcode |= ((cond & 15) << 12) | ((nzcv & 15) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CCMN , , #, ")] - public void Ccmn_32bit([Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CCMN , , #, ")] + [PairwiseData] + public void Ccmn_32bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -51,22 +63,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5); opcode |= ((cond & 15) << 12) | ((nzcv & 15) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CCMP , , #, ")] - public void Ccmp_64bit([Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "CCMP , , #, ")] + [PairwiseData] + public void Ccmp_64bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -75,22 +88,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5); opcode |= ((cond & 15) << 12) | ((nzcv & 15) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CCMP , , #, ")] - public void Ccmp_32bit([Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CCMP , , #, ")] + [PairwiseData] + public void Ccmp_32bit([CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -99,7 +113,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5); opcode |= ((cond & 15) << 12) | ((nzcv & 15) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x31: w31); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestCsel.cs b/src/Ryujinx.Tests/Cpu/CpuTestCsel.cs index 9ed2fd5d0c..190e97325a 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestCsel.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestCsel.cs @@ -1,23 +1,30 @@ -// #define Csel +#define Csel +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Csel")] public sealed class CpuTestCsel : CpuTest { + public CpuTestCsel(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Csel - [Test, Pairwise, Description("CSEL , , , ")] - public void Csel_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "CSEL , , , ")] + [PairwiseData] + public void Csel_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -26,22 +33,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CSEL , , , ")] - public void Csel_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CSEL , , , ")] + [PairwiseData] + public void Csel_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -50,22 +58,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CSINC , , , ")] - public void Csinc_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "CSINC , , , ")] + [PairwiseData] + public void Csinc_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -74,22 +83,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CSINC , , , ")] - public void Csinc_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CSINC , , , ")] + [PairwiseData] + public void Csinc_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -98,22 +108,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CSINV , , , ")] - public void Csinv_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "CSINV , , , ")] + [PairwiseData] + public void Csinv_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -122,22 +133,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CSINV , , , ")] - public void Csinv_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CSINV , , , ")] + [PairwiseData] + public void Csinv_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -146,22 +158,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CSNEG , , , ")] - public void Csneg_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "CSNEG , , , ")] + [PairwiseData] + public void Csneg_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -170,22 +183,23 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CSNEG , , , ")] - public void Csneg_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "CSNEG , , , ")] + [PairwiseData] + public void Csneg_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // @@ -194,7 +208,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= ((cond & 15) << 12); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x31: w31); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs b/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs index c587ec4143..81a7b440ea 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestMisc.cs @@ -4,12 +4,17 @@ using ARMeilleure.State; using System; using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Misc")] public sealed class CpuTestMisc : CpuTest { + public CpuTestMisc(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Misc #region "ValueSource (Types)" @@ -63,44 +68,16 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noNaNs = false; #region "AluImm & Csel" - private static readonly ulong[] _testDataXn = - { - 0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, - 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul, - }; - - private static readonly uint[] _testDataWn = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - private static readonly uint[] _testDataImm = - { - 0u, 4095u, - }; - - private static readonly uint[] _testDataShift = - { - 0b00u, 0b01u, - }; - - private static readonly uint[] _testDataCond = - { - 0b0000u, 0b0001u, 0b0010u, 0b0011u, // - }; - - public static readonly MatrixTheoryData TestMatrixData_64bit = new(_testDataXn, _testDataImm, _testDataShift, _testDataCond); - public static readonly MatrixTheoryData TestMatrixData_32bit = new(_testDataWn, _testDataImm, _testDataShift, _testDataCond); - - public static readonly RangeTheoryData TestRangeData = new(0u, 92u, 1u); - - [Theory] - [MemberData(nameof(TestMatrixData_64bit))] - public void Adds_Csinc_64bit(ulong xn, uint imm, uint shift, uint cond) + [SkippableTheory] + [PairwiseData] + public void Adds_Csinc_64bit([CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift, // + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { uint opCmn = 0xB100001F; // ADDS X31, X0, #0, LSL #0 -> CMN X0, #0, LSL #0 uint opCset = 0x9A9F07E0; // CSINC X0, X31, X31, EQ -> CSET X0, NE @@ -117,9 +94,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory] - [MemberData(nameof(TestMatrixData_32bit))] - public void Adds_Csinc_32bit(uint wn, uint imm, uint shift, uint cond) + [SkippableTheory] + [PairwiseData] + public void Adds_Csinc_32bit([CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift, // + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { uint opCmn = 0x3100001F; // ADDS W31, W0, #0, LSL #0 -> CMN W0, #0, LSL #0 uint opCset = 0x1A9F07E0; // CSINC W0, W31, W31, EQ -> CSET W0, NE @@ -136,9 +120,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory] - [MemberData(nameof(TestMatrixData_64bit))] - public void Subs_Csinc_64bit(ulong xn, uint imm, uint shift, uint cond) + [SkippableTheory] + [PairwiseData] + public void Subs_Csinc_64bit([CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift, // + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { uint opCmp = 0xF100001F; // SUBS X31, X0, #0, LSL #0 -> CMP X0, #0, LSL #0 uint opCset = 0x9A9F07E0; // CSINC X0, X31, X31, EQ -> CSET X0, NE @@ -155,9 +146,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Theory] - [MemberData(nameof(TestMatrixData_32bit))] - public void Subs_Csinc_32bit(uint wn, uint imm, uint shift, uint cond) + [SkippableTheory] + [PairwiseData] + public void Subs_Csinc_32bit([CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0u, 4095u)] uint imm, + [CombinatorialValues(0b00u, 0b01u)] uint shift, // + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { uint opCmp = 0x7100001F; // SUBS W31, W0, #0, LSL #0 -> CMP W0, #0, LSL #0 uint opCset = 0x1A9F07E0; // CSINC W0, W31, W31, EQ -> CSET W0, NE @@ -303,8 +301,8 @@ namespace Ryujinx.Tests.Cpu } [Theory(Skip = "The Tester supports only one return point.")] - [MemberData(nameof(TestRangeData))] - public void MiscF(uint a) + [CombinatorialData] + public void MiscF([CombinatorialRange(0u, 92u, 1u)] uint a) { static ulong Fn(uint n) { @@ -423,40 +421,28 @@ namespace Ryujinx.Tests.Cpu Assert.Equal(a, context.GetX(0)); } - private static readonly ulong[] _testDataMisc4Displacement = - { - 0ul, 1ul, 2ul, 3ul, - }; - - public static readonly MatrixTheoryData TestDataMisc4 = new(_1S_F_(), _1S_F_(), _1S_F_(), _testDataMisc4Displacement); - - // This test used to be skipped unless explicitly executed - [SkippableTheory] - [MemberData(nameof(TestDataMisc4))] - public void Misc4(ulong a, ulong b, ulong c, ulong displacement) + [Theory] + [PairwiseData] + public void Misc4([CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b, + [CombinatorialMemberData(nameof(_1S_F_))] ulong c, + [CombinatorialValues(0ul, 1ul, 2ul, 3ul)] ulong displacement) { Skip.IfNot(BitConverter.IsLittleEndian); - byte[] data = new byte[1]; - for (ulong gapOffset = 0; gapOffset < displacement; gapOffset++) { - Random.Shared.NextBytes(data); - SetWorkingMemory(gapOffset, data[0]); + SetWorkingMemory(gapOffset, Random.Shared.NextByte()); } SetWorkingMemory(0x0 + displacement, BitConverter.GetBytes((uint)b)); SetWorkingMemory(0x4 + displacement, BitConverter.GetBytes((uint)c)); - Random.Shared.NextBytes(data); - SetWorkingMemory(0x8 + displacement, data[0]); - Random.Shared.NextBytes(data); - SetWorkingMemory(0x9 + displacement, data[0]); - Random.Shared.NextBytes(data); - SetWorkingMemory(0xA + displacement, data[0]); - Random.Shared.NextBytes(data); - SetWorkingMemory(0xB + displacement, data[0]); + SetWorkingMemory(0x8 + displacement, Random.Shared.NextByte()); + SetWorkingMemory(0x9 + displacement, Random.Shared.NextByte()); + SetWorkingMemory(0xA + displacement, Random.Shared.NextByte()); + SetWorkingMemory(0xB + displacement, Random.Shared.NextByte()); SetContext( x0: DataBaseAddress + displacement, @@ -480,12 +466,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly EnumerableTheoryData TestDataMisc5 = new(_1S_F_()); - // This test used to be skipped unless explicitly executed [Theory] - [MemberData(nameof(TestDataMisc5))] - public void Misc5(ulong a) + [CombinatorialData] + public void Misc5([CombinatorialMemberData(nameof(_1S_F_))] ulong a) { SetContext( v0: MakeVectorE0E1(a, Random.Shared.NextULong()), diff --git a/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs b/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs index b0b7285d5a..31ddac50a5 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestMisc32.cs @@ -4,12 +4,17 @@ using ARMeilleure.State; using System; using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Misc32")] public sealed class CpuTestMisc32 : CpuTest32 { + public CpuTestMisc32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Misc32 #region "ValueSource (Types)" @@ -62,17 +67,13 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - private static readonly bool[] _testData_bool = - { - false, - true, - }; - - public static readonly MatrixTheoryData TestData = new(_1S_F_(), _1S_F_(), _testData_bool, _testData_bool, _testData_bool); - [Theory] - [MemberData(nameof(TestData))] - public void Vmsr_Vcmp_Vmrs(ulong a, ulong b, bool mode1, bool mode2, bool mode3) + [PairwiseData] + public void Vmsr_Vcmp_Vmrs([CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b, + bool mode1, + bool mode2, + bool mode3) { V128 v4 = MakeVectorE0(a); V128 v5 = MakeVectorE0(b); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestMov.cs b/src/Ryujinx.Tests/Cpu/CpuTestMov.cs index 225b8994de..6d4b408b4a 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestMov.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestMov.cs @@ -1,107 +1,119 @@ -// #define Mov +#define Mov +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Mov")] public sealed class CpuTestMov : CpuTest { + public CpuTestMov(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Mov private const int RndCnt = 2; - [Test, Pairwise, Description("MOVK , #{, LSL #}")] - public void Movk_64bit([Values(0u, 31u)] uint rd, - [Random(RndCnt)] ulong xd, - [Values(0u, 65535u)] uint imm, - [Values(0u, 16u, 32u, 48u)] uint shift) + [SkippableTheory(DisplayName = "MOVK , #{, LSL #}")] + [PairwiseData] + public void Movk_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialRandomData(Count = RndCnt)] ulong xd, + [CombinatorialValues(0u, 65535u)] uint imm, + [CombinatorialValues(0u, 16u, 32u, 48u)] uint shift) { uint opcode = 0xF2800000; // MOVK X0, #0, LSL #0 opcode |= ((rd & 31) << 0); opcode |= (((shift / 16) & 3) << 21) | ((imm & 65535) << 5); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x0: xd, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MOVK , #{, LSL #}")] - public void Movk_32bit([Values(0u, 31u)] uint rd, - [Random(RndCnt)] uint wd, - [Values(0u, 65535u)] uint imm, - [Values(0u, 16u)] uint shift) + [SkippableTheory(DisplayName = "MOVK , #{, LSL #}")] + [PairwiseData] + public void Movk_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialRandomData(Count = RndCnt)] uint wd, + [CombinatorialValues(0u, 65535u)] uint imm, + [CombinatorialValues(0u, 16u)] uint shift) { uint opcode = 0x72800000; // MOVK W0, #0, LSL #0 opcode |= ((rd & 31) << 0); opcode |= (((shift / 16) & 3) << 21) | ((imm & 65535) << 5); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x0: wd, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MOVN , #{, LSL #}")] - public void Movn_64bit([Values(0u, 31u)] uint rd, - [Values(0u, 65535u)] uint imm, - [Values(0u, 16u, 32u, 48u)] uint shift) + [SkippableTheory(DisplayName = "MOVN , #{, LSL #}")] + [PairwiseData] + public void Movn_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(0u, 65535u)] uint imm, + [CombinatorialValues(0u, 16u, 32u, 48u)] uint shift) { uint opcode = 0x92800000; // MOVN X0, #0, LSL #0 opcode |= ((rd & 31) << 0); opcode |= (((shift / 16) & 3) << 21) | ((imm & 65535) << 5); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MOVN , #{, LSL #}")] - public void Movn_32bit([Values(0u, 31u)] uint rd, - [Values(0u, 65535u)] uint imm, - [Values(0u, 16u)] uint shift) + [SkippableTheory(DisplayName = "MOVN , #{, LSL #}")] + [PairwiseData] + public void Movn_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(0u, 65535u)] uint imm, + [CombinatorialValues(0u, 16u)] uint shift) { uint opcode = 0x12800000; // MOVN W0, #0, LSL #0 opcode |= ((rd & 31) << 0); opcode |= (((shift / 16) & 3) << 21) | ((imm & 65535) << 5); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MOVZ , #{, LSL #}")] - public void Movz_64bit([Values(0u, 31u)] uint rd, - [Values(0u, 65535u)] uint imm, - [Values(0u, 16u, 32u, 48u)] uint shift) + [SkippableTheory(DisplayName = "MOVZ , #{, LSL #}")] + [PairwiseData] + public void Movz_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(0u, 65535u)] uint imm, + [CombinatorialValues(0u, 16u, 32u, 48u)] uint shift) { uint opcode = 0xD2800000; // MOVZ X0, #0, LSL #0 opcode |= ((rd & 31) << 0); opcode |= (((shift / 16) & 3) << 21) | ((imm & 65535) << 5); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MOVZ , #{, LSL #}")] - public void Movz_32bit([Values(0u, 31u)] uint rd, - [Values(0u, 65535u)] uint imm, - [Values(0u, 16u)] uint shift) + [SkippableTheory(DisplayName = "MOVZ , #{, LSL #}")] + [PairwiseData] + public void Movz_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(0u, 65535u)] uint imm, + [CombinatorialValues(0u, 16u)] uint shift) { uint opcode = 0x52800000; // MOVZ W0, #0, LSL #0 opcode |= ((rd & 31) << 0); opcode |= (((shift / 16) & 3) << 21) | ((imm & 65535) << 5); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x31: w31); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestMul.cs b/src/Ryujinx.Tests/Cpu/CpuTestMul.cs index ba5a37c5a7..df9e66685d 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestMul.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestMul.cs @@ -1,221 +1,237 @@ -// #define Mul +#define Mul +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Mul")] public sealed class CpuTestMul : CpuTest { + public CpuTestMul(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Mul - [Test, Pairwise, Description("MADD , , , ")] - public void Madd_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "MADD , , , ")] + [PairwiseData] + public void Madd_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xa) { uint opcode = 0x9B000000; // MADD X0, X0, X0, X0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x3: xa, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MADD , , , ")] - public void Madd_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "MADD , , , ")] + [PairwiseData] + public void Madd_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wa) { uint opcode = 0x1B000000; // MADD W0, W0, W0, W0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x3: wa, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MSUB , , , ")] - public void Msub_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "MSUB , , , ")] + [PairwiseData] + public void Msub_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xa) { uint opcode = 0x9B008000; // MSUB X0, X0, X0, X0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x3: xa, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("MSUB , , , ")] - public void Msub_32bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "MSUB , , , ")] + [PairwiseData] + public void Msub_32bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wa) { uint opcode = 0x1B008000; // MSUB W0, W0, W0, W0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); SingleOpcode(opcode, x1: wn, x2: wm, x3: wa, x31: w31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMADDL , , , ")] - public void Smaddl_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SMADDL , , , ")] + [PairwiseData] + public void Smaddl_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xa) { uint opcode = 0x9B200000; // SMADDL X0, W0, W0, X0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: wn, x2: wm, x3: xa, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UMADDL , , , ")] - public void Umaddl_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "UMADDL , , , ")] + [PairwiseData] + public void Umaddl_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xa) { uint opcode = 0x9BA00000; // UMADDL X0, W0, W0, X0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: wn, x2: wm, x3: xa, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMSUBL , , , ")] - public void Smsubl_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "SMSUBL , , , ")] + [PairwiseData] + public void Smsubl_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xa) { uint opcode = 0x9B208000; // SMSUBL X0, W0, W0, X0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: wn, x2: wm, x3: xa, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UMSUBL , , , ")] - public void Umsubl_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(3u, 31u)] uint ra, - [Values(0x00000000u, 0x7FFFFFFFu, + [SkippableTheory(DisplayName = "UMSUBL , , , ")] + [PairwiseData] + public void Umsubl_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(3u, 31u)] uint ra, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wn, - [Values(0x00000000u, 0x7FFFFFFFu, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, 0x80000000u, 0xFFFFFFFFu)] uint wm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xa) { uint opcode = 0x9BA08000; // UMSUBL X0, W0, W0, X0 opcode |= ((rm & 31) << 16) | ((ra & 31) << 10) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: wn, x2: wm, x3: xa, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMULH , , ")] - public void Smulh_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "SMULH , , ")] + [PairwiseData] + public void Smulh_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9B407C00; // SMULH X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UMULH , , ")] - public void Umulh_64bit([Values(0u, 31u)] uint rd, - [Values(1u, 31u)] uint rn, - [Values(2u, 31u)] uint rm, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [SkippableTheory(DisplayName = "UMULH , , ")] + [PairwiseData] + public void Umulh_64bit([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialValues(2u, 31u)] uint rm, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xn, - [Values(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, + [CombinatorialValues(0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul, 0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul)] ulong xm) { uint opcode = 0x9BC07C00; // UMULH X0, X0, X0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); SingleOpcode(opcode, x1: xn, x2: xm, x31: x31); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestMul32.cs b/src/Ryujinx.Tests/Cpu/CpuTestMul32.cs index d1a15cec82..c94429ff96 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestMul32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestMul32.cs @@ -2,12 +2,17 @@ using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Mul32")] public sealed class CpuTestMul32 : CpuTest32 { + public CpuTestMul32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Mul32 #region "ValueSource (Opcodes)" @@ -52,33 +57,19 @@ namespace Ryujinx.Tests.Cpu } #endregion - private static readonly uint[] _testData_rn = - { - 0u, 0xdu, - }; - private static readonly uint[] _testData_rm = - { - 1u, 0xdu, - }; - private static readonly uint[] _testData_ra = - { - 2u, 0xdu, - }; - private static readonly uint[] _testData_rd = - { - 3u, 0xdu, - }; - private static readonly uint[] _testData_wn = - { - 0x00000000u, 0x7FFFFFFFu, - 0x80000000u, 0xFFFFFFFFu, - }; - - public static readonly MatrixTheoryData TestData_Smla = new(_Smlabb_Smlabt_Smlatb_Smlatt_(), _testData_rn, _testData_rm, _testData_ra, _testData_rd, _testData_wn, _testData_wn, _testData_wn); - [Theory(DisplayName = "SMLA , , , ")] - [MemberData(nameof(TestData_Smla))] - public void Smla___32bit(uint opcode, uint rn, uint rm, uint ra, uint rd, uint wn, uint wm, uint wa) + [PairwiseData] + public void Smla___32bit([CombinatorialMemberData(nameof(_Smlabb_Smlabt_Smlatb_Smlatt_))] uint opcode, + [CombinatorialValues(0u, 0xdu)] uint rn, + [CombinatorialValues(1u, 0xdu)] uint rm, + [CombinatorialValues(2u, 0xdu)] uint ra, + [CombinatorialValues(3u, 0xdu)] uint rd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wa) { opcode |= ((rn & 15) << 0) | ((rm & 15) << 8) | ((ra & 15) << 12) | ((rd & 15) << 16); @@ -89,11 +80,19 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Smlaw = new(_Smlawb_Smlawt_(), _testData_rn, _testData_rm, _testData_ra, _testData_rd, _testData_wn, _testData_wn, _testData_wn); - [Theory(DisplayName = "SMLAW , , , ")] - [MemberData(nameof(TestData_Smlaw))] - public void Smlaw__32bit(uint opcode, uint rn, uint rm, uint ra, uint rd, uint wn, uint wm, uint wa) + [PairwiseData] + public void Smlaw__32bit([CombinatorialMemberData(nameof(_Smlawb_Smlawt_))] uint opcode, + [CombinatorialValues(0u, 0xdu)] uint rn, + [CombinatorialValues(1u, 0xdu)] uint rm, + [CombinatorialValues(2u, 0xdu)] uint ra, + [CombinatorialValues(3u, 0xdu)] uint rd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wa) { opcode |= ((rn & 15) << 0) | ((rm & 15) << 8) | ((ra & 15) << 12) | ((rd & 15) << 16); @@ -104,11 +103,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Smul = new(_Smulbb_Smulbt_Smultb_Smultt_(), _testData_rn, _testData_rm, _testData_rd, _testData_wn, _testData_wn); - [Theory(DisplayName = "SMUL , , ")] - [MemberData(nameof(TestData_Smul))] - public void Smul___32bit(uint opcode, uint rn, uint rm, uint rd, uint wn, uint wm) + [PairwiseData] + public void Smul___32bit([CombinatorialMemberData(nameof(_Smulbb_Smulbt_Smultb_Smultt_))] uint opcode, + [CombinatorialValues(0u, 0xdu)] uint rn, + [CombinatorialValues(1u, 0xdu)] uint rm, + [CombinatorialValues(2u, 0xdu)] uint rd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { opcode |= ((rn & 15) << 0) | ((rm & 15) << 8) | ((rd & 15) << 16); @@ -119,11 +123,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - public static readonly MatrixTheoryData TestData_Smulw = new(_Smulwb_Smulwt_(), _testData_rn, _testData_rm, _testData_rd, _testData_wn, _testData_wn); - [Theory(DisplayName = "SMULW , , ")] - [MemberData(nameof(TestData_Smulw))] - public void Smulw__32bit(uint opcode, uint rn, uint rm, uint rd, uint wn, uint wm) + [PairwiseData] + public void Smulw__32bit([CombinatorialMemberData(nameof(_Smulwb_Smulwt_))] uint opcode, + [CombinatorialValues(0u, 0xdu)] uint rn, + [CombinatorialValues(1u, 0xdu)] uint rm, + [CombinatorialValues(2u, 0xdu)] uint rd, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wn, + [CombinatorialValues(0x00000000u, 0x7FFFFFFFu, + 0x80000000u, 0xFFFFFFFFu)] uint wm) { opcode |= ((rn & 15) << 0) | ((rm & 15) << 8) | ((rd & 15) << 16); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs index bce7225e0a..5f410e3d55 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimd.cs @@ -1,12 +1,20 @@ -// #define Simd +#define Simd +using ARMeilleure.State; +using System; +using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Simd")] public sealed class CpuTestSimd : CpuTest { + public CpuTestSimd(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Simd #region "Helper methods" @@ -52,7 +60,7 @@ namespace Ryujinx.Tests.Cpu return 1; } - byte rnd = TestContext.CurrentContext.Random.NextByte(); + byte rnd = Random.Shared.NextByte(); sbyte mask = sbyte.MinValue; return (byte)(((uint)rnd >> (cnt + 1)) | ((uint)((byte)mask) >> cnt)); @@ -70,7 +78,7 @@ namespace Ryujinx.Tests.Cpu return 1; } - ushort rnd = TestContext.CurrentContext.Random.NextUShort(); + ushort rnd = Random.Shared.NextUShort(); short mask = short.MinValue; return (ushort)(((uint)rnd >> (cnt + 1)) | ((uint)((ushort)mask) >> cnt)); @@ -88,7 +96,7 @@ namespace Ryujinx.Tests.Cpu return 1u; } - uint rnd = TestContext.CurrentContext.Random.NextUInt(); + uint rnd = Random.Shared.NextUInt(); int mask = int.MinValue; return (rnd >> (cnt + 1)) | ((uint)mask >> cnt); @@ -249,7 +257,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUShort(); + ulong grbg = Random.Shared.NextUShort(); ulong rnd1 = GenNormalH(); ulong rnd2 = GenSubnormalH(); @@ -332,7 +340,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = GenNormalS(); ulong rnd2 = GenSubnormalS(); @@ -387,10 +395,10 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); - ulong rnd1 = (uint)BitConverter.SingleToInt32Bits((int)TestContext.CurrentContext.Random.NextUInt()); - ulong rnd2 = (uint)BitConverter.SingleToInt32Bits(TestContext.CurrentContext.Random.NextUInt()); + ulong rnd1 = (uint)BitConverter.SingleToInt32Bits((int)Random.Shared.NextUInt()); + ulong rnd2 = (uint)BitConverter.SingleToInt32Bits(Random.Shared.NextUInt()); ulong rnd3 = GenNormalS(); ulong rnd4 = GenSubnormalS(); @@ -491,9 +499,9 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { ulong rnd1 = (uint)BitConverter.SingleToInt32Bits( - (int)TestContext.CurrentContext.Random.NextUInt()); + (int)Random.Shared.NextUInt()); ulong rnd2 = (uint)BitConverter.SingleToInt32Bits( - TestContext.CurrentContext.Random.NextUInt()); + Random.Shared.NextUInt()); ulong rnd3 = GenNormalS(); ulong rnd4 = GenSubnormalS(); @@ -594,9 +602,9 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { ulong rnd1 = (ulong)BitConverter.DoubleToInt64Bits( - (long)TestContext.CurrentContext.Random.NextULong()); + (long)Random.Shared.NextULong()); ulong rnd2 = (ulong)BitConverter.DoubleToInt64Bits( - TestContext.CurrentContext.Random.NextULong()); + Random.Shared.NextULong()); ulong rnd3 = GenNormalD(); ulong rnd4 = GenSubnormalD(); @@ -1252,11 +1260,12 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Test, Pairwise, Description("ABS , ")] - public void Abs_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "ABS , ")] + [PairwiseData] + public void Abs_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x5EE0B800; // ABS D0, D0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1269,12 +1278,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ABS ., .")] - public void Abs_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "ABS ., .")] + [PairwiseData] + public void Abs_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E20B800; // ABS V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1288,12 +1298,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ABS ., .")] - public void Abs_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "ABS ., .")] + [PairwiseData] + public void Abs_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E20B800; // ABS V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1307,11 +1318,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDP , .")] - public void Addp_S_2DD([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "ADDP , .")] + [PairwiseData] + public void Addp_S_2DD([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x5EF1B800; // ADDP D0, V0.2D opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1324,13 +1336,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Add_Max_Min_V_V_8BB_4HH([ValueSource(nameof(_SU_Add_Max_Min_V_V_8BB_4HH_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H_))] ulong z, - [ValueSource(nameof(_8B4H_))] ulong a, - [Values(0b00u, 0b01u)] uint size) // <8BB, 4HH> + [SkippableTheory] + [PairwiseData] + public void SU_Add_Max_Min_V_V_8BB_4HH([CombinatorialMemberData(nameof(_SU_Add_Max_Min_V_V_8BB_4HH_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H_))] ulong a, + [CombinatorialValues(0b00u, 0b01u)] uint size) // <8BB, 4HH> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -1343,13 +1356,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Add_Max_Min_V_V_16BB_8HH_4SS([ValueSource(nameof(_SU_Add_Max_Min_V_V_16BB_8HH_4SS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16BB, 8HH, 4SS> + [SkippableTheory] + [PairwiseData] + public void SU_Add_Max_Min_V_V_16BB_8HH_4SS([CombinatorialMemberData(nameof(_SU_Add_Max_Min_V_V_16BB_8HH_4SS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16BB, 8HH, 4SS> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -1362,12 +1376,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CLS ., .")] - public void Cls_V_8B_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenLeadingSigns8B_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <8B, 16B> + [SkippableTheory(DisplayName = "CLS ., .")] + [PairwiseData] + public void Cls_V_8B_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenLeadingSigns8B_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { uint opcode = 0x0E204800; // CLS V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1381,12 +1396,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CLS ., .")] - public void Cls_V_4H_8H([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenLeadingSigns4H_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory(DisplayName = "CLS ., .")] + [PairwiseData] + public void Cls_V_4H_8H([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenLeadingSigns4H_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint opcode = 0x0E604800; // CLS V0.4H, V0.4H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1400,12 +1416,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CLS ., .")] - public void Cls_V_2S_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenLeadingSigns2S_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory(DisplayName = "CLS ., .")] + [PairwiseData] + public void Cls_V_2S_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenLeadingSigns2S_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint opcode = 0x0EA04800; // CLS V0.2S, V0.2S opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1419,12 +1436,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CLZ ., .")] - public void Clz_V_8B_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenLeadingZeros8B_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <8B, 16B> + [SkippableTheory(DisplayName = "CLZ ., .")] + [PairwiseData] + public void Clz_V_8B_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenLeadingZeros8B_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { uint opcode = 0x2E204800; // CLZ V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1438,12 +1456,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CLZ ., .")] - public void Clz_V_4H_8H([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenLeadingZeros4H_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory(DisplayName = "CLZ ., .")] + [PairwiseData] + public void Clz_V_4H_8H([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenLeadingZeros4H_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint opcode = 0x2E604800; // CLZ V0.4H, V0.4H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1457,12 +1476,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CLZ ., .")] - public void Clz_V_2S_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenLeadingZeros2S_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory(DisplayName = "CLZ ., .")] + [PairwiseData] + public void Clz_V_2S_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenLeadingZeros2S_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint opcode = 0x2EA04800; // CLZ V0.2S, V0.2S opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1476,11 +1496,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMEQ , , #0")] - public void Cmeq_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "CMEQ , , #0")] + [PairwiseData] + public void Cmeq_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x5EE09800; // CMEQ D0, D0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1493,12 +1514,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMEQ ., ., #0")] - public void Cmeq_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMEQ ., ., #0")] + [PairwiseData] + public void Cmeq_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E209800; // CMEQ V0.8B, V0.8B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1512,12 +1534,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMEQ ., ., #0")] - public void Cmeq_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMEQ ., ., #0")] + [PairwiseData] + public void Cmeq_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E209800; // CMEQ V0.16B, V0.16B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1531,11 +1554,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGE , , #0")] - public void Cmge_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "CMGE , , #0")] + [PairwiseData] + public void Cmge_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x7EE08800; // CMGE D0, D0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1548,12 +1572,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGE ., ., #0")] - public void Cmge_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMGE ., ., #0")] + [PairwiseData] + public void Cmge_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E208800; // CMGE V0.8B, V0.8B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1567,12 +1592,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGE ., ., #0")] - public void Cmge_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMGE ., ., #0")] + [PairwiseData] + public void Cmge_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E208800; // CMGE V0.16B, V0.16B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1586,11 +1612,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGT , , #0")] - public void Cmgt_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "CMGT , , #0")] + [PairwiseData] + public void Cmgt_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x5EE08800; // CMGT D0, D0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1603,12 +1630,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGT ., ., #0")] - public void Cmgt_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMGT ., ., #0")] + [PairwiseData] + public void Cmgt_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E208800; // CMGT V0.8B, V0.8B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1622,12 +1650,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGT ., ., #0")] - public void Cmgt_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMGT ., ., #0")] + [PairwiseData] + public void Cmgt_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E208800; // CMGT V0.16B, V0.16B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1641,11 +1670,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMLE , , #0")] - public void Cmle_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "CMLE , , #0")] + [PairwiseData] + public void Cmle_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x7EE09800; // CMLE D0, D0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1658,12 +1688,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMLE ., ., #0")] - public void Cmle_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMLE ., ., #0")] + [PairwiseData] + public void Cmle_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E209800; // CMLE V0.8B, V0.8B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1677,12 +1708,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMLE ., ., #0")] - public void Cmle_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMLE ., ., #0")] + [PairwiseData] + public void Cmle_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E209800; // CMLE V0.16B, V0.16B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1696,11 +1728,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMLT , , #0")] - public void Cmlt_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "CMLT , , #0")] + [PairwiseData] + public void Cmlt_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x5EE0A800; // CMLT D0, D0, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1713,12 +1746,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMLT ., ., #0")] - public void Cmlt_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMLT ., ., #0")] + [PairwiseData] + public void Cmlt_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E20A800; // CMLT V0.8B, V0.8B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1732,12 +1766,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMLT ., ., #0")] - public void Cmlt_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMLT ., ., #0")] + [PairwiseData] + public void Cmlt_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E20A800; // CMLT V0.16B, V0.16B, #0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1751,11 +1786,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CNT ., .")] - public void Cnt_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenPopCnt8B_))] ulong a) + [SkippableTheory(DisplayName = "CNT ., .")] + [PairwiseData] + public void Cnt_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenPopCnt8B_))] ulong a) { uint opcode = 0x0E205800; // CNT V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1768,11 +1804,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CNT ., .")] - public void Cnt_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))][Random(RndCnt)] ulong z, - [ValueSource(nameof(_GenPopCnt8B_))] ulong a) + [SkippableTheory(DisplayName = "CNT ., .")] + [PairwiseData] + public void Cnt_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))][CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialMemberData(nameof(_GenPopCnt8B_))] ulong a) { uint opcode = 0x4E205800; // CNT V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1785,16 +1822,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Abs_Neg_Recpx_Sqrt_S_S([ValueSource(nameof(_F_Abs_Neg_Recpx_Sqrt_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Abs_Neg_Recpx_Sqrt_S_S([CombinatorialMemberData(nameof(_F_Abs_Neg_Recpx_Sqrt_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1804,16 +1841,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Abs_Neg_Recpx_Sqrt_S_D([ValueSource(nameof(_F_Abs_Neg_Recpx_Sqrt_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Abs_Neg_Recpx_Sqrt_S_D([CombinatorialMemberData(nameof(_F_Abs_Neg_Recpx_Sqrt_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1823,14 +1860,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Abs_Neg_Sqrt_V_2S_4S([ValueSource(nameof(_F_Abs_Neg_Sqrt_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Abs_Neg_Sqrt_V_2S_4S([CombinatorialMemberData(nameof(_F_Abs_Neg_Sqrt_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -1838,7 +1875,7 @@ namespace Ryujinx.Tests.Cpu V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, a * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1848,20 +1885,20 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Abs_Neg_Sqrt_V_2D([ValueSource(nameof(_F_Abs_Neg_Sqrt_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Abs_Neg_Sqrt_V_2D([CombinatorialMemberData(nameof(_F_Abs_Neg_Sqrt_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_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 rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1871,17 +1908,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Add_Max_Min_Nm_P_S_2SS([ValueSource(nameof(_F_Add_Max_Min_Nm_P_S_2SS_))] uint opcodes, - [ValueSource(nameof(_2S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Add_Max_Min_Nm_P_S_2SS([CombinatorialMemberData(nameof(_F_Add_Max_Min_Nm_P_S_2SS_))] uint opcodes, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, z); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1891,18 +1928,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Add_Max_Min_Nm_P_S_2DD([ValueSource(nameof(_F_Add_Max_Min_Nm_P_S_2DD_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a0, - [ValueSource(nameof(_1D_F_))] ulong a1) + [SkippableTheory] + [PairwiseData] + public void F_Add_Max_Min_Nm_P_S_2DD([CombinatorialMemberData(nameof(_F_Add_Max_Min_Nm_P_S_2DD_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a0, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a1) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a0, a1); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1912,16 +1949,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Cm_EqGeGtLeLt_S_S([ValueSource(nameof(_F_Cm_EqGeGtLeLt_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cm_EqGeGtLeLt_S_S([CombinatorialMemberData(nameof(_F_Cm_EqGeGtLeLt_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1930,16 +1967,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Cm_EqGeGtLeLt_S_D([ValueSource(nameof(_F_Cm_EqGeGtLeLt_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cm_EqGeGtLeLt_S_D([CombinatorialMemberData(nameof(_F_Cm_EqGeGtLeLt_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1948,14 +1985,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Cm_EqGeGtLeLt_V_2S_4S([ValueSource(nameof(_F_Cm_EqGeGtLeLt_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Cm_EqGeGtLeLt_V_2S_4S([CombinatorialMemberData(nameof(_F_Cm_EqGeGtLeLt_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -1963,7 +2000,7 @@ namespace Ryujinx.Tests.Cpu V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, a * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1972,20 +2009,20 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Cm_EqGeGtLeLt_V_2D([ValueSource(nameof(_F_Cm_EqGeGtLeLt_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cm_EqGeGtLeLt_V_2D([CombinatorialMemberData(nameof(_F_Cm_EqGeGtLeLt_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_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 rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1994,46 +2031,46 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Cmp_Cmpe_S_S([ValueSource(nameof(_F_Cmp_Cmpe_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cmp_Cmpe_S_S([CombinatorialMemberData(nameof(_F_Cmp_Cmpe_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a) { V128 v1 = MakeVectorE0(a); - bool v = TestContext.CurrentContext.Random.NextBool(); - bool c = TestContext.CurrentContext.Random.NextBool(); - bool z = TestContext.CurrentContext.Random.NextBool(); - bool n = TestContext.CurrentContext.Random.NextBool(); + bool v = Random.Shared.NextBool(); + bool c = Random.Shared.NextBool(); + bool z = Random.Shared.NextBool(); + bool n = Random.Shared.NextBool(); SingleOpcode(opcodes, v1: v1, overflow: v, carry: c, zero: z, negative: n); CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc); } - [Test, Pairwise] - [Explicit] - public void F_Cmp_Cmpe_S_D([ValueSource(nameof(_F_Cmp_Cmpe_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cmp_Cmpe_S_D([CombinatorialMemberData(nameof(_F_Cmp_Cmpe_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { V128 v1 = MakeVectorE0(a); - bool v = TestContext.CurrentContext.Random.NextBool(); - bool c = TestContext.CurrentContext.Random.NextBool(); - bool z = TestContext.CurrentContext.Random.NextBool(); - bool n = TestContext.CurrentContext.Random.NextBool(); + bool v = Random.Shared.NextBool(); + bool c = Random.Shared.NextBool(); + bool z = Random.Shared.NextBool(); + bool n = Random.Shared.NextBool(); SingleOpcode(opcodes, v1: v1, overflow: v, carry: c, zero: z, negative: n); CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_S_SD([ValueSource(nameof(_F_Cvt_S_SD_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_S_SD([CombinatorialMemberData(nameof(_F_Cvt_S_SD_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); @@ -2042,12 +2079,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_S_DS([ValueSource(nameof(_F_Cvt_S_DS_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_S_DS([CombinatorialMemberData(nameof(_F_Cvt_S_DS_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2057,13 +2094,13 @@ namespace Ryujinx.Tests.Cpu } // Unicorn seems to default all rounding modes to RMode.Rn. - [Test, Pairwise] - [Explicit] - public void F_Cvt_S_SH([ValueSource(nameof(_F_Cvt_S_SH_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_S_SH([CombinatorialMemberData(nameof(_F_Cvt_S_SH_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialValues(RMode.Rn)] RMode rMode) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2074,13 +2111,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_S_DH([ValueSource(nameof(_F_Cvt_S_DH_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_S_DH([CombinatorialMemberData(nameof(_F_Cvt_S_DH_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialValues(RMode.Rn)] RMode rMode) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2091,12 +2128,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_S_HS([ValueSource(nameof(_F_Cvt_S_HS_))] uint opcodes, - [ValueSource(nameof(_1H_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_S_HS([CombinatorialMemberData(nameof(_F_Cvt_S_HS_))] uint opcodes, + [CombinatorialMemberData(nameof(_1H_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2105,12 +2142,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_S_HD([ValueSource(nameof(_F_Cvt_S_HD_))] uint opcodes, - [ValueSource(nameof(_1H_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_S_HD([CombinatorialMemberData(nameof(_F_Cvt_S_HD_))] uint opcodes, + [CombinatorialMemberData(nameof(_1H_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2119,12 +2156,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_ANZ_SU_S_S([ValueSource(nameof(_F_Cvt_ANZ_SU_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_W_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_ANZ_SU_S_S([CombinatorialMemberData(nameof(_F_Cvt_ANZ_SU_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_W_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2133,12 +2170,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_ANZ_SU_S_D([ValueSource(nameof(_F_Cvt_ANZ_SU_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_X_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_ANZ_SU_S_D([CombinatorialMemberData(nameof(_F_Cvt_ANZ_SU_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_X_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); @@ -2147,14 +2184,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_ANZ_SU_V_2S_4S([ValueSource(nameof(_F_Cvt_ANZ_SU_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_W_))] ulong z, - [ValueSource(nameof(_2S_F_W_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Cvt_ANZ_SU_V_2S_4S([CombinatorialMemberData(nameof(_F_Cvt_ANZ_SU_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_W_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_W_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2167,13 +2204,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_ANZ_SU_V_2D([ValueSource(nameof(_F_Cvt_ANZ_SU_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_X_))] ulong z, - [ValueSource(nameof(_1D_F_X_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_ANZ_SU_V_2D([CombinatorialMemberData(nameof(_F_Cvt_ANZ_SU_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_X_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_X_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2185,15 +2222,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvtl_V_4H4S_8H4S([ValueSource(nameof(_F_Cvtl_V_4H4S_8H4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_F_))] ulong z, - [ValueSource(nameof(_4H_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q, // <4H4S, 8H4S> - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Cvtl_V_4H4S_8H4S([CombinatorialMemberData(nameof(_F_Cvtl_V_4H4S_8H4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_F_))] ulong z, + [CombinatorialMemberData(nameof(_4H_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q, // <4H4S, 8H4S> + [CombinatorialValues(RMode.Rn)] RMode rMode) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2201,7 +2238,7 @@ namespace Ryujinx.Tests.Cpu V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(q == 0u ? a : 0ul, q == 1u ? a : 0ul); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = (int)rMode << (int)Fpcr.RMode; fpcr |= rnd & (1 << (int)Fpcr.Fz); @@ -2213,14 +2250,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Ofc | Fpsr.Ufc | Fpsr.Ixc); } - [Test, Pairwise] - [Explicit] - public void F_Cvtl_V_2S2D_4S2D([ValueSource(nameof(_F_Cvtl_V_2S2D_4S2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S2D, 4S2D> + [SkippableTheory] + [PairwiseData] + public void F_Cvtl_V_2S2D_4S2D([CombinatorialMemberData(nameof(_F_Cvtl_V_2S2D_4S2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S2D, 4S2D> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2234,15 +2271,15 @@ namespace Ryujinx.Tests.Cpu } // Unicorn seems to default all rounding modes to RMode.Rn. - [Test, Pairwise] - [Explicit] - public void F_Cvtn_V_4S4H_4S8H([ValueSource(nameof(_F_Cvtn_V_4S4H_4S8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q, // <4S4H, 4S8H> - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Cvtn_V_4S4H_4S8H([CombinatorialMemberData(nameof(_F_Cvtn_V_4S4H_4S8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q, // <4S4H, 4S8H> + [CombinatorialValues(RMode.Rn)] RMode rMode) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2250,7 +2287,7 @@ namespace Ryujinx.Tests.Cpu V128 v0 = MakeVectorE0E1(z, a); V128 v1 = MakeVectorE0E1(a, z); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = (int)rMode << (int)Fpcr.RMode; fpcr |= rnd & (1 << (int)Fpcr.Fz); @@ -2262,14 +2299,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Ofc | Fpsr.Ufc | Fpsr.Ixc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Cvtn_V_2D2S_2D4S([ValueSource(nameof(_F_Cvtn_V_2D2S_2D4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2D2S, 2D4S> + [SkippableTheory] + [PairwiseData] + public void F_Cvtn_V_2D2S_2D4S([CombinatorialMemberData(nameof(_F_Cvtn_V_2D2S_2D4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2D2S, 2D4S> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2282,20 +2319,20 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Max_Min_Nm_V_V_4SS([ValueSource(nameof(_F_Max_Min_Nm_V_V_4SS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Max_Min_Nm_V_V_4SS([CombinatorialMemberData(nameof(_F_Max_Min_Nm_V_V_4SS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_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 rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -2305,17 +2342,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Ftoi_SW([ValueSource(nameof(_F_Mov_Ftoi_SW_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Ftoi_SW([CombinatorialMemberData(nameof(_F_Mov_Ftoi_SW_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x0: x0, x31: w31, v1: v1); @@ -2323,16 +2360,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Ftoi_DX([ValueSource(nameof(_F_Mov_Ftoi_DX_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Ftoi_DX([CombinatorialMemberData(nameof(_F_Mov_Ftoi_DX_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x31: x31, v1: v1); @@ -2340,16 +2377,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Ftoi1_DX([ValueSource(nameof(_F_Mov_Ftoi1_DX_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Ftoi1_DX([CombinatorialMemberData(nameof(_F_Mov_Ftoi1_DX_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE1(a); SingleOpcode(opcodes, x31: x31, v1: v1); @@ -2357,17 +2394,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Itof_WS([ValueSource(nameof(_F_Mov_Itof_WS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_W_))] uint wn) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Itof_WS([CombinatorialMemberData(nameof(_F_Mov_Itof_WS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_W_))] uint wn) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + uint w31 = Random.Shared.NextUInt(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcodes, x1: wn, x31: w31, v0: v0); @@ -2375,17 +2412,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Itof_XD([ValueSource(nameof(_F_Mov_Itof_XD_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_X_))] ulong xn) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Itof_XD([CombinatorialMemberData(nameof(_F_Mov_Itof_XD_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_X_))] ulong xn) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, x1: xn, x31: x31, v0: v0); @@ -2393,17 +2430,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Itof1_XD([ValueSource(nameof(_F_Mov_Itof1_XD_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_X_))] ulong xn) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Itof1_XD([CombinatorialMemberData(nameof(_F_Mov_Itof1_XD_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_X_))] ulong xn) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0(z); SingleOpcode(opcodes, x1: xn, x31: x31, v0: v0); @@ -2411,12 +2448,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_S_S([ValueSource(nameof(_F_Mov_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Mov_S_S([CombinatorialMemberData(nameof(_F_Mov_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2425,12 +2462,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_S_D([ValueSource(nameof(_F_Mov_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Mov_S_D([CombinatorialMemberData(nameof(_F_Mov_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); @@ -2439,17 +2476,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Recpe_Rsqrte_S_S([ValueSource(nameof(_F_Recpe_Rsqrte_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Recpe_Rsqrte_S_S([CombinatorialMemberData(nameof(_F_Recpe_Rsqrte_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialValues(RMode.Rn)] RMode rMode) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = (int)rMode << (int)Fpcr.RMode; fpcr |= rnd & (1 << (int)Fpcr.Fz); @@ -2460,17 +2497,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Ofc | Fpsr.Ufc | Fpsr.Ixc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Recpe_Rsqrte_S_D([ValueSource(nameof(_F_Recpe_Rsqrte_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Recpe_Rsqrte_S_D([CombinatorialMemberData(nameof(_F_Recpe_Rsqrte_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialValues(RMode.Rn)] RMode rMode) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = (int)rMode << (int)Fpcr.RMode; fpcr |= rnd & (1 << (int)Fpcr.Fz); @@ -2481,15 +2518,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Ofc | Fpsr.Ufc | Fpsr.Ixc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Recpe_Rsqrte_V_2S_4S([ValueSource(nameof(_F_Recpe_Rsqrte_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q, // <2S, 4S> - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Recpe_Rsqrte_V_2S_4S([CombinatorialMemberData(nameof(_F_Recpe_Rsqrte_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q, // <2S, 4S> + [CombinatorialValues(RMode.Rn)] RMode rMode) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2497,7 +2534,7 @@ namespace Ryujinx.Tests.Cpu V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, a * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = (int)rMode << (int)Fpcr.RMode; fpcr |= rnd & (1 << (int)Fpcr.Fz); @@ -2508,21 +2545,21 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Ofc | Fpsr.Ufc | Fpsr.Ixc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Recpe_Rsqrte_V_2D([ValueSource(nameof(_F_Recpe_Rsqrte_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [Values(RMode.Rn)] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Recpe_Rsqrte_V_2D([CombinatorialMemberData(nameof(_F_Recpe_Rsqrte_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialValues(RMode.Rn)] RMode rMode) { 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 rnd = (int)Random.Shared.NextUInt(); int fpcr = (int)rMode << (int)Fpcr.RMode; fpcr |= rnd & (1 << (int)Fpcr.Fz); @@ -2533,12 +2570,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Ofc | Fpsr.Ufc | Fpsr.Ixc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Rint_AMNPZ_S_S([ValueSource(nameof(_F_Rint_AMNPZ_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Rint_AMNPZ_S_S([CombinatorialMemberData(nameof(_F_Rint_AMNPZ_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2547,12 +2584,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Rint_AMNPZ_S_D([ValueSource(nameof(_F_Rint_AMNPZ_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Rint_AMNPZ_S_D([CombinatorialMemberData(nameof(_F_Rint_AMNPZ_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); @@ -2561,14 +2598,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Rint_AMNPZ_V_2S_4S([ValueSource(nameof(_F_Rint_AMNPZ_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Rint_AMNPZ_V_2S_4S([CombinatorialMemberData(nameof(_F_Rint_AMNPZ_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2581,13 +2618,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Rint_AMNPZ_V_2D([ValueSource(nameof(_F_Rint_AMNPZ_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Rint_AMNPZ_V_2D([CombinatorialMemberData(nameof(_F_Rint_AMNPZ_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2599,13 +2636,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Rint_IX_S_S([ValueSource(nameof(_F_Rint_IX_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [Values] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Rint_IX_S_S([CombinatorialMemberData(nameof(_F_Rint_IX_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + RMode rMode) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -2616,13 +2653,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Rint_IX_S_D([ValueSource(nameof(_F_Rint_IX_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [Values] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Rint_IX_S_D([CombinatorialMemberData(nameof(_F_Rint_IX_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + RMode rMode) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); @@ -2633,15 +2670,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Rint_IX_V_2S_4S([ValueSource(nameof(_F_Rint_IX_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [Values(0b0u, 0b1u)] uint q, // <2S, 4S> - [Values] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Rint_IX_V_2S_4S([CombinatorialMemberData(nameof(_F_Rint_IX_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q, // <2S, 4S> + RMode rMode) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -2656,14 +2693,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Rint_IX_V_2D([ValueSource(nameof(_F_Rint_IX_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [Values] RMode rMode) + [SkippableTheory] + [PairwiseData] + public void F_Rint_IX_V_2D([CombinatorialMemberData(nameof(_F_Rint_IX_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + RMode rMode) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2677,11 +2714,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("NEG , ")] - public void Neg_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory(DisplayName = "NEG , ")] + [PairwiseData] + public void Neg_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { uint opcode = 0x7EE0B800; // NEG D0, D0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2694,12 +2732,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("NEG ., .")] - public void Neg_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "NEG ., .")] + [PairwiseData] + public void Neg_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E20B800; // NEG V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2713,12 +2752,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("NEG ., .")] - public void Neg_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "NEG ., .")] + [PairwiseData] + public void Neg_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E20B800; // NEG V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2732,11 +2772,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("NOT ., .")] - public void Not_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a) + [SkippableTheory(DisplayName = "NOT ., .")] + [PairwiseData] + public void Not_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a) { uint opcode = 0x2E205800; // NOT V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2749,11 +2790,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("NOT ., .")] - public void Not_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a) + [SkippableTheory(DisplayName = "NOT ., .")] + [PairwiseData] + public void Not_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a) { uint opcode = 0x6E205800; // NOT V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2766,11 +2808,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("RBIT ., .")] - public void Rbit_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a) + [SkippableTheory(DisplayName = "RBIT ., .")] + [PairwiseData] + public void Rbit_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a) { uint opcode = 0x2E605800; // RBIT V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2783,11 +2826,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("RBIT ., .")] - public void Rbit_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a) + [SkippableTheory(DisplayName = "RBIT ., .")] + [PairwiseData] + public void Rbit_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a) { uint opcode = 0x6E605800; // RBIT V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2800,11 +2844,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("REV16 ., .")] - public void Rev16_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a) + [SkippableTheory(DisplayName = "REV16 ., .")] + [PairwiseData] + public void Rev16_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a) { uint opcode = 0x0E201800; // REV16 V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2817,11 +2862,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("REV16 ., .")] - public void Rev16_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a) + [SkippableTheory(DisplayName = "REV16 ., .")] + [PairwiseData] + public void Rev16_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a) { uint opcode = 0x4E201800; // REV16 V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2834,12 +2880,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("REV32 ., .")] - public void Rev32_V_8B_4H([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H_))] ulong z, - [ValueSource(nameof(_8B4H_))] ulong a, - [Values(0b00u, 0b01u)] uint size) // <8B, 4H> + [SkippableTheory(DisplayName = "REV32 ., .")] + [PairwiseData] + public void Rev32_V_8B_4H([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H_))] ulong a, + [CombinatorialValues(0b00u, 0b01u)] uint size) // <8B, 4H> { uint opcode = 0x2E200800; // REV32 V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2853,12 +2900,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("REV32 ., .")] - public void Rev32_V_16B_8H([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H_))] ulong z, - [ValueSource(nameof(_8B4H_))] ulong a, - [Values(0b00u, 0b01u)] uint size) // <16B, 8H> + [SkippableTheory(DisplayName = "REV32 ., .")] + [PairwiseData] + public void Rev32_V_16B_8H([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H_))] ulong a, + [CombinatorialValues(0b00u, 0b01u)] uint size) // <16B, 8H> { uint opcode = 0x6E200800; // REV32 V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2872,12 +2920,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("REV64 ., .")] - public void Rev64_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "REV64 ., .")] + [PairwiseData] + public void Rev64_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E200800; // REV64 V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2891,12 +2940,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("REV64 ., .")] - public void Rev64_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "REV64 ., .")] + [PairwiseData] + public void Rev64_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x4E200800; // REV64 V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2910,12 +2960,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADALP ., .")] - public void Sadalp_V_8B4H_4H2S_2S1D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> + [SkippableTheory(DisplayName = "SADALP ., .")] + [PairwiseData] + public void Sadalp_V_8B4H_4H2S_2S1D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> { uint opcode = 0x0E206800; // SADALP V0.4H, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2929,12 +2980,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADALP ., .")] - public void Sadalp_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "SADALP ., .")] + [PairwiseData] + public void Sadalp_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x4E206800; // SADALP V0.8H, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2948,12 +3000,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADDLP ., .")] - public void Saddlp_V_8B4H_4H2S_2S1D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> + [SkippableTheory(DisplayName = "SADDLP ., .")] + [PairwiseData] + public void Saddlp_V_8B4H_4H2S_2S1D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> { uint opcode = 0x0E202800; // SADDLP V0.4H, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2967,12 +3020,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADDLP ., .")] - public void Saddlp_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "SADDLP ., .")] + [PairwiseData] + public void Saddlp_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x4E202800; // SADDLP V0.8H, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2986,13 +3040,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Addl_V_V_8BH_4HS([ValueSource(nameof(_SU_Addl_V_V_8BH_4HS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H_))] ulong z, - [ValueSource(nameof(_8B4H_))] ulong a, - [Values(0b00u, 0b01u)] uint size) // <8BH, 4HS> + [SkippableTheory] + [PairwiseData] + public void SU_Addl_V_V_8BH_4HS([CombinatorialMemberData(nameof(_SU_Addl_V_V_8BH_4HS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H_))] ulong a, + [CombinatorialValues(0b00u, 0b01u)] uint size) // <8BH, 4HS> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -3005,13 +3060,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Addl_V_V_16BH_8HS_4SD([ValueSource(nameof(_SU_Addl_V_V_16BH_8HS_4SD_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16BH, 8HS, 4SD> + [SkippableTheory] + [PairwiseData] + public void SU_Addl_V_V_16BH_8HS_4SD([CombinatorialMemberData(nameof(_SU_Addl_V_V_16BH_8HS_4SD_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16BH, 8HS, 4SD> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -3024,12 +3080,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_S_S([ValueSource(nameof(_SU_Cvt_F_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_S_S([CombinatorialMemberData(nameof(_SU_Cvt_F_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -3038,12 +3094,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_S_D([ValueSource(nameof(_SU_Cvt_F_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_S_D([CombinatorialMemberData(nameof(_SU_Cvt_F_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); @@ -3052,14 +3108,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_V_2S_4S([ValueSource(nameof(_SU_Cvt_F_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_V_2S_4S([CombinatorialMemberData(nameof(_SU_Cvt_F_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -3072,13 +3128,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_V_2D([ValueSource(nameof(_SU_Cvt_F_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_V_2D([CombinatorialMemberData(nameof(_SU_Cvt_F_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3090,12 +3146,30 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Sha1h_Sha1su1_V([ValueSource(nameof(_Sha1h_Sha1su1_V_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Random(RndCnt / 2)] ulong z0, [Random(RndCnt / 2)] ulong z1, - [Random(RndCnt / 2)] ulong a0, [Random(RndCnt / 2)] ulong a1) + public static readonly ulong[] RandomZ0 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomZ1 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomA0 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomA1 = + { + Random.Shared.NextULong(), + }; + + [SkippableTheory] + [PairwiseData] + public void Sha1h_Sha1su1_V([CombinatorialMemberData(nameof(_Sha1h_Sha1su1_V_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(RandomZ0))] ulong z0, [CombinatorialMemberData(nameof(RandomZ1))] ulong z1, + [CombinatorialMemberData(nameof(RandomA0))] ulong a0, [CombinatorialMemberData(nameof(RandomA1))] ulong a1) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3107,12 +3181,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Sha256su0_V([ValueSource(nameof(_Sha256su0_V_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Random(RndCnt / 2)] ulong z0, [Random(RndCnt / 2)] ulong z1, - [Random(RndCnt / 2)] ulong a0, [Random(RndCnt / 2)] ulong a1) + [SkippableTheory] + [PairwiseData] + public void Sha256su0_V([CombinatorialMemberData(nameof(_Sha256su0_V_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(RandomZ0))] ulong z0, [CombinatorialMemberData(nameof(RandomZ1))] ulong z1, + [CombinatorialMemberData(nameof(RandomA0))] ulong a0, [CombinatorialMemberData(nameof(RandomA1))] ulong a1) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3124,13 +3199,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SHLL{2} ., ., #")] - public void Shll_V([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size, // - [Values(0b0u, 0b1u)] uint q) + [SkippableTheory(DisplayName = "SHLL{2} ., ., #")] + [PairwiseData] + public void Shll_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size, // + [CombinatorialValues(0b0u, 0b1u)] uint q) { uint opcode = 0x2E213800; // SHLL V0.8H, V0.8B, #8 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3145,12 +3221,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SQABS , ")] - public void Sqabs_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "SQABS , ")] + [PairwiseData] + public void Sqabs_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x5E207800; // SQABS B0, B0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3164,12 +3241,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQABS ., .")] - public void Sqabs_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SQABS ., .")] + [PairwiseData] + public void Sqabs_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E207800; // SQABS V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3183,12 +3261,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQABS ., .")] - public void Sqabs_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "SQABS ., .")] + [PairwiseData] + public void Sqabs_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E207800; // SQABS V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3202,12 +3281,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQNEG , ")] - public void Sqneg_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "SQNEG , ")] + [PairwiseData] + public void Sqneg_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x7E207800; // SQNEG B0, B0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3221,12 +3301,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQNEG ., .")] - public void Sqneg_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SQNEG ., .")] + [PairwiseData] + public void Sqneg_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E207800; // SQNEG V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3240,12 +3321,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQNEG ., .")] - public void Sqneg_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "SQNEG ., .")] + [PairwiseData] + public void Sqneg_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E207800; // SQNEG V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3259,12 +3341,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQXTN , ")] - public void Sqxtn_S_HB_SH_DS([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1H1S1D_))] ulong z, - [ValueSource(nameof(_1H1S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // + [SkippableTheory(DisplayName = "SQXTN , ")] + [PairwiseData] + public void Sqxtn_S_HB_SH_DS([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1H1S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // { uint opcode = 0x5E214800; // SQXTN B0, H0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3278,12 +3361,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQXTN{2} ., .")] - public void Sqxtn_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "SQXTN{2} ., .")] + [PairwiseData] + public void Sqxtn_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x0E214800; // SQXTN V0.8B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3297,12 +3381,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQXTN{2} ., .")] - public void Sqxtn_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "SQXTN{2} ., .")] + [PairwiseData] + public void Sqxtn_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x4E214800; // SQXTN2 V0.16B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3316,12 +3401,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQXTUN , ")] - public void Sqxtun_S_HB_SH_DS([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1H1S1D_))] ulong z, - [ValueSource(nameof(_1H1S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // + [SkippableTheory(DisplayName = "SQXTUN , ")] + [PairwiseData] + public void Sqxtun_S_HB_SH_DS([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1H1S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // { uint opcode = 0x7E212800; // SQXTUN B0, H0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3335,12 +3421,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQXTUN{2} ., .")] - public void Sqxtun_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "SQXTUN{2} ., .")] + [PairwiseData] + public void Sqxtun_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x2E212800; // SQXTUN V0.8B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3354,12 +3441,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQXTUN{2} ., .")] - public void Sqxtun_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "SQXTUN{2} ., .")] + [PairwiseData] + public void Sqxtun_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x6E212800; // SQXTUN2 V0.16B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3373,12 +3461,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SUQADD , ")] - public void Suqadd_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "SUQADD , ")] + [PairwiseData] + public void Suqadd_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x5E203800; // SUQADD B0, B0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3392,12 +3481,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SUQADD ., .")] - public void Suqadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SUQADD ., .")] + [PairwiseData] + public void Suqadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E203800; // SUQADD V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3411,12 +3501,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SUQADD ., .")] - public void Suqadd_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "SUQADD ., .")] + [PairwiseData] + public void Suqadd_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E203800; // SUQADD V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3430,12 +3521,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UADALP ., .")] - public void Uadalp_V_8B4H_4H2S_2S1D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> + [SkippableTheory(DisplayName = "UADALP ., .")] + [PairwiseData] + public void Uadalp_V_8B4H_4H2S_2S1D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> { uint opcode = 0x2E206800; // UADALP V0.4H, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3449,12 +3541,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UADALP ., .")] - public void Uadalp_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "UADALP ., .")] + [PairwiseData] + public void Uadalp_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x6E206800; // UADALP V0.8H, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3468,12 +3561,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UADDLP ., .")] - public void Uaddlp_V_8B4H_4H2S_2S1D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> + [SkippableTheory(DisplayName = "UADDLP ., .")] + [PairwiseData] + public void Uaddlp_V_8B4H_4H2S_2S1D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B4H, 4H2S, 2S1D> { uint opcode = 0x2E202800; // UADDLP V0.4H, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3487,12 +3581,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UADDLP ., .")] - public void Uaddlp_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "UADDLP ., .")] + [PairwiseData] + public void Uaddlp_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x6E202800; // UADDLP V0.8H, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3506,12 +3601,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UQXTN , ")] - public void Uqxtn_S_HB_SH_DS([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1H1S1D_))] ulong z, - [ValueSource(nameof(_1H1S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // + [SkippableTheory(DisplayName = "UQXTN , ")] + [PairwiseData] + public void Uqxtn_S_HB_SH_DS([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1H1S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // { uint opcode = 0x7E214800; // UQXTN B0, H0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3525,12 +3621,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UQXTN{2} ., .")] - public void Uqxtn_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "UQXTN{2} ., .")] + [PairwiseData] + public void Uqxtn_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x2E214800; // UQXTN V0.8B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3544,12 +3641,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UQXTN{2} ., .")] - public void Uqxtn_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "UQXTN{2} ., .")] + [PairwiseData] + public void Uqxtn_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x6E214800; // UQXTN2 V0.16B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3563,12 +3661,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("USQADD , ")] - public void Usqadd_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "USQADD , ")] + [PairwiseData] + public void Usqadd_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x7E203800; // USQADD B0, B0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3582,12 +3681,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("USQADD ., .")] - public void Usqadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "USQADD ., .")] + [PairwiseData] + public void Usqadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E203800; // USQADD V0.8B, V0.8B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3601,12 +3701,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("USQADD ., .")] - public void Usqadd_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "USQADD ., .")] + [PairwiseData] + public void Usqadd_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E203800; // USQADD V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3620,12 +3721,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("XTN{2} ., .")] - public void Xtn_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "XTN{2} ., .")] + [PairwiseData] + public void Xtn_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x0E212800; // XTN V0.8B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3639,12 +3741,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("XTN{2} ., .")] - public void Xtn_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "XTN{2} ., .")] + [PairwiseData] + public void Xtn_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x4E212800; // XTN2 V0.16B, V0.8H opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs index dc0059205f..0aa0f0ccba 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimd32.cs @@ -1,12 +1,20 @@ -// #define Simd32 +#define Simd32 +using ARMeilleure.State; +using System; +using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Simd32")] public sealed class CpuTestSimd32 : CpuTest32 { + public CpuTestSimd32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Simd32 #region "ValueSource (Opcodes)" @@ -74,7 +82,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = GenNormalS(); ulong rnd2 = GenSubnormalS(); @@ -181,16 +189,17 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Test, Pairwise, Description("SHA256SU0.32 , ")] - public void Sha256su0_V([Values(0xF3BA03C0u)] uint opcode, - [Values(0u)] uint rd, - [Values(2u)] uint rm, - [Values(0x9BCBBF7443FB4F91ul)] ulong z0, - [Values(0x482C58A58CBCBD59ul)] ulong z1, - [Values(0xA0099B803625F82Aul)] ulong a0, - [Values(0x1AA3B0B4E1AB4C8Cul)] ulong a1, - [Values(0x29A44D72598F15F3ul)] ulong resultL, - [Values(0x74CED221E2793F07ul)] ulong resultH) + [Theory(DisplayName = "SHA256SU0.32 , ")] + [PairwiseData] + public void Sha256su0_V([CombinatorialValues(0xF3BA03C0u)] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u)] uint rm, + [CombinatorialValues(0x9BCBBF7443FB4F91ul)] ulong z0, + [CombinatorialValues(0x482C58A58CBCBD59ul)] ulong z1, + [CombinatorialValues(0xA0099B803625F82Aul)] ulong a0, + [CombinatorialValues(0x1AA3B0B4E1AB4C8Cul)] ulong a1, + [CombinatorialValues(0x29A44D72598F15F3ul)] ulong resultL, + [CombinatorialValues(0x74CED221E2793F07ul)] ulong resultH) { opcode |= ((rd & 0xf) << 12) | ((rd & 0x10) << 18); opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); @@ -202,22 +211,23 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); // Unicorn does not yet support hash instructions in A32. // CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vabs_Vneg_Vpaddl_V_I([ValueSource(nameof(_Vabs_Vneg_Vpaddl_I_))] uint opcode, - [Range(0u, 3u)] uint rd, - [Range(0u, 3u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0u, 1u, 2u)] uint size, // - [Values] bool q) + [Theory] + [PairwiseData] + public void Vabs_Vneg_Vpaddl_V_I([CombinatorialMemberData(nameof(_Vabs_Vneg_Vpaddl_I_))] uint opcode, + [CombinatorialRange(0u, 3u, 1u)] uint rd, + [CombinatorialRange(0u, 3u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0u, 1u, 2u)] uint size, // + bool q) { if (q) { @@ -242,13 +252,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vabs_Vneg_V_F32([ValueSource(nameof(_Vabs_Vneg_F_))] uint opcode, - [Range(0u, 3u)] uint rd, - [Range(0u, 3u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vabs_Vneg_V_F32([CombinatorialMemberData(nameof(_Vabs_Vneg_F_))] uint opcode, + [CombinatorialRange(0u, 3u, 1u)] uint rd, + [CombinatorialRange(0u, 3u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + bool q) { if (q) { @@ -271,11 +282,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VCNT.8 D0, D0 | VCNT.8 Q0, Q0")] - public void Vcnt([Values(0u, 1u)] uint rd, - [Values(0u, 1u)] uint rm, - [ValueSource(nameof(_GenPopCnt8B_))] ulong d0, - [Values] bool q) + [Theory(DisplayName = "VCNT.8 D0, D0 | VCNT.8 Q0, Q0")] + [PairwiseData] + public void Vcnt([CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_GenPopCnt8B_))] ulong d0, + bool q) { ulong d1 = ~d0; // It's expensive to have a second generator. @@ -299,13 +311,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vmovn_V([Range(0u, 3u)] uint rd, - [Range(0u, 3u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0u, 1u, 2u, 3u)] uint op, - [Values(0u, 1u, 2u)] uint size) // + [Theory] + [PairwiseData] + public void Vmovn_V([CombinatorialRange(0u, 3u, 1u)] uint rd, + [CombinatorialRange(0u, 3u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint op, + [CombinatorialValues(0u, 1u, 2u)] uint size) // { rm >>= 1; rm <<= 1; diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto.cs index 76b709c5d8..705a75ae3a 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto.cs @@ -1,21 +1,42 @@ -// #define SimdCrypto +#define SimdCrypto // https://www.intel.com/content/dam/doc/white-paper/advanced-encryption-standard-new-instructions-set-paper.pdf +using ARMeilleure.State; +using System; +using Xunit; +using Xunit.Abstractions; + namespace Ryujinx.Tests.Cpu { public class CpuTestSimdCrypto : CpuTest { + public CpuTestSimdCrypto(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdCrypto - [Test, Description("AESD .16B, .16B")] - public void Aesd_V([Values(0u)] uint rd, - [Values(1u)] uint rn, - [Values(0x7B5B546573745665ul)] ulong valueH, - [Values(0x63746F725D53475Dul)] ulong valueL, - [Random(2)] ulong roundKeyH, - [Random(2)] ulong roundKeyL, - [Values(0x8DCAB9BC035006BCul)] ulong resultH, - [Values(0x8F57161E00CAFD8Dul)] ulong resultL) + public static readonly ulong[] RandomRoundKeysH = + { + Random.Shared.NextULong(), + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomRoundKeysL = + { + Random.Shared.NextULong(), + Random.Shared.NextULong(), + }; + + [SkippableTheory(DisplayName = "AESD .16B, .16B")] + [CombinatorialData] + public void Aesd_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(0x7B5B546573745665ul)] ulong valueH, + [CombinatorialValues(0x63746F725D53475Dul)] ulong valueL, + [CombinatorialMemberData(nameof(RandomRoundKeysH))] ulong roundKeyH, + [CombinatorialMemberData(nameof(RandomRoundKeysL))] ulong roundKeyL, + [CombinatorialValues(0x8DCAB9BC035006BCul)] ulong resultH, + [CombinatorialValues(0x8F57161E00CAFD8Dul)] ulong resultL) { uint opcode = 0x4E285800; // AESD V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -27,27 +48,28 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(roundKeyL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(roundKeyH)); + Assert.Equal(roundKeyL, GetVectorE0(context.GetV(1))); + Assert.Equal(roundKeyH, GetVectorE1(context.GetV(1))); }); CompareAgainstUnicorn(); } - [Test, Description("AESE .16B, .16B")] - public void Aese_V([Values(0u)] uint rd, - [Values(1u)] uint rn, - [Values(0x7B5B546573745665ul)] ulong valueH, - [Values(0x63746F725D53475Dul)] ulong valueL, - [Random(2)] ulong roundKeyH, - [Random(2)] ulong roundKeyL, - [Values(0x8F92A04DFBED204Dul)] ulong resultH, - [Values(0x4C39B1402192A84Cul)] ulong resultL) + [SkippableTheory(DisplayName = "AESE .16B, .16B")] + [CombinatorialData] + public void Aese_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(0x7B5B546573745665ul)] ulong valueH, + [CombinatorialValues(0x63746F725D53475Dul)] ulong valueL, + [CombinatorialMemberData(nameof(RandomRoundKeysH))] ulong roundKeyH, + [CombinatorialMemberData(nameof(RandomRoundKeysL))] ulong roundKeyL, + [CombinatorialValues(0x8F92A04DFBED204Dul)] ulong resultH, + [CombinatorialValues(0x4C39B1402192A84Cul)] ulong resultL) { uint opcode = 0x4E284800; // AESE V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -59,25 +81,26 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(roundKeyL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(roundKeyH)); + Assert.Equal(roundKeyL, GetVectorE0(context.GetV(1))); + Assert.Equal(roundKeyH, GetVectorE1(context.GetV(1))); }); CompareAgainstUnicorn(); } - [Test, Description("AESIMC .16B, .16B")] - public void Aesimc_V([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(0x8DCAB9DC035006BCul)] ulong valueH, - [Values(0x8F57161E00CAFD8Dul)] ulong valueL, - [Values(0xD635A667928B5EAEul)] ulong resultH, - [Values(0xEEC9CC3BC55F5777ul)] ulong resultL) + [SkippableTheory(DisplayName = "AESIMC .16B, .16B")] + [CombinatorialData] + public void Aesimc_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(0x8DCAB9DC035006BCul)] ulong valueH, + [CombinatorialValues(0x8F57161E00CAFD8Dul)] ulong valueL, + [CombinatorialValues(0xD635A667928B5EAEul)] ulong resultH, + [CombinatorialValues(0xEEC9CC3BC55F5777ul)] ulong resultL) { uint opcode = 0x4E287800; // AESIMC V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -91,28 +114,29 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); if (rn == 1u) { Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(valueL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(valueH)); + Assert.Equal(valueL, GetVectorE0(context.GetV(1))); + Assert.Equal(valueH, GetVectorE1(context.GetV(1))); }); } CompareAgainstUnicorn(); } - [Test, Description("AESMC .16B, .16B")] - public void Aesmc_V([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(0x627A6F6644B109C8ul)] ulong valueH, - [Values(0x2B18330A81C3B3E5ul)] ulong valueL, - [Values(0x7B5B546573745665ul)] ulong resultH, - [Values(0x63746F725D53475Dul)] ulong resultL) + [SkippableTheory(DisplayName = "AESMC .16B, .16B")] + [CombinatorialData] + public void Aesmc_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(0x627A6F6644B109C8ul)] ulong valueH, + [CombinatorialValues(0x2B18330A81C3B3E5ul)] ulong valueL, + [CombinatorialValues(0x7B5B546573745665ul)] ulong resultH, + [CombinatorialValues(0x63746F725D53475Dul)] ulong resultL) { uint opcode = 0x4E286800; // AESMC V0.16B, V0.16B opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); @@ -126,15 +150,15 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); if (rn == 1u) { Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(valueL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(valueH)); + Assert.Equal(valueL, GetVectorE0(context.GetV(1))); + Assert.Equal(valueH, GetVectorE1(context.GetV(1))); }); } diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto32.cs index f1c74112b6..95de2425dc 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdCrypto32.cs @@ -1,21 +1,42 @@ -// #define SimdCrypto32 +#define SimdCrypto32 // https://www.intel.com/content/dam/doc/white-paper/advanced-encryption-standard-new-instructions-set-paper.pdf +using ARMeilleure.State; +using System; +using Xunit; +using Xunit.Abstractions; + namespace Ryujinx.Tests.Cpu { public class CpuTestSimdCrypto32 : CpuTest32 { + public CpuTestSimdCrypto32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdCrypto32 - [Test, Description("AESD.8 , ")] - public void Aesd_V([Values(0u)] uint rd, - [Values(2u)] uint rm, - [Values(0x7B5B546573745665ul)] ulong valueH, - [Values(0x63746F725D53475Dul)] ulong valueL, - [Random(2)] ulong roundKeyH, - [Random(2)] ulong roundKeyL, - [Values(0x8DCAB9BC035006BCul)] ulong resultH, - [Values(0x8F57161E00CAFD8Dul)] ulong resultL) + public static readonly ulong[] RandomRoundKeysH = + { + Random.Shared.NextULong(), + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomRoundKeysL = + { + Random.Shared.NextULong(), + Random.Shared.NextULong(), + }; + + [Theory(DisplayName = "AESD.8 , ")] + [CombinatorialData] + public void Aesd_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u)] uint rm, + [CombinatorialValues(0x7B5B546573745665ul)] ulong valueH, + [CombinatorialValues(0x63746F725D53475Dul)] ulong valueL, + [CombinatorialMemberData(nameof(RandomRoundKeysH))] ulong roundKeyH, + [CombinatorialMemberData(nameof(RandomRoundKeysL))] ulong roundKeyL, + [CombinatorialValues(0x8DCAB9BC035006BCul)] ulong resultH, + [CombinatorialValues(0x8F57161E00CAFD8Dul)] ulong resultL) { uint opcode = 0xf3b00340; // AESD.8 Q0, Q0 opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); @@ -28,28 +49,29 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(roundKeyL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(roundKeyH)); + Assert.Equal(roundKeyL, GetVectorE0(context.GetV(1))); + Assert.Equal(roundKeyH, GetVectorE1(context.GetV(1))); }); // Unicorn does not yet support crypto instructions in A32. // CompareAgainstUnicorn(); } - [Test, Description("AESE.8 , ")] - public void Aese_V([Values(0u)] uint rd, - [Values(2u)] uint rm, - [Values(0x7B5B546573745665ul)] ulong valueH, - [Values(0x63746F725D53475Dul)] ulong valueL, - [Random(2)] ulong roundKeyH, - [Random(2)] ulong roundKeyL, - [Values(0x8F92A04DFBED204Dul)] ulong resultH, - [Values(0x4C39B1402192A84Cul)] ulong resultL) + [Theory(DisplayName = "AESE.8 , ")] + [CombinatorialData] + public void Aese_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u)] uint rm, + [CombinatorialValues(0x7B5B546573745665ul)] ulong valueH, + [CombinatorialValues(0x63746F725D53475Dul)] ulong valueL, + [CombinatorialMemberData(nameof(RandomRoundKeysH))] ulong roundKeyH, + [CombinatorialMemberData(nameof(RandomRoundKeysL))] ulong roundKeyL, + [CombinatorialValues(0x8F92A04DFBED204Dul)] ulong resultH, + [CombinatorialValues(0x4C39B1402192A84Cul)] ulong resultL) { uint opcode = 0xf3b00300; // AESE.8 Q0, Q0 opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); @@ -62,26 +84,27 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(roundKeyL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(roundKeyH)); + Assert.Equal(roundKeyL, GetVectorE0(context.GetV(1))); + Assert.Equal(roundKeyH, GetVectorE1(context.GetV(1))); }); // Unicorn does not yet support crypto instructions in A32. // CompareAgainstUnicorn(); } - [Test, Description("AESIMC.8 , ")] - public void Aesimc_V([Values(0u)] uint rd, - [Values(2u, 0u)] uint rm, - [Values(0x8DCAB9DC035006BCul)] ulong valueH, - [Values(0x8F57161E00CAFD8Dul)] ulong valueL, - [Values(0xD635A667928B5EAEul)] ulong resultH, - [Values(0xEEC9CC3BC55F5777ul)] ulong resultL) + [Theory(DisplayName = "AESIMC.8 , ")] + [CombinatorialData] + public void Aesimc_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0x8DCAB9DC035006BCul)] ulong valueH, + [CombinatorialValues(0x8F57161E00CAFD8Dul)] ulong valueL, + [CombinatorialValues(0xD635A667928B5EAEul)] ulong resultH, + [CombinatorialValues(0xEEC9CC3BC55F5777ul)] ulong resultL) { uint opcode = 0xf3b003c0; // AESIMC.8 Q0, Q0 opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); @@ -97,15 +120,15 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); if (rm == 2u) { Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(valueL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(valueH)); + Assert.Equal(valueL, GetVectorE0(context.GetV(1))); + Assert.Equal(valueH, GetVectorE1(context.GetV(1))); }); } @@ -113,13 +136,14 @@ namespace Ryujinx.Tests.Cpu // CompareAgainstUnicorn(); } - [Test, Description("AESMC.8 , ")] - public void Aesmc_V([Values(0u)] uint rd, - [Values(2u, 0u)] uint rm, - [Values(0x627A6F6644B109C8ul)] ulong valueH, - [Values(0x2B18330A81C3B3E5ul)] ulong valueL, - [Values(0x7B5B546573745665ul)] ulong resultH, - [Values(0x63746F725D53475Dul)] ulong resultL) + [Theory(DisplayName = "AESMC.8 , ")] + [CombinatorialData] + public void Aesmc_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0x627A6F6644B109C8ul)] ulong valueH, + [CombinatorialValues(0x2B18330A81C3B3E5ul)] ulong valueL, + [CombinatorialValues(0x7B5B546573745665ul)] ulong resultH, + [CombinatorialValues(0x63746F725D53475Dul)] ulong resultL) { uint opcode = 0xf3b00380; // AESMC.8 Q0, Q0 opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); @@ -135,15 +159,15 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); if (rm == 2u) { Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(1)), Is.EqualTo(valueL)); - Assert.That(GetVectorE1(context.GetV(1)), Is.EqualTo(valueH)); + Assert.Equal(valueL, GetVectorE0(context.GetV(1))); + Assert.Equal(valueH, GetVectorE1(context.GetV(1))); }); } diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs index 06d23f73f9..77ff0f00d5 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt.cs @@ -1,12 +1,20 @@ -// #define SimdCvt +#define SimdCvt +using ARMeilleure.State; +using System; +using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdCvt")] public sealed class CpuTestSimdCvt : CpuTest { + public CpuTestSimdCvt(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdCvt #region "ValueSource (Types)" @@ -85,16 +93,16 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = (uint)BitConverter.SingleToInt32Bits( - (int)TestContext.CurrentContext.Random.NextUInt()); + (int)Random.Shared.NextUInt()); ulong rnd2 = (uint)BitConverter.SingleToInt32Bits( - (long)TestContext.CurrentContext.Random.NextULong()); + (long)Random.Shared.NextULong()); ulong rnd3 = (uint)BitConverter.SingleToInt32Bits( - TestContext.CurrentContext.Random.NextUInt()); + Random.Shared.NextUInt()); ulong rnd4 = (uint)BitConverter.SingleToInt32Bits( - TestContext.CurrentContext.Random.NextULong()); + Random.Shared.NextULong()); ulong rnd5 = GenNormalS(); ulong rnd6 = GenSubnormalS(); @@ -169,13 +177,13 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { ulong rnd1 = (ulong)BitConverter.DoubleToInt64Bits( - (int)TestContext.CurrentContext.Random.NextUInt()); + (int)Random.Shared.NextUInt()); ulong rnd2 = (ulong)BitConverter.DoubleToInt64Bits( - (long)TestContext.CurrentContext.Random.NextULong()); + (long)Random.Shared.NextULong()); ulong rnd3 = (ulong)BitConverter.DoubleToInt64Bits( - TestContext.CurrentContext.Random.NextUInt()); + Random.Shared.NextUInt()); ulong rnd4 = (ulong)BitConverter.DoubleToInt64Bits( - TestContext.CurrentContext.Random.NextULong()); + Random.Shared.NextULong()); ulong rnd5 = GenNormalD(); ulong rnd6 = GenSubnormalD(); @@ -371,17 +379,17 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Test, Pairwise] - [Explicit] - public void F_Cvt_AMPZ_SU_Gp_SW([ValueSource(nameof(_F_Cvt_AMPZ_SU_Gp_SW_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1S_F_WX_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_AMPZ_SU_Gp_SW([CombinatorialMemberData(nameof(_F_Cvt_AMPZ_SU_Gp_SW_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1S_F_WX_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x0: x0, x31: w31, v1: v1); @@ -389,16 +397,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_AMPZ_SU_Gp_SX([ValueSource(nameof(_F_Cvt_AMPZ_SU_Gp_SX_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1S_F_WX_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_AMPZ_SU_Gp_SX([CombinatorialMemberData(nameof(_F_Cvt_AMPZ_SU_Gp_SX_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1S_F_WX_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x31: x31, v1: v1); @@ -406,17 +414,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_AMPZ_SU_Gp_DW([ValueSource(nameof(_F_Cvt_AMPZ_SU_Gp_DW_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1D_F_WX_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_AMPZ_SU_Gp_DW([CombinatorialMemberData(nameof(_F_Cvt_AMPZ_SU_Gp_DW_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_WX_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x0: x0, x31: w31, v1: v1); @@ -424,16 +432,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_AMPZ_SU_Gp_DX([ValueSource(nameof(_F_Cvt_AMPZ_SU_Gp_DX_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1D_F_WX_))] ulong a) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_AMPZ_SU_Gp_DX([CombinatorialMemberData(nameof(_F_Cvt_AMPZ_SU_Gp_DX_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_WX_))] ulong a) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x31: x31, v1: v1); @@ -441,21 +449,21 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_Z_SU_Gp_Fixed_SW([ValueSource(nameof(_F_Cvt_Z_SU_Gp_Fixed_SW_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1S_F_WX_))] ulong a, - [Values(1u, 32u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_Z_SU_Gp_Fixed_SW([CombinatorialMemberData(nameof(_F_Cvt_Z_SU_Gp_Fixed_SW_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1S_F_WX_))] ulong a, + [CombinatorialValues(1u, 32u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x0: x0, x31: w31, v1: v1); @@ -463,20 +471,20 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_Z_SU_Gp_Fixed_SX([ValueSource(nameof(_F_Cvt_Z_SU_Gp_Fixed_SX_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1S_F_WX_))] ulong a, - [Values(1u, 64u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_Z_SU_Gp_Fixed_SX([CombinatorialMemberData(nameof(_F_Cvt_Z_SU_Gp_Fixed_SX_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1S_F_WX_))] ulong a, + [CombinatorialValues(1u, 64u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x31: x31, v1: v1); @@ -484,21 +492,21 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_Z_SU_Gp_Fixed_DW([ValueSource(nameof(_F_Cvt_Z_SU_Gp_Fixed_DW_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1D_F_WX_))] ulong a, - [Values(1u, 32u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_Z_SU_Gp_Fixed_DW([CombinatorialMemberData(nameof(_F_Cvt_Z_SU_Gp_Fixed_DW_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_WX_))] ulong a, + [CombinatorialValues(1u, 32u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x0: x0, x31: w31, v1: v1); @@ -506,20 +514,20 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_Z_SU_Gp_Fixed_DX([ValueSource(nameof(_F_Cvt_Z_SU_Gp_Fixed_DX_))] uint opcodes, - [Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1D_F_WX_))] ulong a, - [Values(1u, 64u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_Z_SU_Gp_Fixed_DX([CombinatorialMemberData(nameof(_F_Cvt_Z_SU_Gp_Fixed_DX_))] uint opcodes, + [CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_WX_))] ulong a, + [CombinatorialValues(1u, 64u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0(a); SingleOpcode(opcodes, x31: x31, v1: v1); @@ -527,17 +535,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_WS([ValueSource(nameof(_SU_Cvt_F_Gp_WS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_W_))] uint wn) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_WS([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_WS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_W_))] uint wn) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + uint w31 = Random.Shared.NextUInt(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcodes, x1: wn, x31: w31, v0: v0); @@ -545,17 +553,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_WD([ValueSource(nameof(_SU_Cvt_F_Gp_WD_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_W_))] uint wn) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_WD([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_WD_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_W_))] uint wn) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + uint w31 = Random.Shared.NextUInt(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, x1: wn, x31: w31, v0: v0); @@ -563,17 +571,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_XS([ValueSource(nameof(_SU_Cvt_F_Gp_XS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_X_))] ulong xn) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_XS([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_XS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_X_))] ulong xn) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcodes, x1: xn, x31: x31, v0: v0); @@ -581,17 +589,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_XD([ValueSource(nameof(_SU_Cvt_F_Gp_XD_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_X_))] ulong xn) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_XD([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_XD_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_X_))] ulong xn) { opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, x1: xn, x31: x31, v0: v0); @@ -599,21 +607,21 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_Fixed_WS([ValueSource(nameof(_SU_Cvt_F_Gp_Fixed_WS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_W_))] uint wn, - [Values(1u, 32u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_Fixed_WS([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_Fixed_WS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_W_))] uint wn, + [CombinatorialValues(1u, 32u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + uint w31 = Random.Shared.NextUInt(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcodes, x1: wn, x31: w31, v0: v0); @@ -621,21 +629,21 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_Fixed_WD([ValueSource(nameof(_SU_Cvt_F_Gp_Fixed_WD_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_W_))] uint wn, - [Values(1u, 32u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_Fixed_WD([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_Fixed_WD_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_W_))] uint wn, + [CombinatorialValues(1u, 32u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + uint w31 = Random.Shared.NextUInt(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, x1: wn, x31: w31, v0: v0); @@ -643,21 +651,21 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_Fixed_XS([ValueSource(nameof(_SU_Cvt_F_Gp_Fixed_XS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_X_))] ulong xn, - [Values(1u, 64u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_Fixed_XS([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_Fixed_XS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_X_))] ulong xn, + [CombinatorialValues(1u, 64u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcodes, x1: xn, x31: x31, v0: v0); @@ -665,21 +673,21 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_Gp_Fixed_XD([ValueSource(nameof(_SU_Cvt_F_Gp_Fixed_XD_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_X_))] ulong xn, - [Values(1u, 64u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_Gp_Fixed_XD([CombinatorialMemberData(nameof(_SU_Cvt_F_Gp_Fixed_XD_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_X_))] ulong xn, + [CombinatorialValues(1u, 64u)] uint fBits) { uint scale = (64u - fBits) & 0x3Fu; opcodes |= ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= (scale << 10); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, x1: xn, x31: x31, v0: v0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs index 9deb3100df..20b4fc37ae 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdCvt32.cs @@ -1,12 +1,20 @@ -// #define SimdCvt32 +#define SimdCvt32 +using ARMeilleure.State; +using System; +using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdCvt32")] public sealed class CpuTestSimdCvt32 : CpuTest32 { + public CpuTestSimdCvt32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdCvt32 #region "ValueSource (Opcodes)" @@ -64,7 +72,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = GenNormalS(); ulong rnd2 = GenSubnormalS(); @@ -162,15 +170,15 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Explicit] - [Test, Pairwise, Description("VCVT.
.F32 , ")] - public void Vcvt_F32_I32([Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_1S_F_))] ulong s0, - [ValueSource(nameof(_1S_F_))] ulong s1, - [ValueSource(nameof(_1S_F_))] ulong s2, - [ValueSource(nameof(_1S_F_))] ulong s3, - [Values] bool unsigned) // + [Theory(DisplayName = "VCVT.
.F32 , ")] + [PairwiseData] + public void Vcvt_F32_I32([CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s0, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s1, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s2, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s3, + bool unsigned) // { uint opcode = 0xeebc0ac0u; // VCVT.U32.F32 S0, S0 @@ -189,13 +197,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise, Description("VCVT.
.F64 , ")] - public void Vcvt_F64_I32([Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong d0, - [ValueSource(nameof(_1D_F_))] ulong d1, - [Values] bool unsigned) // + [Theory(DisplayName = "VCVT.
.F64 , ")] + [PairwiseData] + public void Vcvt_F64_I32([CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d0, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d1, + bool unsigned) // { uint opcode = 0xeebc0bc0u; // VCVT.U32.F64 S0, D0 @@ -214,16 +222,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise, Description("VCVT.F32.
, ")] - public void Vcvt_I32_F32([Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_1S_))] uint s0, - [ValueSource(nameof(_1S_))] uint s1, - [ValueSource(nameof(_1S_))] uint s2, - [ValueSource(nameof(_1S_))] uint s3, - [Values] bool unsigned, // - [Values(RMode.Rn)] RMode rMode) + [Theory(DisplayName = "VCVT.F32.
, ")] + [PairwiseData] + public void Vcvt_I32_F32([CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_1S_))] uint s0, + [CombinatorialMemberData(nameof(_1S_))] uint s1, + [CombinatorialMemberData(nameof(_1S_))] uint s2, + [CombinatorialMemberData(nameof(_1S_))] uint s3, + bool unsigned, // + [CombinatorialValues(RMode.Rn)] RMode rMode) { uint opcode = 0xeeb80a40u; // VCVT.F32.U32 S0, S0 @@ -244,16 +252,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise, Description("VCVT.F64.
, ")] - public void Vcvt_I32_F64([Values(0u, 1u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_1S_))] uint s0, - [ValueSource(nameof(_1S_))] uint s1, - [ValueSource(nameof(_1S_))] uint s2, - [ValueSource(nameof(_1S_))] uint s3, - [Values] bool unsigned, // - [Values(RMode.Rn)] RMode rMode) + [Theory(DisplayName = "VCVT.F64.
, ")] + [PairwiseData] + public void Vcvt_I32_F64([CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_1S_))] uint s0, + [CombinatorialMemberData(nameof(_1S_))] uint s1, + [CombinatorialMemberData(nameof(_1S_))] uint s2, + [CombinatorialMemberData(nameof(_1S_))] uint s3, + bool unsigned, // + [CombinatorialValues(RMode.Rn)] RMode rMode) { uint opcode = 0xeeb80b40u; // VCVT.F64.U32 D0, S0 @@ -274,16 +282,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void Vrint_AMNP_V_F32([ValueSource(nameof(_Vrint_AMNP_V_F32_))] uint opcode, - [Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong d0, - [ValueSource(nameof(_2S_F_))] ulong d1, - [ValueSource(nameof(_2S_F_))] ulong d2, - [ValueSource(nameof(_2S_F_))] ulong d3, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vrint_AMNP_V_F32([CombinatorialMemberData(nameof(_Vrint_AMNP_V_F32_))] uint opcode, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d1, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d2, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d3, + bool q) { if (q) { @@ -306,14 +314,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VRINTX.F , ")] - public void Vrintx_S([Values(0u, 1u)] uint rd, - [Values(0u, 1u)] uint rm, - [Values(2u, 3u)] uint size, - [ValueSource(nameof(_1D_F_))] ulong s0, - [ValueSource(nameof(_1D_F_))] ulong s1, - [ValueSource(nameof(_1D_F_))] ulong s2, - [Values(RMode.Rn, RMode.Rm, RMode.Rp)] RMode rMode) + [Theory(DisplayName = "VRINTX.F , ")] + [PairwiseData] + public void Vrintx_S([CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rm, + [CombinatorialValues(2u, 3u)] uint size, + [CombinatorialMemberData(nameof(_1D_F_))] ulong s0, + [CombinatorialMemberData(nameof(_1D_F_))] ulong s1, + [CombinatorialMemberData(nameof(_1D_F_))] ulong s2, + [CombinatorialValues(RMode.Rn, RMode.Rm, RMode.Rp)] RMode rMode) { uint opcode = 0xEB70A40; V128 v0, v1, v2; @@ -342,15 +351,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise, Description("VCVT.F16.F32 , ")] - public void Vcvt_F32_F16([Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_1S_))] uint s0, - [ValueSource(nameof(_1S_))] uint s1, - [ValueSource(nameof(_1S_))] uint s2, - [ValueSource(nameof(_1S_))] uint s3, - [Values] bool top) + [Theory(DisplayName = "VCVT.F16.F32 , ")] + [PairwiseData] + public void Vcvt_F32_F16([CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_1S_))] uint s0, + [CombinatorialMemberData(nameof(_1S_))] uint s1, + [CombinatorialMemberData(nameof(_1S_))] uint s2, + [CombinatorialMemberData(nameof(_1S_))] uint s3, + bool top) { uint opcode = 0xeeb30a40; // VCVTB.F16.F32 S0, D0 @@ -369,13 +378,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise, Description("VCVT.F16.F64 , ")] - public void Vcvt_F64_F16([Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong d0, - [ValueSource(nameof(_1D_F_))] ulong d1, - [Values] bool top) + [Theory(DisplayName = "VCVT.F16.F64 , ")] + [PairwiseData] + public void Vcvt_F64_F16([CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d0, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d1, + bool top) { uint opcode = 0xeeb30b40; // VCVTB.F16.F64 S0, D0 @@ -394,14 +403,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise, Description("VCVT.F.F16 , ")] - public void Vcvt_F16_Fx([Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong d0, - [ValueSource(nameof(_1D_F_))] ulong d1, - [Values] bool top, - [Values] bool sz) + [Theory(DisplayName = "VCVT.F.F16 , ")] + [PairwiseData] + public void Vcvt_F16_Fx([CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d0, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d1, + bool top, + bool sz) { uint opcode = 0xeeb20a40; // VCVTB.F32.F16 S0, S0 @@ -429,16 +438,22 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VCVT.I32.F32 , , #")] - public void Vcvt_V_Fixed_F32_I32([Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 1u, 2u, 3u)] uint vm, - [ValueSource(nameof(_1S_F_))][Random(RndCnt)] ulong s0, - [ValueSource(nameof(_1S_F_))][Random(RndCnt)] ulong s1, - [ValueSource(nameof(_1S_F_))][Random(RndCnt)] ulong s2, - [ValueSource(nameof(_1S_F_))][Random(RndCnt)] ulong s3, - [Random(32u, 63u, 1)] uint fixImm, - [Values] bool unsigned, - [Values] bool q) + public static readonly uint[] RandomFixImm = + { + Random.Shared.NextUInt(32u, 64u), + }; + + [Theory(DisplayName = "VCVT.I32.F32 , , #")] + [PairwiseData] + public void Vcvt_V_Fixed_F32_I32([CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialMemberData(nameof(_1S_F_))][CombinatorialRandomData(Count = RndCnt)] ulong s0, + [CombinatorialMemberData(nameof(_1S_F_))][CombinatorialRandomData(Count = RndCnt)] ulong s1, + [CombinatorialMemberData(nameof(_1S_F_))][CombinatorialRandomData(Count = RndCnt)] ulong s2, + [CombinatorialMemberData(nameof(_1S_F_))][CombinatorialRandomData(Count = RndCnt)] ulong s3, + [CombinatorialMemberData(nameof(RandomFixImm))] uint fixImm, + bool unsigned, + bool q) { uint opcode = 0xF2800F10u; // VCVT.U32.F32 D0, D0, #0 @@ -469,16 +484,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VCVT.F32.I32 , , #")] - public void Vcvt_V_Fixed_I32_F32([Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 1u, 2u, 3u)] uint vm, - [ValueSource(nameof(_1S_))][Random(RndCnt)] uint s0, - [ValueSource(nameof(_1S_))][Random(RndCnt)] uint s1, - [ValueSource(nameof(_1S_))][Random(RndCnt)] uint s2, - [ValueSource(nameof(_1S_))][Random(RndCnt)] uint s3, - [Range(32u, 63u, 1)] uint fixImm, - [Values] bool unsigned, - [Values] bool q) + [Theory(DisplayName = "VCVT.F32.I32 , , #")] + [PairwiseData] + public void Vcvt_V_Fixed_I32_F32([CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialMemberData(nameof(_1S_))][CombinatorialRandomData(Count = RndCnt)] uint s0, + [CombinatorialMemberData(nameof(_1S_))][CombinatorialRandomData(Count = RndCnt)] uint s1, + [CombinatorialMemberData(nameof(_1S_))][CombinatorialRandomData(Count = RndCnt)] uint s2, + [CombinatorialMemberData(nameof(_1S_))][CombinatorialRandomData(Count = RndCnt)] uint s3, + [CombinatorialRange(32u, 63u, 1)] uint fixImm, + bool unsigned, + bool q) { uint opcode = 0xF2800E10u; // VCVT.F32.U32 D0, D0, #0 diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdExt.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdExt.cs index a52334f785..bcd5e311d2 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdExt.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdExt.cs @@ -1,12 +1,18 @@ -// #define SimdExt +#define SimdExt +using ARMeilleure.State; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdExt")] public sealed class CpuTestSimdExt : CpuTest { + public CpuTestSimdExt(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdExt #region "ValueSource" @@ -19,14 +25,15 @@ namespace Ryujinx.Tests.Cpu } #endregion - [Test, Pairwise, Description("EXT .8B, .8B, .8B, #")] - public void Ext_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b, - [Values(0u, 7u)] uint index) + [SkippableTheory(DisplayName = "EXT .8B, .8B, .8B, #")] + [PairwiseData] + public void Ext_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b, + [CombinatorialValues(0u, 7u)] uint index) { uint imm4 = index & 0x7u; @@ -43,14 +50,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("EXT .16B, .16B, .16B, #")] - public void Ext_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b, - [Values(0u, 15u)] uint index) + [SkippableTheory(DisplayName = "EXT .16B, .16B, .16B, #")] + [PairwiseData] + public void Ext_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b, + [CombinatorialValues(0u, 15u)] uint index) { uint imm4 = index & 0xFu; diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs index e4a7e128ed..495d907967 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdFcond.cs @@ -1,12 +1,20 @@ -// #define SimdFcond +#define SimdFcond +using ARMeilleure.State; +using System; using Xunit; +using System.Collections.Generic; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdFcond")] public sealed class CpuTestSimdFcond : CpuTest { + public CpuTestSimdFcond(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdFcond #region "ValueSource (Types)" @@ -43,7 +51,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = GenNormalS(); ulong rnd2 = GenSubnormalS(); @@ -137,71 +145,77 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Test, Pairwise] - [Explicit] - public void F_Ccmp_Ccmpe_S_S([ValueSource(nameof(_F_Ccmp_Ccmpe_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // + public static readonly uint[] RandomNzcv = + { + Random.Shared.NextUInt(15u), + Random.Shared.NextUInt(15u), + }; + + [SkippableTheory] + [PairwiseData] + public void F_Ccmp_Ccmpe_S_S([CombinatorialMemberData(nameof(_F_Ccmp_Ccmpe_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b, + [CombinatorialMemberData(nameof(RandomNzcv))] uint nzcv, + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { opcodes |= ((cond & 15) << 12) | ((nzcv & 15) << 0); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - bool v = TestContext.CurrentContext.Random.NextBool(); - bool c = TestContext.CurrentContext.Random.NextBool(); - bool z = TestContext.CurrentContext.Random.NextBool(); - bool n = TestContext.CurrentContext.Random.NextBool(); + bool v = Random.Shared.NextBool(); + bool c = Random.Shared.NextBool(); + bool z = Random.Shared.NextBool(); + bool n = Random.Shared.NextBool(); SingleOpcode(opcodes, v1: v1, v2: v2, overflow: v, carry: c, zero: z, negative: n); CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc); } - [Test, Pairwise] - [Explicit] - public void F_Ccmp_Ccmpe_S_D([ValueSource(nameof(_F_Ccmp_Ccmpe_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b, - [Random(0u, 15u, RndCntNzcv)] uint nzcv, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // + [SkippableTheory] + [PairwiseData] + public void F_Ccmp_Ccmpe_S_D([CombinatorialMemberData(nameof(_F_Ccmp_Ccmpe_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b, + [CombinatorialMemberData(nameof(RandomNzcv))] uint nzcv, + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { opcodes |= ((cond & 15) << 12) | ((nzcv & 15) << 0); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - bool v = TestContext.CurrentContext.Random.NextBool(); - bool c = TestContext.CurrentContext.Random.NextBool(); - bool z = TestContext.CurrentContext.Random.NextBool(); - bool n = TestContext.CurrentContext.Random.NextBool(); + bool v = Random.Shared.NextBool(); + bool c = Random.Shared.NextBool(); + bool z = Random.Shared.NextBool(); + bool n = Random.Shared.NextBool(); SingleOpcode(opcodes, v1: v1, v2: v2, overflow: v, carry: c, zero: z, negative: n); CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc); } - [Test, Pairwise] - [Explicit] - public void F_Csel_S_S([ValueSource(nameof(_F_Csel_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // + [SkippableTheory] + [PairwiseData] + public void F_Csel_S_S([CombinatorialMemberData(nameof(_F_Csel_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b, + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { opcodes |= ((cond & 15) << 12); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); @@ -211,19 +225,19 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Csel_S_D([ValueSource(nameof(_F_Csel_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b, - [Values(0b0000u, 0b0001u, 0b0010u, 0b0011u, // + [SkippableTheory] + [PairwiseData] + public void F_Csel_S_D([CombinatorialMemberData(nameof(_F_Csel_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b, + [CombinatorialValues(0b0000u, 0b0001u, 0b0010u, 0b0011u, // { opcodes |= ((cond & 15) << 12); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdFmov.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdFmov.cs index 2cfddaaaf6..f9a79b55c4 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdFmov.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdFmov.cs @@ -1,12 +1,19 @@ -// #define SimdFmov +#define SimdFmov +using ARMeilleure.State; +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdFmov")] public sealed class CpuTestSimdFmov : CpuTest { + public CpuTestSimdFmov(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdFmov #region "ValueSource" @@ -27,14 +34,14 @@ namespace Ryujinx.Tests.Cpu } #endregion - [Test, Pairwise] - [Explicit] - public void F_Mov_Si_S([ValueSource(nameof(_F_Mov_Si_S_))] uint opcodes, - [Range(0u, 255u, 1u)] uint imm8) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Si_S([CombinatorialMemberData(nameof(_F_Mov_Si_S_))] uint opcodes, + [CombinatorialRange(0u, 255u, 1u)] uint imm8) { opcodes |= ((imm8 & 0xFFu) << 13); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcodes, v0: v0); @@ -42,14 +49,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Si_D([ValueSource(nameof(_F_Mov_Si_D_))] uint opcodes, - [Range(0u, 255u, 1u)] uint imm8) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Si_D([CombinatorialMemberData(nameof(_F_Mov_Si_D_))] uint opcodes, + [CombinatorialRange(0u, 255u, 1u)] uint imm8) { opcodes |= ((imm8 & 0xFFu) << 13); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, v0: v0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdImm.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdImm.cs index dcfba08fbb..228355b35e 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdImm.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdImm.cs @@ -1,12 +1,20 @@ -// #define SimdImm +#define SimdImm +using ARMeilleure.State; +using System; using Xunit; +using System.Collections.Generic; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdImm")] public sealed class CpuTestSimdImm : CpuTest { + public CpuTestSimdImm(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdImm #region "Helper methods" @@ -69,7 +77,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCntImm8; cnt++) { - byte imm8 = TestContext.CurrentContext.Random.NextByte(); + byte imm8 = Random.Shared.NextByte(); yield return imm8; } @@ -84,7 +92,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCntImm64; cnt++) { - byte imm8 = TestContext.CurrentContext.Random.NextByte(); + byte imm8 = Random.Shared.NextByte(); yield return ExpandImm8(imm8); } @@ -189,12 +197,13 @@ namespace Ryujinx.Tests.Cpu private const int RndCntImm8 = 2; private const int RndCntImm64 = 2; - [Test, Pairwise] - public void Bic_Orr_Vi_16bit([ValueSource(nameof(_Bic_Orr_Vi_16bit_))] uint opcodes, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_8BIT_IMM_))] byte imm8, - [Values(0b0u, 0b1u)] uint amount, // <0, 8> - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory] + [PairwiseData] + public void Bic_Orr_Vi_16bit([CombinatorialMemberData(nameof(_Bic_Orr_Vi_16bit_))] uint opcodes, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_8BIT_IMM_))] byte imm8, + [CombinatorialValues(0b0u, 0b1u)] uint amount, // <0, 8> + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint abc = (imm8 & 0xE0u) >> 5; uint defgh = (imm8 & 0x1Fu); @@ -210,12 +219,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Bic_Orr_Vi_32bit([ValueSource(nameof(_Bic_Orr_Vi_32bit_))] uint opcodes, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_8BIT_IMM_))] byte imm8, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint amount, // <0, 8, 16, 24> - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void Bic_Orr_Vi_32bit([CombinatorialMemberData(nameof(_Bic_Orr_Vi_32bit_))] uint opcodes, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_8BIT_IMM_))] byte imm8, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint amount, // <0, 8, 16, 24> + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint abc = (imm8 & 0xE0u) >> 5; uint defgh = (imm8 & 0x1Fu); @@ -231,17 +241,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Vi_2S([ValueSource(nameof(_F_Mov_Vi_2S_))] uint opcodes, - [Range(0u, 255u, 1u)] uint abcdefgh) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Vi_2S([CombinatorialMemberData(nameof(_F_Mov_Vi_2S_))] uint opcodes, + [CombinatorialRange(0u, 255u, 1u)] uint abcdefgh) { uint abc = (abcdefgh & 0xE0u) >> 5; uint defgh = (abcdefgh & 0x1Fu); opcodes |= (abc << 16) | (defgh << 5); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, v0: v0); @@ -249,10 +259,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Vi_4S([ValueSource(nameof(_F_Mov_Vi_4S_))] uint opcodes, - [Range(0u, 255u, 1u)] uint abcdefgh) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Vi_4S([CombinatorialMemberData(nameof(_F_Mov_Vi_4S_))] uint opcodes, + [CombinatorialRange(0u, 255u, 1u)] uint abcdefgh) { uint abc = (abcdefgh & 0xE0u) >> 5; uint defgh = (abcdefgh & 0x1Fu); @@ -264,10 +274,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Mov_Vi_2D([ValueSource(nameof(_F_Mov_Vi_2D_))] uint opcodes, - [Range(0u, 255u, 1u)] uint abcdefgh) + [SkippableTheory] + [PairwiseData] + public void F_Mov_Vi_2D([CombinatorialMemberData(nameof(_F_Mov_Vi_2D_))] uint opcodes, + [CombinatorialRange(0u, 255u, 1u)] uint abcdefgh) { uint abc = (abcdefgh & 0xE0u) >> 5; uint defgh = (abcdefgh & 0x1Fu); @@ -279,10 +289,11 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Movi_V_8bit([ValueSource(nameof(_Movi_V_8bit_))] uint opcodes, - [ValueSource(nameof(_8BIT_IMM_))] byte imm8, - [Values(0b0u, 0b1u)] uint q) // <8B, 16B> + [SkippableTheory] + [PairwiseData] + public void Movi_V_8bit([CombinatorialMemberData(nameof(_Movi_V_8bit_))] uint opcodes, + [CombinatorialMemberData(nameof(_8BIT_IMM_))] byte imm8, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { uint abc = (imm8 & 0xE0u) >> 5; uint defgh = (imm8 & 0x1Fu); @@ -290,7 +301,7 @@ namespace Ryujinx.Tests.Cpu opcodes |= (abc << 16) | (defgh << 5); opcodes |= ((q & 1) << 30); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(q == 0u ? z : 0ul); SingleOpcode(opcodes, v0: v0); @@ -298,11 +309,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Movi_Mvni_V_16bit_shifted_imm([ValueSource(nameof(_Movi_Mvni_V_16bit_shifted_imm_))] uint opcodes, - [ValueSource(nameof(_8BIT_IMM_))] byte imm8, - [Values(0b0u, 0b1u)] uint amount, // <0, 8> - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory] + [PairwiseData] + public void Movi_Mvni_V_16bit_shifted_imm([CombinatorialMemberData(nameof(_Movi_Mvni_V_16bit_shifted_imm_))] uint opcodes, + [CombinatorialMemberData(nameof(_8BIT_IMM_))] byte imm8, + [CombinatorialValues(0b0u, 0b1u)] uint amount, // <0, 8> + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint abc = (imm8 & 0xE0u) >> 5; uint defgh = (imm8 & 0x1Fu); @@ -311,7 +323,7 @@ namespace Ryujinx.Tests.Cpu opcodes |= ((amount & 1) << 13); opcodes |= ((q & 1) << 30); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(q == 0u ? z : 0ul); SingleOpcode(opcodes, v0: v0); @@ -319,11 +331,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Movi_Mvni_V_32bit_shifted_imm([ValueSource(nameof(_Movi_Mvni_V_32bit_shifted_imm_))] uint opcodes, - [ValueSource(nameof(_8BIT_IMM_))] byte imm8, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint amount, // <0, 8, 16, 24> - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void Movi_Mvni_V_32bit_shifted_imm([CombinatorialMemberData(nameof(_Movi_Mvni_V_32bit_shifted_imm_))] uint opcodes, + [CombinatorialMemberData(nameof(_8BIT_IMM_))] byte imm8, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint amount, // <0, 8, 16, 24> + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint abc = (imm8 & 0xE0u) >> 5; uint defgh = (imm8 & 0x1Fu); @@ -332,7 +345,7 @@ namespace Ryujinx.Tests.Cpu opcodes |= ((amount & 3) << 13); opcodes |= ((q & 1) << 30); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(q == 0u ? z : 0ul); SingleOpcode(opcodes, v0: v0); @@ -340,11 +353,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Movi_Mvni_V_32bit_shifting_ones([ValueSource(nameof(_Movi_Mvni_V_32bit_shifting_ones_))] uint opcodes, - [ValueSource(nameof(_8BIT_IMM_))] byte imm8, - [Values(0b0u, 0b1u)] uint amount, // <8, 16> - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void Movi_Mvni_V_32bit_shifting_ones([CombinatorialMemberData(nameof(_Movi_Mvni_V_32bit_shifting_ones_))] uint opcodes, + [CombinatorialMemberData(nameof(_8BIT_IMM_))] byte imm8, + [CombinatorialValues(0b0u, 0b1u)] uint amount, // <8, 16> + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint abc = (imm8 & 0xE0u) >> 5; uint defgh = (imm8 & 0x1Fu); @@ -353,7 +367,7 @@ namespace Ryujinx.Tests.Cpu opcodes |= ((amount & 1) << 12); opcodes |= ((q & 1) << 30); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(q == 0u ? z : 0ul); SingleOpcode(opcodes, v0: v0); @@ -361,9 +375,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Movi_V_64bit_scalar([ValueSource(nameof(_Movi_V_64bit_scalar_))] uint opcodes, - [ValueSource(nameof(_64BIT_IMM_))] ulong imm) + [SkippableTheory] + [PairwiseData] + public void Movi_V_64bit_scalar([CombinatorialMemberData(nameof(_Movi_V_64bit_scalar_))] uint opcodes, + [CombinatorialMemberData(nameof(_64BIT_IMM_))] ulong imm) { byte imm8 = ShrinkImm64(imm); @@ -372,7 +387,7 @@ namespace Ryujinx.Tests.Cpu opcodes |= (abc << 16) | (defgh << 5); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); SingleOpcode(opcodes, v0: v0); @@ -380,9 +395,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Movi_V_64bit_vector([ValueSource(nameof(_Movi_V_64bit_vector_))] uint opcodes, - [ValueSource(nameof(_64BIT_IMM_))] ulong imm) + [SkippableTheory] + [PairwiseData] + public void Movi_V_64bit_vector([CombinatorialMemberData(nameof(_Movi_V_64bit_vector_))] uint opcodes, + [CombinatorialMemberData(nameof(_64BIT_IMM_))] ulong imm) { byte imm8 = ShrinkImm64(imm); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdIns.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdIns.cs index f362417801..1fd13fa9bc 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdIns.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdIns.cs @@ -1,12 +1,19 @@ -// #define SimdIns +#define SimdIns +using ARMeilleure.State; +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdIns")] public sealed class CpuTestSimdIns : CpuTest { + public CpuTestSimdIns(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdIns #region "ValueSource" @@ -81,12 +88,13 @@ namespace Ryujinx.Tests.Cpu } #endregion - [Test, Pairwise, Description("DUP ., W")] - public void Dup_Gp_W([Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_W_))] uint wn, - [Values(0, 1, 2)] int size, // Q0: <8B, 4H, 2S> - [Values(0b0u, 0b1u)] uint q) // Q1: <16B, 8H, 4S> + [SkippableTheory(DisplayName = "DUP ., W")] + [PairwiseData] + public void Dup_Gp_W([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_W_))] uint wn, + [CombinatorialValues(0, 1, 2)] int size, // Q0: <8B, 4H, 2S> + [CombinatorialValues(0b0u, 0b1u)] uint q) // Q1: <16B, 8H, 4S> { uint imm5 = (1u << size) & 0x1Fu; @@ -95,8 +103,8 @@ namespace Ryujinx.Tests.Cpu opcode |= (imm5 << 16); opcode |= ((q & 1) << 30); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + uint w31 = Random.Shared.NextUInt(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcode, x1: wn, x31: w31, v0: v0); @@ -104,16 +112,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP ., X")] - public void Dup_Gp_X([Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_X_))] ulong xn) + [SkippableTheory(DisplayName = "DUP ., X")] + [PairwiseData] + public void Dup_Gp_X([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_X_))] ulong xn) { uint opcode = 0x4E080C00; // DUP V0.2D, X0 opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcode, x1: xn, x31: x31, v0: v0); @@ -121,9 +130,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP B0, V1.B[]")] - public void Dup_S_B([ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 15u)] uint index) + [SkippableTheory(DisplayName = "DUP B0, V1.B[]")] + [PairwiseData] + public void Dup_S_B([CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 15u)] uint index) { const int TestSize = 0; @@ -132,7 +142,7 @@ namespace Ryujinx.Tests.Cpu uint opcode = 0x5E000420; // RESERVED opcode |= (imm5 << 16); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, a); @@ -141,9 +151,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP H0, V1.H[]")] - public void Dup_S_H([ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 7u)] uint index) + [SkippableTheory(DisplayName = "DUP H0, V1.H[]")] + [PairwiseData] + public void Dup_S_H([CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 7u)] uint index) { const int TestSize = 1; @@ -152,7 +163,7 @@ namespace Ryujinx.Tests.Cpu uint opcode = 0x5E000420; // RESERVED opcode |= (imm5 << 16); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, a); @@ -161,9 +172,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP S0, V1.S[]")] - public void Dup_S_S([ValueSource(nameof(_2S_))] ulong a, - [Values(0u, 1u, 2u, 3u)] uint index) + [SkippableTheory(DisplayName = "DUP S0, V1.S[]")] + [PairwiseData] + public void Dup_S_S([CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index) { const int TestSize = 2; @@ -172,7 +184,7 @@ namespace Ryujinx.Tests.Cpu uint opcode = 0x5E000420; // RESERVED opcode |= (imm5 << 16); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, a); @@ -181,9 +193,10 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP D0, V1.D[]")] - public void Dup_S_D([ValueSource(nameof(_1D_))] ulong a, - [Values(0u, 1u)] uint index) + [SkippableTheory(DisplayName = "DUP D0, V1.D[]")] + [PairwiseData] + public void Dup_S_D([CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(0u, 1u)] uint index) { const int TestSize = 3; @@ -192,7 +205,7 @@ namespace Ryujinx.Tests.Cpu uint opcode = 0x5E000420; // RESERVED opcode |= (imm5 << 16); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0E1(a, a); @@ -201,13 +214,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP ., .B[]")] - public void Dup_V_8B_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 15u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <8B, 16B> + [SkippableTheory(DisplayName = "DUP ., .B[]")] + [PairwiseData] + public void Dup_V_8B_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 15u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { const int TestSize = 0; @@ -226,13 +240,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP ., .H[]")] - public void Dup_V_4H_8H([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 7u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory(DisplayName = "DUP ., .H[]")] + [PairwiseData] + public void Dup_V_4H_8H([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 7u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { const int TestSize = 1; @@ -251,13 +266,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP ., .S[]")] - public void Dup_V_2S_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(0u, 1u, 2u, 3u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory(DisplayName = "DUP ., .S[]")] + [PairwiseData] + public void Dup_V_2S_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { const int TestSize = 2; @@ -276,13 +292,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("DUP ., .D[]")] - public void Dup_V_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(0u, 1u)] uint index, - [Values(0b1u)] uint q) // <2D> + [SkippableTheory(DisplayName = "DUP ., .D[]")] + [PairwiseData] + public void Dup_V_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(0u, 1u)] uint index, + [CombinatorialValues(0b1u)] uint q) // <2D> { const int TestSize = 3; @@ -301,12 +318,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .B[], W")] - public void Ins_Gp_WB([Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_W_))] uint wn, - [Values(0u, 15u)] uint index) + [SkippableTheory(DisplayName = "INS .B[], W")] + [PairwiseData] + public void Ins_Gp_WB([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_W_))] uint wn, + [CombinatorialValues(0u, 15u)] uint index) { const int TestSize = 0; @@ -316,7 +334,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcode, x1: wn, x31: w31, v0: v0); @@ -324,12 +342,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .H[], W")] - public void Ins_Gp_WH([Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_W_))] uint wn, - [Values(0u, 7u)] uint index) + [SkippableTheory(DisplayName = "INS .H[], W")] + [PairwiseData] + public void Ins_Gp_WH([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_W_))] uint wn, + [CombinatorialValues(0u, 7u)] uint index) { const int TestSize = 1; @@ -339,7 +358,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcode, x1: wn, x31: w31, v0: v0); @@ -347,12 +366,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .S[], W")] - public void Ins_Gp_WS([Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_W_))] uint wn, - [Values(0u, 1u, 2u, 3u)] uint index) + [SkippableTheory(DisplayName = "INS .S[], W")] + [PairwiseData] + public void Ins_Gp_WS([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_W_))] uint wn, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index) { const int TestSize = 2; @@ -362,7 +382,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + uint w31 = Random.Shared.NextUInt(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcode, x1: wn, x31: w31, v0: v0); @@ -370,12 +390,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .D[], X")] - public void Ins_Gp_XD([Values(0u)] uint rd, - [Values(1u, 31u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_X_))] ulong xn, - [Values(0u, 1u)] uint index) + [SkippableTheory(DisplayName = "INS .D[], X")] + [PairwiseData] + public void Ins_Gp_XD([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 31u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_X_))] ulong xn, + [CombinatorialValues(0u, 1u)] uint index) { const int TestSize = 3; @@ -385,7 +406,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); SingleOpcode(opcode, x1: xn, x31: x31, v0: v0); @@ -393,13 +414,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .B[], .B[]")] - public void Ins_V_BB([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 15u)] uint dstIndex, - [Values(0u, 15u)] uint srcIndex) + [SkippableTheory(DisplayName = "INS .B[], .B[]")] + [PairwiseData] + public void Ins_V_BB([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 15u)] uint dstIndex, + [CombinatorialValues(0u, 15u)] uint srcIndex) { const int TestSize = 0; @@ -419,13 +441,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .H[], .H[]")] - public void Ins_V_HH([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 7u)] uint dstIndex, - [Values(0u, 7u)] uint srcIndex) + [SkippableTheory(DisplayName = "INS .H[], .H[]")] + [PairwiseData] + public void Ins_V_HH([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 7u)] uint dstIndex, + [CombinatorialValues(0u, 7u)] uint srcIndex) { const int TestSize = 1; @@ -445,13 +468,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .S[], .S[]")] - public void Ins_V_SS([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(0u, 1u, 2u, 3u)] uint dstIndex, - [Values(0u, 1u, 2u, 3u)] uint srcIndex) + [SkippableTheory(DisplayName = "INS .S[], .S[]")] + [PairwiseData] + public void Ins_V_SS([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint dstIndex, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint srcIndex) { const int TestSize = 2; @@ -471,13 +495,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("INS .D[], .D[]")] - public void Ins_V_DD([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(0u, 1u)] uint dstIndex, - [Values(0u, 1u)] uint srcIndex) + [SkippableTheory(DisplayName = "INS .D[], .D[]")] + [PairwiseData] + public void Ins_V_DD([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(0u, 1u)] uint dstIndex, + [CombinatorialValues(0u, 1u)] uint srcIndex) { const int TestSize = 3; @@ -497,11 +522,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMOV , .B[]")] - public void Smov_S_BW([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 15u)] uint index) + [SkippableTheory(DisplayName = "SMOV , .B[]")] + [PairwiseData] + public void Smov_S_BW([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 15u)] uint index) { const int TestSize = 0; @@ -511,8 +537,8 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x0: x0, x31: w31, v1: v1); @@ -520,11 +546,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMOV , .H[]")] - public void Smov_S_HW([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 7u)] uint index) + [SkippableTheory(DisplayName = "SMOV , .H[]")] + [PairwiseData] + public void Smov_S_HW([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 7u)] uint index) { const int TestSize = 1; @@ -534,8 +561,8 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x0: x0, x31: w31, v1: v1); @@ -543,11 +570,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMOV , .B[]")] - public void Smov_S_BX([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 15u)] uint index) + [SkippableTheory(DisplayName = "SMOV , .B[]")] + [PairwiseData] + public void Smov_S_BX([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 15u)] uint index) { const int TestSize = 0; @@ -557,7 +585,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x31: x31, v1: v1); @@ -565,11 +593,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMOV , .H[]")] - public void Smov_S_HX([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 7u)] uint index) + [SkippableTheory(DisplayName = "SMOV , .H[]")] + [PairwiseData] + public void Smov_S_HX([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 7u)] uint index) { const int TestSize = 1; @@ -579,7 +608,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x31: x31, v1: v1); @@ -587,11 +616,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SMOV , .S[]")] - public void Smov_S_SX([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_2S_))] ulong a, - [Values(0u, 1u, 2u, 3u)] uint index) + [SkippableTheory(DisplayName = "SMOV , .S[]")] + [PairwiseData] + public void Smov_S_SX([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index) { const int TestSize = 2; @@ -601,7 +631,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x31: x31, v1: v1); @@ -609,11 +639,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UMOV , .B[]")] - public void Umov_S_BW([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 15u)] uint index) + [SkippableTheory(DisplayName = "UMOV , .B[]")] + [PairwiseData] + public void Umov_S_BW([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 15u)] uint index) { const int TestSize = 0; @@ -623,8 +654,8 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x0: x0, x31: w31, v1: v1); @@ -632,11 +663,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UMOV , .H[]")] - public void Umov_S_HW([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 7u)] uint index) + [SkippableTheory(DisplayName = "UMOV , .H[]")] + [PairwiseData] + public void Umov_S_HW([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 7u)] uint index) { const int TestSize = 1; @@ -646,8 +678,8 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x0: x0, x31: w31, v1: v1); @@ -655,11 +687,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UMOV , .S[]")] - public void Umov_S_SW([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_2S_))] ulong a, - [Values(0u, 1u, 2u, 3u)] uint index) + [SkippableTheory(DisplayName = "UMOV , .S[]")] + [PairwiseData] + public void Umov_S_SW([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index) { const int TestSize = 2; @@ -669,8 +702,8 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x0 = (ulong)TestContext.CurrentContext.Random.NextUInt() << 32; - uint w31 = TestContext.CurrentContext.Random.NextUInt(); + ulong x0 = (ulong)Random.Shared.NextUInt() << 32; + uint w31 = Random.Shared.NextUInt(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x0: x0, x31: w31, v1: v1); @@ -678,11 +711,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UMOV , .D[]")] - public void Umov_S_DX([Values(0u, 31u)] uint rd, - [Values(1u)] uint rn, - [ValueSource(nameof(_1D_))] ulong a, - [Values(0u, 1u)] uint index) + [SkippableTheory(DisplayName = "UMOV , .D[]")] + [PairwiseData] + public void Umov_S_DX([CombinatorialValues(0u, 31u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(0u, 1u)] uint index) { const int TestSize = 3; @@ -692,7 +726,7 @@ namespace Ryujinx.Tests.Cpu opcode |= ((rn & 31) << 5) | ((rd & 31) << 0); opcode |= (imm5 << 16); - ulong x31 = TestContext.CurrentContext.Random.NextULong(); + ulong x31 = Random.Shared.NextULong(); V128 v1 = MakeVectorE0E1(a, a); SingleOpcode(opcode, x31: x31, v1: v1); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdLogical32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdLogical32.cs index c0ccc2e3c2..d3ca6eadb1 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdLogical32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdLogical32.cs @@ -1,12 +1,18 @@ -// #define SimdLogical32 +#define SimdLogical32 +using ARMeilleure.State; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdLogical32")] public sealed class CpuTestSimdLogical32 : CpuTest32 { + public CpuTestSimdLogical32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdLogical32 #region "ValueSource (Types)" @@ -49,15 +55,16 @@ namespace Ryujinx.Tests.Cpu } #endregion - [Test, Pairwise] - public void Vbic_Vbif_Vbit_Vbsl_Vand_Vorn_Vorr_Veor_I([ValueSource(nameof(_Vbic_Vbif_Vbit_Vbsl_Vand_Vorn_Vorr_Veor_I_))] uint opcode, - [Range(0u, 5u)] uint rd, - [Range(0u, 5u)] uint rn, - [Range(0u, 5u)] uint rm, - [Values(ulong.MinValue, ulong.MaxValue)] ulong z, - [Values(ulong.MinValue, ulong.MaxValue)] ulong a, - [Values(ulong.MinValue, ulong.MaxValue)] ulong b, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vbic_Vbif_Vbit_Vbsl_Vand_Vorn_Vorr_Veor_I([CombinatorialMemberData(nameof(_Vbic_Vbif_Vbit_Vbsl_Vand_Vorn_Vorr_Veor_I_))] uint opcode, + [CombinatorialRange(0u, 5u, 1)] uint rd, + [CombinatorialRange(0u, 5u, 1)] uint rn, + [CombinatorialRange(0u, 5u, 1)] uint rm, + [CombinatorialValues(ulong.MinValue, ulong.MaxValue)] ulong z, + [CombinatorialValues(ulong.MinValue, ulong.MaxValue)] ulong a, + [CombinatorialValues(ulong.MinValue, ulong.MaxValue)] ulong b, + bool q) { if (q) { @@ -84,13 +91,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vbic_Vorr_II([ValueSource(nameof(_Vbic_Vorr_II_))] uint opcode, - [Values(0u, 1u)] uint rd, - [Values(ulong.MinValue, ulong.MaxValue)] ulong z, - [Values(byte.MinValue, byte.MaxValue)] byte imm, - [Values(0u, 1u, 2u, 3u)] uint cMode, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vbic_Vorr_II([CombinatorialMemberData(nameof(_Vbic_Vorr_II_))] uint opcode, + [CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(ulong.MinValue, ulong.MaxValue)] ulong z, + [CombinatorialValues(byte.MinValue, byte.MaxValue)] byte imm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint cMode, + bool q) { if ((opcode & 0x800) != 0) // cmode<3> == '1' (A2) { @@ -118,15 +126,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VTST.
, , ")] - public void Vtst([Range(0u, 5u)] uint rd, - [Range(0u, 5u)] uint rn, - [Range(0u, 5u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0u, 1u, 2u)] uint size, - [Values] bool q) + [Theory(DisplayName = "VTST.
, , ")] + [PairwiseData] + public void Vtst([CombinatorialRange(0u, 5u, 1)] uint rd, + [CombinatorialRange(0u, 5u, 1)] uint rn, + [CombinatorialRange(0u, 5u, 1)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0u, 1u, 2u)] uint size, + bool q) { uint opcode = 0xf2000810u; // VTST.8 D0, D0, D0 diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdMemory32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdMemory32.cs index 3de06b4778..d3d513d790 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdMemory32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdMemory32.cs @@ -1,12 +1,20 @@ -// #define SimdMemory32 +#define SimdMemory32 +using ARMeilleure.State; using Xunit; +using Ryujinx.Memory; +using System; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdMemory32")] public sealed class CpuTestSimdMemory32 : CpuTest32 { + public CpuTestSimdMemory32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + private static readonly uint _testOffset = DataBaseAddress + 0x500; #if SimdMemory32 @@ -32,14 +40,15 @@ namespace Ryujinx.Tests.Cpu 0b0001, }; - [Test, Pairwise, Description("VLDn. , [ {:}]{ /!/, } (single n element structure)")] - public void Vldn_Single([Values(0u, 1u, 2u)] uint size, - [Values(0u, 13u)] uint rn, - [Values(1u, 13u, 15u)] uint rm, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, - [Range(0u, 7u)] uint index, - [Range(0u, 3u)] uint n, - [Values(0x0u)] uint offset) + [Theory(DisplayName = "VLDn. , [ {:}]{ /!/, } (single n element structure)")] + [PairwiseData] + public void Vldn_Single([CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialValues(0u, 13u)] uint rn, + [CombinatorialValues(1u, 13u, 15u)] uint rm, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, + [CombinatorialRange(0u, 7u, 1)] uint index, + [CombinatorialRange(0u, 3u, 1)] uint n, + [CombinatorialValues(0x0u)] uint offset) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); @@ -62,14 +71,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VLDn. , [ {:}]{ /!/, } (all lanes)")] - public void Vldn_All([Values(0u, 13u)] uint rn, - [Values(1u, 13u, 15u)] uint rm, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, - [Range(0u, 3u)] uint n, - [Range(0u, 2u)] uint size, - [Values] bool t, - [Values(0x0u)] uint offset) + [Theory(DisplayName = "VLDn. , [ {:}]{ /!/, } (all lanes)")] + [PairwiseData] + public void Vldn_All([CombinatorialValues(0u, 13u)] uint rn, + [CombinatorialValues(1u, 13u, 15u)] uint rm, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, + [CombinatorialRange(0u, 3u, 1)] uint n, + [CombinatorialRange(0u, 2u, 1)] uint size, + bool t, + [CombinatorialValues(0x0u)] uint offset) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); @@ -92,13 +102,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VLDn. , [ {:}]{ /!/, } (multiple n element structures)")] - public void Vldn_Pair([Values(0u, 1u, 2u, 3u)] uint size, - [Values(0u, 13u)] uint rn, - [Values(1u, 13u, 15u)] uint rm, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, - [Range(0u, 10u)] uint mode, - [Values(0x0u)] uint offset) + [Theory(DisplayName = "VLDn. , [ {:}]{ /!/, } (multiple n element structures)")] + [PairwiseData] + public void Vldn_Pair([CombinatorialValues(0u, 1u, 2u, 3u)] uint size, + [CombinatorialValues(0u, 13u)] uint rn, + [CombinatorialValues(1u, 13u, 15u)] uint rm, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, + [CombinatorialRange(0u, 10u, 1)] uint mode, + [CombinatorialValues(0x0u)] uint offset) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); @@ -121,14 +132,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VSTn. , [ {:}]{ /!/, } (single n element structure)")] - public void Vstn_Single([Values(0u, 1u, 2u)] uint size, - [Values(0u, 13u)] uint rn, - [Values(1u, 13u, 15u)] uint rm, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, - [Range(0u, 7u)] uint index, - [Range(0u, 3u)] uint n, - [Values(0x0u)] uint offset) + [Theory(DisplayName = "VSTn. , [ {:}]{ /!/, } (single n element structure)")] + [PairwiseData] + public void Vstn_Single([CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialValues(0u, 13u)] uint rn, + [CombinatorialValues(1u, 13u, 15u)] uint rm, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, + [CombinatorialRange(0u, 7u, 1)] uint index, + [CombinatorialRange(0u, 3u, 1)] uint n, + [CombinatorialValues(0x0u)] uint offset) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); @@ -153,13 +165,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VSTn. , [ {:}]{ /!/, } (multiple n element structures)")] - public void Vstn_Pair([Values(0u, 1u, 2u, 3u)] uint size, - [Values(0u, 13u)] uint rn, - [Values(1u, 13u, 15u)] uint rm, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, - [Range(0u, 10u)] uint mode, - [Values(0x0u)] uint offset) + [Theory(DisplayName = "VSTn. , [ {:}]{ /!/, } (multiple n element structures)")] + [PairwiseData] + public void Vstn_Pair([CombinatorialValues(0u, 1u, 2u, 3u)] uint size, + [CombinatorialValues(0u, 13u)] uint rn, + [CombinatorialValues(1u, 13u, 15u)] uint rm, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, + [CombinatorialRange(0u, 10u, 1)] uint mode, + [CombinatorialValues(0x0u)] uint offset) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); @@ -184,12 +197,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VLDM. {!}, ")] - public void Vldm([Values(0u, 13u)] uint rn, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, - [Range(0u, 2u)] uint mode, - [Values(0x1u, 0x32u)] uint regs, - [Values] bool single) + [Theory(DisplayName = "VLDM. {!}, ")] + [PairwiseData] + public void Vldm([CombinatorialValues(0u, 13u)] uint rn, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint vd, + [CombinatorialRange(0u, 2u, 1)] uint mode, + [CombinatorialValues(0x1u, 0x32u)] uint regs, + bool single) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); @@ -236,12 +250,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VLDR. , [ {, #{+/-}}]")] - public void Vldr([Values(2u, 3u)] uint size, // FP16 is not supported for now - [Values(0u)] uint rn, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint sd, - [Values(0x0u)] uint imm, - [Values] bool sub) + [Theory(DisplayName = "VLDR. , [ {, #{+/-}}]")] + [PairwiseData] + public void Vldr([CombinatorialValues(2u, 3u)] uint size, // FP16 is not supported for now + [CombinatorialValues(0u)] uint rn, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint sd, + [CombinatorialValues(0x0u)] uint imm, + bool sub) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); @@ -271,12 +286,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VSTR. , [ {, #{+/-}}]")] - public void Vstr([Values(2u, 3u)] uint size, // FP16 is not supported for now - [Values(0u)] uint rn, - [Values(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint sd, - [Values(0x0u)] uint imm, - [Values] bool sub) + [Theory(DisplayName = "VSTR. , [ {, #{+/-}}]")] + [PairwiseData] + public void Vstr([CombinatorialValues(2u, 3u)] uint size, // FP16 is not supported for now + [CombinatorialValues(0u)] uint rn, + [CombinatorialValues(0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u)] uint sd, + [CombinatorialValues(0x0u)] uint imm, + bool sub) { var data = GenerateVectorSequence((int)MemoryBlock.GetPageSize()); SetWorkingMemory(0, data); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdMov32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdMov32.cs index b6cf0b86fc..9508bf3d18 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdMov32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdMov32.cs @@ -1,20 +1,28 @@ -// #define SimdMov32 +#define SimdMov32 +using ARMeilleure.State; +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdMov32")] public sealed class CpuTestSimdMov32 : CpuTest32 { + public CpuTestSimdMov32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdMov32 private const int RndCntImm = 2; - [Test, Pairwise, Description("VMOV.I
, #")] - public void Movi_V([Range(0u, 10u)] uint variant, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0x0u)] uint imm, - [Values] bool q) + [Theory(DisplayName = "VMOV.I
, #")] + [PairwiseData] + public void Movi_V([CombinatorialRange(0u, 10u, 1)] uint variant, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0x0u)] uint imm, + bool q) { uint[] variants = { @@ -58,10 +66,11 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMOV.F , #")] - public void Movi_S([Range(2u, 3u)] uint size, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0x0u)] uint imm) + [Theory(DisplayName = "VMOV.F , #")] + [PairwiseData] + public void Movi_S([CombinatorialRange(2u, 3u, 1)] uint size, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0x0u)] uint imm) { uint opcode = 0xeeb00800u; opcode |= (size & 3) << 8; @@ -83,13 +92,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMOV , ")] - public void Mov_GP([Values(0u, 1u, 2u, 3u)] uint vn, - [Values(0u, 1u, 2u, 3u)] uint rt, - [Random(RndCntImm)] uint valueRn, - [Random(RndCntImm)] ulong valueVn1, - [Random(RndCntImm)] ulong valueVn2, - [Values] bool op) + [Theory(DisplayName = "VMOV , ")] + [PairwiseData] + public void Mov_GP([CombinatorialValues(0u, 1u, 2u, 3u)] uint vn, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rt, + [CombinatorialRandomData(Count = RndCntImm)] uint valueRn, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn1, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn2, + bool op) { uint opcode = 0xee000a10u; // VMOV S0, R0 opcode |= (vn & 1) << 7; @@ -106,16 +116,30 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMOV. , ")] - public void Mov_GP_Elem([Range(0u, 7u)] uint vn, - [Values(0u, 1u, 2u, 3u)] uint rt, - [Range(0u, 2u)] uint size, - [Range(0u, 7u)] uint index, - [Random(1)] uint valueRn, - [Random(1)] ulong valueVn1, - [Random(1)] ulong valueVn2, - [Values] bool op, - [Values] bool u) + public static readonly uint[] RandomRn = + { + Random.Shared.NextUInt(), + }; + public static readonly ulong[] RandomVn1 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomVn2 = + { + Random.Shared.NextULong(), + }; + + [Theory(DisplayName = "VMOV. , ")] + [PairwiseData] + public void Mov_GP_Elem([CombinatorialRange(0u, 7u, 1)] uint vn, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rt, + [CombinatorialRange(0u, 2u, 1)] uint size, + [CombinatorialRange(0u, 7u, 1)] uint index, + [CombinatorialMemberData(nameof(RandomRn))] uint valueRn, + [CombinatorialMemberData(nameof(RandomVn1))] ulong valueVn1, + [CombinatorialMemberData(nameof(RandomVn2))] ulong valueVn2, + bool op, + bool u) { uint opcode = 0xee000b10u; // VMOV.32 D0[0], R0 @@ -153,15 +177,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("(VMOV , , ), (VMOV , , )")] - public void Mov_GP_D([Values(0u, 1u, 2u, 3u)] uint vm, - [Values(0u, 1u, 2u, 3u)] uint rt, - [Values(0u, 1u, 2u, 3u)] uint rt2, - [Random(RndCntImm)] uint valueRt1, - [Random(RndCntImm)] uint valueRt2, - [Random(RndCntImm)] ulong valueVn1, - [Random(RndCntImm)] ulong valueVn2, - [Values] bool op) + [Theory(DisplayName = "(VMOV , , ), (VMOV , , )")] + [PairwiseData] + public void Mov_GP_D([CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rt, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rt2, + [CombinatorialRandomData(Count = RndCntImm)] uint valueRt1, + [CombinatorialRandomData(Count = RndCntImm)] uint valueRt2, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn1, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn2, + bool op) { uint opcode = 0xec400b10u; // VMOV D0, R0, R0 opcode |= (vm & 0x10) << 1; @@ -179,15 +204,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("(VMOV , , , ), (VMOV , , , )")] - public void Mov_GP_2([Range(0u, 7u)] uint vm, - [Values(0u, 1u, 2u, 3u)] uint rt, - [Values(0u, 1u, 2u, 3u)] uint rt2, - [Random(RndCntImm)] uint valueRt1, - [Random(RndCntImm)] uint valueRt2, - [Random(RndCntImm)] ulong valueVn1, - [Random(RndCntImm)] ulong valueVn2, - [Values] bool op) + [Theory(DisplayName = "(VMOV , , , ), (VMOV , , , )")] + [PairwiseData] + public void Mov_GP_2([CombinatorialRange(0u, 7u, 1)] uint vm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rt, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rt2, + [CombinatorialRandomData(Count = RndCntImm)] uint valueRt1, + [CombinatorialRandomData(Count = RndCntImm)] uint valueRt2, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn1, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn2, + bool op) { uint opcode = 0xec400a10u; // VMOV S0, S1, R0, R0 opcode |= (vm & 1) << 5; @@ -205,10 +231,11 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMOVN.
, ")] - public void Movn_V([Range(0u, 1u, 2u)] uint size, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 2u, 4u, 8u)] uint vm) + [Theory(DisplayName = "VMOVN.
, ")] + [PairwiseData] + public void Movn_V([CombinatorialRange(0u, 1u, 2u)] uint size, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 2u, 4u, 8u)] uint vm) { uint opcode = 0xf3b20200u; // VMOVN.I16 D0, Q0 @@ -219,21 +246,22 @@ namespace Ryujinx.Tests.Cpu opcode |= ((vd & 0x10) << 18); opcode |= ((vd & 0xf) << 12); - V128 v0 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v0 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, v3: v3); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMOVL. , ")] - public void Vmovl([Values(0u, 1u, 2u, 3u)] uint vm, - [Values(0u, 2u, 4u, 6u)] uint vd, - [Values(1u, 2u, 4u)] uint imm3H, - [Values] bool u) + [Theory(DisplayName = "VMOVL. , ")] + [PairwiseData] + public void Vmovl([CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialValues(0u, 2u, 4u, 6u)] uint vd, + [CombinatorialValues(1u, 2u, 4u)] uint imm3H, + bool u) { // This is not VMOVL because imm3H = 0, but once // we shift in the imm3H value it turns into VMOVL. @@ -249,21 +277,22 @@ namespace Ryujinx.Tests.Cpu opcode |= 1 << 24; } - V128 v0 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v0 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, v3: v3); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMVN. , ")] - public void Vmvn([Range(0u, 1u, 2u)] uint size, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 2u, 4u, 8u)] uint vm, - [Values] bool q) + [Theory(DisplayName = "VMVN. , ")] + [PairwiseData] + public void Vmvn([CombinatorialRange(0u, 1u, 2u)] uint size, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 2u, 4u, 8u)] uint vm, + bool q) { uint opcode = 0xf3b00580u; // VMVN D0, D0 @@ -281,21 +310,22 @@ namespace Ryujinx.Tests.Cpu opcode |= (vd & 0x10) << 18; opcode |= (vd & 0xf) << 12; - V128 v0 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v0 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, v3: v3); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMVN.I
, #")] - public void Mvni_V([Range(0u, 7u)] uint variant, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0x0u)] uint imm, - [Values] bool q) + [Theory(DisplayName = "VMVN.I
, #")] + [PairwiseData] + public void Mvni_V([CombinatorialRange(0u, 7u, 1)] uint variant, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0x0u)] uint imm, + bool q) { uint[] variants = { @@ -335,11 +365,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VTRN. , ")] - public void Vtrn([Values(0u, 1u, 2u, 3u)] uint vm, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 1u, 2u)] uint size, - [Values] bool q) + [Theory(DisplayName = "VTRN. , ")] + [PairwiseData] + public void Vtrn([CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 1u, 2u)] uint size, + bool q) { uint opcode = 0xf3b20080u; // VTRN.8 D0, D0 if (vm == vd) @@ -360,21 +391,22 @@ namespace Ryujinx.Tests.Cpu opcode |= (vd & 0xf) << 12; opcode |= (size & 0x3) << 18; - V128 v0 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v0 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, v3: v3); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VZIP. , ")] - public void Vzip([Values(0u, 1u, 2u, 3u)] uint vm, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 1u, 2u)] uint size, - [Values] bool q) + [Theory(DisplayName = "VZIP. , ")] + [PairwiseData] + public void Vzip([CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 1u, 2u)] uint size, + bool q) { uint opcode = 0xf3b20180u; // VZIP.8 D0, D0 if (vm == vd || (size == 2 && !q)) @@ -395,21 +427,22 @@ namespace Ryujinx.Tests.Cpu opcode |= (vd & 0xf) << 12; opcode |= (size & 0x3) << 18; - V128 v0 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v0 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, v3: v3); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VUZP. , ")] - public void Vuzp([Values(0u, 1u, 2u, 3u)] uint vm, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 1u, 2u)] uint size, - [Values] bool q) + [Theory(DisplayName = "VUZP. , ")] + [PairwiseData] + public void Vuzp([CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 1u, 2u)] uint size, + bool q) { uint opcode = 0xf3b20100u; // VUZP.8 d0, d0 if (vm == vd || (size == 2 && !q)) @@ -430,22 +463,23 @@ namespace Ryujinx.Tests.Cpu opcode |= (vd & 0xf) << 12; opcode |= (size & 0x3) << 18; - V128 v0 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v0 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, v3: v3); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VTBL.8
, {list}, ")] - public void Vtbl([Range(0u, 6u)] uint vm, // Indices, include potentially invalid. - [Range(4u, 12u)] uint vn, // Selection. - [Values(0u, 1u)] uint vd, // Destinations. - [Range(0u, 3u)] uint length, - [Values] bool x) + [Theory(DisplayName = "VTBL.8
, {list}, ")] + [PairwiseData] + public void Vtbl([CombinatorialRange(0u, 6u, 1)] uint vm, // Indices, include potentially invalid. + [CombinatorialRange(4u, 12u, 1)] uint vn, // Selection. + [CombinatorialValues(0u, 1u)] uint vd, // Destinations. + [CombinatorialRange(0u, 3u, 1)] uint length, + bool x) { uint opcode = 0xf3b00800u; // VTBL.8 D0, {D0}, D0 if (vn + length > 31) @@ -466,11 +500,11 @@ namespace Ryujinx.Tests.Cpu opcode |= (vn & 0xf) << 16; opcode |= (length & 0x3) << 8; - var rnd = TestContext.CurrentContext.Random; - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v4 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v5 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + var rnd = Random.Shared; + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v4 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v5 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); byte maxIndex = (byte)(length * 8 - 1); byte[] b0 = new byte[16]; @@ -489,12 +523,13 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VEXT.8 {,} , , #")] - public void Vext([Values(0u, 1u, 2u, 3u)] uint vm, - [Values(0u, 1u, 2u, 3u)] uint vn, - [Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 15u)] uint imm4, - [Values] bool q) + [Theory(DisplayName = "VEXT.8 {,} , , #")] + [PairwiseData] + public void Vext([CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vn, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 15u)] uint imm4, + bool q) { uint opcode = 0xf2b00000; // VEXT.32 D0, D0, D0, #0 @@ -517,24 +552,25 @@ namespace Ryujinx.Tests.Cpu opcode |= (vn & 0xf) << 16; opcode |= (imm4 & 0xf) << 8; - V128 v0 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v0 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, v3: v3); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VDUP. , ")] - public void Vdup_GP([Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 1u, 2u, 3u)] uint rt, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCntImm)] uint valueRn, - [Random(RndCntImm)] ulong valueVn1, - [Random(RndCntImm)] ulong valueVn2, - [Values] bool q) + [Theory(DisplayName = "VDUP. , ")] + [PairwiseData] + public void Vdup_GP([CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rt, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCntImm)] uint valueRn, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn1, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn2, + bool q) { uint opcode = 0xee800b10; // VDUP.32 d0, r0 @@ -551,21 +587,22 @@ namespace Ryujinx.Tests.Cpu opcode |= (size & 1) << 5; // E opcode |= (size & 2) << 21; // B - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, r0: valueRn, r1: valueRn, r2: valueRn, r3: valueRn, v0: new V128(valueVn1, valueVn2), v1: v1); CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VDUP. , ")] - public void Vdup_S([Values(0u, 1u, 2u, 3u)] uint vd, - [Values(0u, 1u, 2u, 3u)] uint vm, - [Values(0u, 1u, 2u)] uint size, - [Range(0u, 7u)] uint index, - [Random(RndCntImm)] ulong valueVn1, - [Random(RndCntImm)] ulong valueVn2, - [Values] bool q) + [Theory(DisplayName = "VDUP. , ")] + [PairwiseData] + public void Vdup_S([CombinatorialValues(0u, 1u, 2u, 3u)] uint vd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint vm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRange(0u, 7u, 1)] uint index, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn1, + [CombinatorialRandomData(Count = RndCntImm)] ulong valueVn2, + bool q) { uint opcode = 0xf3b00c00; @@ -596,9 +633,9 @@ namespace Ryujinx.Tests.Cpu opcode |= imm4 << 16; - V128 v1 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v2 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); - V128 v3 = new(TestContext.CurrentContext.Random.NextULong(), TestContext.CurrentContext.Random.NextULong()); + V128 v1 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v2 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); + V128 v3 = new(Random.Shared.NextULong(), Random.Shared.NextULong()); SingleOpcode(opcode, v0: new V128(valueVn1, valueVn2), v1: v1, v2: v2, v3: v3); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs index a02d400e88..d2d83cc7e4 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg.cs @@ -1,12 +1,20 @@ -// #define SimdReg +#define SimdReg +using ARMeilleure.State; +using System; +using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdReg")] public sealed class CpuTestSimdReg : CpuTest { + public CpuTestSimdReg(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdReg #region "ValueSource (Types)" @@ -131,7 +139,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = GenNormalS(); ulong rnd2 = GenSubnormalS(); @@ -602,13 +610,14 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Test, Pairwise, Description("ADD , , ")] - public void Add_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "ADD , , ")] + [PairwiseData] + public void Add_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x5EE08400; // ADD D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -622,14 +631,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD ., ., .")] - public void Add_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "ADD ., ., .")] + [PairwiseData] + public void Add_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E208400; // ADD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -644,14 +654,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADD ., ., .")] - public void Add_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "ADD ., ., .")] + [PairwiseData] + public void Add_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E208400; // ADD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -666,14 +677,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDHN{2} ., ., .")] - public void Addhn_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "ADDHN{2} ., ., .")] + [PairwiseData] + public void Addhn_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x0E204000; // ADDHN V0.8B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -688,14 +700,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDHN{2} ., ., .")] - public void Addhn_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "ADDHN{2} ., ., .")] + [PairwiseData] + public void Addhn_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x4E204000; // ADDHN2 V0.16B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -710,14 +723,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDP ., ., .")] - public void Addp_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "ADDP ., ., .")] + [PairwiseData] + public void Addp_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E20BC00; // ADDP V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -732,14 +746,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ADDP ., ., .")] - public void Addp_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "ADDP ., ., .")] + [PairwiseData] + public void Addp_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E20BC00; // ADDP V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -754,13 +769,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("AND ., ., .")] - public void And_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "AND ., ., .")] + [PairwiseData] + public void And_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x0E201C00; // AND V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -774,13 +790,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("AND ., ., .")] - public void And_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "AND ., ., .")] + [PairwiseData] + public void And_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x4E201C00; // AND V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -794,13 +811,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BIC ., ., .")] - public void Bic_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BIC ., ., .")] + [PairwiseData] + public void Bic_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x0E601C00; // BIC V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -814,13 +832,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BIC ., ., .")] - public void Bic_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BIC ., ., .")] + [PairwiseData] + public void Bic_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x4E601C00; // BIC V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -834,13 +853,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BIF ., ., .")] - public void Bif_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BIF ., ., .")] + [PairwiseData] + public void Bif_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x2EE01C00; // BIF V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -854,13 +874,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BIF ., ., .")] - public void Bif_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BIF ., ., .")] + [PairwiseData] + public void Bif_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x6EE01C00; // BIF V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -874,13 +895,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BIT ., ., .")] - public void Bit_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BIT ., ., .")] + [PairwiseData] + public void Bit_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x2EA01C00; // BIT V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -894,13 +916,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BIT ., ., .")] - public void Bit_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BIT ., ., .")] + [PairwiseData] + public void Bit_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x6EA01C00; // BIT V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -914,13 +937,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BSL ., ., .")] - public void Bsl_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BSL ., ., .")] + [PairwiseData] + public void Bsl_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x2E601C00; // BSL V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -934,13 +958,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("BSL ., ., .")] - public void Bsl_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "BSL ., ., .")] + [PairwiseData] + public void Bsl_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x6E601C00; // BSL V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -954,13 +979,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMEQ , , ")] - public void Cmeq_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "CMEQ , , ")] + [PairwiseData] + public void Cmeq_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x7EE08C00; // CMEQ D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -974,14 +1000,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMEQ ., ., .")] - public void Cmeq_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMEQ ., ., .")] + [PairwiseData] + public void Cmeq_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E208C00; // CMEQ V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -996,14 +1023,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMEQ ., ., .")] - public void Cmeq_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMEQ ., ., .")] + [PairwiseData] + public void Cmeq_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E208C00; // CMEQ V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1018,13 +1046,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGE , , ")] - public void Cmge_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "CMGE , , ")] + [PairwiseData] + public void Cmge_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x5EE03C00; // CMGE D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1038,14 +1067,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGE ., ., .")] - public void Cmge_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMGE ., ., .")] + [PairwiseData] + public void Cmge_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E203C00; // CMGE V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1060,14 +1090,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGE ., ., .")] - public void Cmge_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMGE ., ., .")] + [PairwiseData] + public void Cmge_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E203C00; // CMGE V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1082,13 +1113,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGT , , ")] - public void Cmgt_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "CMGT , , ")] + [PairwiseData] + public void Cmgt_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x5EE03400; // CMGT D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1102,14 +1134,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGT ., ., .")] - public void Cmgt_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMGT ., ., .")] + [PairwiseData] + public void Cmgt_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E203400; // CMGT V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1124,14 +1157,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMGT ., ., .")] - public void Cmgt_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMGT ., ., .")] + [PairwiseData] + public void Cmgt_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E203400; // CMGT V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1146,13 +1180,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMHI , , ")] - public void Cmhi_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "CMHI , , ")] + [PairwiseData] + public void Cmhi_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x7EE03400; // CMHI D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1166,14 +1201,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMHI ., ., .")] - public void Cmhi_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMHI ., ., .")] + [PairwiseData] + public void Cmhi_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E203400; // CMHI V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1188,14 +1224,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMHI ., ., .")] - public void Cmhi_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMHI ., ., .")] + [PairwiseData] + public void Cmhi_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E203400; // CMHI V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1210,13 +1247,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMHS , , ")] - public void Cmhs_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "CMHS , , ")] + [PairwiseData] + public void Cmhs_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x7EE03C00; // CMHS D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1230,14 +1268,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMHS ., ., .")] - public void Cmhs_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMHS ., ., .")] + [PairwiseData] + public void Cmhs_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E203C00; // CMHS V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1252,14 +1291,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMHS ., ., .")] - public void Cmhs_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMHS ., ., .")] + [PairwiseData] + public void Cmhs_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E203C00; // CMHS V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1274,13 +1314,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMTST , , ")] - public void Cmtst_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "CMTST , , ")] + [PairwiseData] + public void Cmtst_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x5EE08C00; // CMTST D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1294,14 +1335,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMTST ., ., .")] - public void Cmtst_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "CMTST ., ., .")] + [PairwiseData] + public void Cmtst_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E208C00; // CMTST V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1316,14 +1358,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("CMTST ., ., .")] - public void Cmtst_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "CMTST ., ., .")] + [PairwiseData] + public void Cmtst_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E208C00; // CMTST V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1338,13 +1381,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("EOR ., ., .")] - public void Eor_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "EOR ., ., .")] + [PairwiseData] + public void Eor_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x2E201C00; // EOR V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1358,13 +1402,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("EOR ., ., .")] - public void Eor_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "EOR ., ., .")] + [PairwiseData] + public void Eor_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x6E201C00; // EOR V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1378,18 +1423,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_S([ValueSource(nameof(_F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_S([CombinatorialMemberData(nameof(_F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1399,18 +1444,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_D([ValueSource(nameof(_F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_D([CombinatorialMemberData(nameof(_F_Abd_Add_Div_Mul_Mulx_Nmul_Sub_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1420,16 +1465,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2S_4S([ValueSource(nameof(_F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2S_4S([CombinatorialMemberData(nameof(_F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -1438,7 +1483,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a * q); V128 v2 = MakeVectorE0E1(b, b * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1448,15 +1493,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2D([ValueSource(nameof(_F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2D([CombinatorialMemberData(nameof(_F_Abd_Add_Div_Mul_Mulx_Sub_P_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1464,7 +1509,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a); V128 v2 = MakeVectorE0E1(b, b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1474,18 +1519,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Dzc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_AcCm_EqGeGt_S_S([ValueSource(nameof(_F_AcCm_EqGeGt_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_AcCm_EqGeGt_S_S([CombinatorialMemberData(nameof(_F_AcCm_EqGeGt_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1494,18 +1539,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_AcCm_EqGeGt_S_D([ValueSource(nameof(_F_AcCm_EqGeGt_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_AcCm_EqGeGt_S_D([CombinatorialMemberData(nameof(_F_AcCm_EqGeGt_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1514,16 +1559,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_AcCm_EqGeGt_V_2S_4S([ValueSource(nameof(_F_AcCm_EqGeGt_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_AcCm_EqGeGt_V_2S_4S([CombinatorialMemberData(nameof(_F_AcCm_EqGeGt_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -1532,7 +1577,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a * q); V128 v2 = MakeVectorE0E1(b, b * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1541,15 +1586,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_AcCm_EqGeGt_V_2D([ValueSource(nameof(_F_AcCm_EqGeGt_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_AcCm_EqGeGt_V_2D([CombinatorialMemberData(nameof(_F_AcCm_EqGeGt_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1557,7 +1602,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a); V128 v2 = MakeVectorE0E1(b, b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); @@ -1566,38 +1611,38 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Cmp_Cmpe_S_S([ValueSource(nameof(_F_Cmp_Cmpe_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Cmp_Cmpe_S_S([CombinatorialMemberData(nameof(_F_Cmp_Cmpe_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b) { V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - bool v = TestContext.CurrentContext.Random.NextBool(); - bool c = TestContext.CurrentContext.Random.NextBool(); - bool z = TestContext.CurrentContext.Random.NextBool(); - bool n = TestContext.CurrentContext.Random.NextBool(); + bool v = Random.Shared.NextBool(); + bool c = Random.Shared.NextBool(); + bool z = Random.Shared.NextBool(); + bool n = Random.Shared.NextBool(); SingleOpcode(opcodes, v1: v1, v2: v2, overflow: v, carry: c, zero: z, negative: n); CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc); } - [Test, Pairwise] - [Explicit] - public void F_Cmp_Cmpe_S_D([ValueSource(nameof(_F_Cmp_Cmpe_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Cmp_Cmpe_S_D([CombinatorialMemberData(nameof(_F_Cmp_Cmpe_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - bool v = TestContext.CurrentContext.Random.NextBool(); - bool c = TestContext.CurrentContext.Random.NextBool(); - bool z = TestContext.CurrentContext.Random.NextBool(); - bool n = TestContext.CurrentContext.Random.NextBool(); + bool v = Random.Shared.NextBool(); + bool c = Random.Shared.NextBool(); + bool z = Random.Shared.NextBool(); + bool n = Random.Shared.NextBool(); SingleOpcode(opcodes, v1: v1, v2: v2, overflow: v, carry: c, zero: z, negative: n); @@ -1605,20 +1650,20 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Madd_Msub_Nmadd_Nmsub_S_S([ValueSource(nameof(_F_Madd_Msub_Nmadd_Nmsub_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b, - [ValueSource(nameof(_1S_F_))] ulong c) + [SkippableTheory] + [PairwiseData] + public void F_Madd_Msub_Nmadd_Nmsub_S_S([CombinatorialMemberData(nameof(_F_Madd_Msub_Nmadd_Nmsub_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b, + [CombinatorialMemberData(nameof(_1S_F_))] ulong c) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); V128 v3 = MakeVectorE0(c); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1629,20 +1674,20 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Madd_Msub_Nmadd_Nmsub_S_D([ValueSource(nameof(_F_Madd_Msub_Nmadd_Nmsub_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b, - [ValueSource(nameof(_1D_F_))] ulong c) + [SkippableTheory] + [PairwiseData] + public void F_Madd_Msub_Nmadd_Nmsub_S_D([CombinatorialMemberData(nameof(_F_Madd_Msub_Nmadd_Nmsub_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b, + [CombinatorialMemberData(nameof(_1D_F_))] ulong c) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); V128 v3 = MakeVectorE0(c); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1652,18 +1697,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(Fpsr.Ioc | Fpsr.Idc, FpSkips.IfUnderflow, FpTolerances.UpToOneUlpsD); } - [Test, Pairwise] - [Explicit] - public void F_Max_Min_Nm_S_S([ValueSource(nameof(_F_Max_Min_Nm_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Max_Min_Nm_S_S([CombinatorialMemberData(nameof(_F_Max_Min_Nm_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1673,18 +1718,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Max_Min_Nm_S_D([ValueSource(nameof(_F_Max_Min_Nm_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Max_Min_Nm_S_D([CombinatorialMemberData(nameof(_F_Max_Min_Nm_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1694,16 +1739,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Max_Min_Nm_P_V_2S_4S([ValueSource(nameof(_F_Max_Min_Nm_P_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Max_Min_Nm_P_V_2S_4S([CombinatorialMemberData(nameof(_F_Max_Min_Nm_P_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -1712,7 +1757,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a * q); V128 v2 = MakeVectorE0E1(b, b * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1722,15 +1767,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Max_Min_Nm_P_V_2D([ValueSource(nameof(_F_Max_Min_Nm_P_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Max_Min_Nm_P_V_2D([CombinatorialMemberData(nameof(_F_Max_Min_Nm_P_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1738,7 +1783,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a); V128 v2 = MakeVectorE0E1(b, b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1749,16 +1794,16 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Mla_Mls_V_2S_4S([ValueSource(nameof(_F_Mla_Mls_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Mla_Mls_V_2S_4S([CombinatorialMemberData(nameof(_F_Mla_Mls_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -1767,7 +1812,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a * q); V128 v2 = MakeVectorE0E1(b, b * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1778,15 +1823,15 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Mla_Mls_V_2D([ValueSource(nameof(_F_Mla_Mls_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Mla_Mls_V_2D([CombinatorialMemberData(nameof(_F_Mla_Mls_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1794,7 +1839,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a); V128 v2 = MakeVectorE0E1(b, b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1805,18 +1850,18 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Recps_Rsqrts_S_S([ValueSource(nameof(_F_Recps_Rsqrts_S_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Recps_Rsqrts_S_S([CombinatorialMemberData(nameof(_F_Recps_Rsqrts_S_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1827,18 +1872,18 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Recps_Rsqrts_S_D([ValueSource(nameof(_F_Recps_Rsqrts_S_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Recps_Rsqrts_S_D([CombinatorialMemberData(nameof(_F_Recps_Rsqrts_S_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1849,16 +1894,16 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Recps_Rsqrts_V_2S_4S([ValueSource(nameof(_F_Recps_Rsqrts_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Recps_Rsqrts_V_2S_4S([CombinatorialMemberData(nameof(_F_Recps_Rsqrts_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -1867,7 +1912,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a * q); V128 v2 = MakeVectorE0E1(b, b * q); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1878,15 +1923,15 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Recps_Rsqrts_V_2D([ValueSource(nameof(_F_Recps_Rsqrts_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void F_Recps_Rsqrts_V_2D([CombinatorialMemberData(nameof(_F_Recps_Rsqrts_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1894,7 +1939,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a); V128 v2 = MakeVectorE0E1(b, b); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -1904,15 +1949,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(Fpsr.Ioc | Fpsr.Idc, FpSkips.IfUnderflow, FpTolerances.UpToOneUlpsD); } - [Test, Pairwise] - public void Mla_Mls_Mul_V_8B_4H_2S([ValueSource(nameof(_Mla_Mls_Mul_V_8B_4H_2S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory] + [PairwiseData] + public void Mla_Mls_Mul_V_8B_4H_2S([CombinatorialMemberData(nameof(_Mla_Mls_Mul_V_8B_4H_2S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -1926,15 +1972,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Mla_Mls_Mul_V_16B_8H_4S([ValueSource(nameof(_Mla_Mls_Mul_V_16B_8H_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory] + [PairwiseData] + public void Mla_Mls_Mul_V_16B_8H_4S([CombinatorialMemberData(nameof(_Mla_Mls_Mul_V_16B_8H_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -1948,13 +1995,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ORN ., ., .")] - public void Orn_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "ORN ., ., .")] + [PairwiseData] + public void Orn_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x0EE01C00; // ORN V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1968,13 +2016,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ORN ., ., .")] - public void Orn_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "ORN ., ., .")] + [PairwiseData] + public void Orn_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x4EE01C00; // ORN V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -1988,13 +2037,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ORR ., ., .")] - public void Orr_V_8B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "ORR ., ., .")] + [PairwiseData] + public void Orr_V_8B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x0EA01C00; // ORR V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2008,13 +2058,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ORR ., ., .")] - public void Orr_V_16B([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [ValueSource(nameof(_8B_))] ulong b) + [SkippableTheory(DisplayName = "ORR ., ., .")] + [PairwiseData] + public void Orr_V_16B([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialMemberData(nameof(_8B_))] ulong b) { uint opcode = 0x4EA01C00; // ORR V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2028,18 +2079,19 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("PMULL{2} ., ., .")] - public void Pmull_V([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B1D_))] ulong z0, - [ValueSource(nameof(_8B1D_))] ulong z1, - [ValueSource(nameof(_8B1D_))] ulong a0, - [ValueSource(nameof(_8B1D_))] ulong a1, - [ValueSource(nameof(_8B1D_))] ulong b0, - [ValueSource(nameof(_8B1D_))] ulong b1, - [Values(0b00u, 0b11u)] uint size, // Q0: <8B, 1D> => <8H, 1Q> - [Values(0b0u, 0b1u)] uint q) // Q1: <16B, 2D> => <8H, 1Q> + [SkippableTheory(DisplayName = "PMULL{2} ., ., .")] + [PairwiseData] + public void Pmull_V([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B1D_))] ulong z0, + [CombinatorialMemberData(nameof(_8B1D_))] ulong z1, + [CombinatorialMemberData(nameof(_8B1D_))] ulong a0, + [CombinatorialMemberData(nameof(_8B1D_))] ulong a1, + [CombinatorialMemberData(nameof(_8B1D_))] ulong b0, + [CombinatorialMemberData(nameof(_8B1D_))] ulong b1, + [CombinatorialValues(0b00u, 0b11u)] uint size, // Q0: <8B, 1D> => <8H, 1Q> + [CombinatorialValues(0b0u, 0b1u)] uint q) // Q1: <16B, 2D> => <8H, 1Q> { uint opcode = 0x0E20E000; // PMULL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2055,14 +2107,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("RADDHN{2} ., ., .")] - public void Raddhn_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "RADDHN{2} ., ., .")] + [PairwiseData] + public void Raddhn_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x2E204000; // RADDHN V0.8B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2077,14 +2130,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("RADDHN{2} ., ., .")] - public void Raddhn_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "RADDHN{2} ., ., .")] + [PairwiseData] + public void Raddhn_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x6E204000; // RADDHN2 V0.16B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2099,14 +2153,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("RSUBHN{2} ., ., .")] - public void Rsubhn_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "RSUBHN{2} ., ., .")] + [PairwiseData] + public void Rsubhn_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x2E206000; // RSUBHN V0.8B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2121,14 +2176,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("RSUBHN{2} ., ., .")] - public void Rsubhn_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "RSUBHN{2} ., ., .")] + [PairwiseData] + public void Rsubhn_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x6E206000; // RSUBHN2 V0.16B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2143,14 +2199,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABA ., ., .")] - public void Saba_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SABA ., ., .")] + [PairwiseData] + public void Saba_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E207C00; // SABA V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2165,14 +2222,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABA ., ., .")] - public void Saba_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "SABA ., ., .")] + [PairwiseData] + public void Saba_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x4E207C00; // SABA V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2187,14 +2245,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABAL{2} ., ., .")] - public void Sabal_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "SABAL{2} ., ., .")] + [PairwiseData] + public void Sabal_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x0E205000; // SABAL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2209,14 +2268,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABAL{2} ., ., .")] - public void Sabal_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "SABAL{2} ., ., .")] + [PairwiseData] + public void Sabal_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x4E205000; // SABAL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2231,14 +2291,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABD ., ., .")] - public void Sabd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SABD ., ., .")] + [PairwiseData] + public void Sabd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E207400; // SABD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2253,14 +2314,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABD ., ., .")] - public void Sabd_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "SABD ., ., .")] + [PairwiseData] + public void Sabd_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x4E207400; // SABD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2275,14 +2337,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABDL{2} ., ., .")] - public void Sabdl_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "SABDL{2} ., ., .")] + [PairwiseData] + public void Sabdl_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x0E207000; // SABDL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2297,14 +2360,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SABDL{2} ., ., .")] - public void Sabdl_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "SABDL{2} ., ., .")] + [PairwiseData] + public void Sabdl_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x4E207000; // SABDL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2319,14 +2383,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADDL{2} ., ., .")] - public void Saddl_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "SADDL{2} ., ., .")] + [PairwiseData] + public void Saddl_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x0E200000; // SADDL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2341,14 +2406,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADDL{2} ., ., .")] - public void Saddl_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "SADDL{2} ., ., .")] + [PairwiseData] + public void Saddl_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x4E200000; // SADDL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2363,14 +2429,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADDW{2} ., ., .")] - public void Saddw_V_8B8H8H_4H4S4S_2S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> + [SkippableTheory(DisplayName = "SADDW{2} ., ., .")] + [PairwiseData] + public void Saddw_V_8B8H8H_4H4S4S_2S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> { uint opcode = 0x0E201000; // SADDW V0.8H, V0.8H, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2385,14 +2452,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SADDW{2} ., ., .")] - public void Saddw_V_16B8H8H_8H4S4S_4S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> + [SkippableTheory(DisplayName = "SADDW{2} ., ., .")] + [PairwiseData] + public void Saddw_V_16B8H8H_8H4S4S_4S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> { uint opcode = 0x4E201000; // SADDW2 V0.8H, V0.8H, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2407,14 +2475,40 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Sha1c_Sha1m_Sha1p_Sha1su0_V([ValueSource(nameof(_Sha1c_Sha1m_Sha1p_Sha1su0_V_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [Random(RndCnt / 2)] ulong z0, [Random(RndCnt / 2)] ulong z1, - [Random(RndCnt / 2)] ulong a0, [Random(RndCnt / 2)] ulong a1, - [Random(RndCnt / 2)] ulong b0, [Random(RndCnt / 2)] ulong b1) + public static readonly ulong[] RandomZ0 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomZ1 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomA0 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomA1 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomB0 = + { + Random.Shared.NextULong(), + }; + public static readonly ulong[] RandomB1 = + { + Random.Shared.NextULong(), + }; + + [SkippableTheory] + [PairwiseData] + public void Sha1c_Sha1m_Sha1p_Sha1su0_V([CombinatorialMemberData(nameof(_Sha1c_Sha1m_Sha1p_Sha1su0_V_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(RandomZ0))] ulong z0, [CombinatorialMemberData(nameof(RandomZ1))] ulong z1, + [CombinatorialMemberData(nameof(RandomA0))] ulong a0, [CombinatorialMemberData(nameof(RandomA1))] ulong a1, + [CombinatorialMemberData(nameof(RandomB0))] ulong b0, [CombinatorialMemberData(nameof(RandomB1))] ulong b1) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2427,14 +2521,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Sha256h_Sha256h2_Sha256su1_V([ValueSource(nameof(_Sha256h_Sha256h2_Sha256su1_V_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [Random(RndCnt / 2)] ulong z0, [Random(RndCnt / 2)] ulong z1, - [Random(RndCnt / 2)] ulong a0, [Random(RndCnt / 2)] ulong a1, - [Random(RndCnt / 2)] ulong b0, [Random(RndCnt / 2)] ulong b1) + [SkippableTheory] + [PairwiseData] + public void Sha256h_Sha256h2_Sha256su1_V([CombinatorialMemberData(nameof(_Sha256h_Sha256h2_Sha256su1_V_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(RandomZ0))] ulong z0, [CombinatorialMemberData(nameof(RandomZ1))] ulong z1, + [CombinatorialMemberData(nameof(RandomA0))] ulong a0, [CombinatorialMemberData(nameof(RandomA1))] ulong a1, + [CombinatorialMemberData(nameof(RandomB0))] ulong b0, [CombinatorialMemberData(nameof(RandomB1))] ulong b1) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2447,14 +2542,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SHADD ., ., .")] - public void Shadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SHADD ., ., .")] + [PairwiseData] + public void Shadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E200400; // SHADD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2469,14 +2565,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SHADD ., ., .")] - public void Shadd_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "SHADD ., ., .")] + [PairwiseData] + public void Shadd_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x4E200400; // SHADD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2491,14 +2588,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SHSUB ., ., .")] - public void Shsub_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SHSUB ., ., .")] + [PairwiseData] + public void Shsub_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E202400; // SHSUB V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2513,14 +2611,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SHSUB ., ., .")] - public void Shsub_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "SHSUB ., ., .")] + [PairwiseData] + public void Shsub_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x4E202400; // SHSUB V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2535,16 +2634,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Max_Min_P_V([ValueSource(nameof(_SU_Max_Min_P_V_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size, // Q0: <8B, 4H, 2S> - [Values(0b0u, 0b1u)] uint q) // Q1: <16B, 8H, 4S> + [SkippableTheory] + [PairwiseData] + public void SU_Max_Min_P_V([CombinatorialMemberData(nameof(_SU_Max_Min_P_V_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size, // Q0: <8B, 4H, 2S> + [CombinatorialValues(0b0u, 0b1u)] uint q) // Q1: <16B, 8H, 4S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -2559,15 +2659,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Mlal_Mlsl_Mull_V_8B8H_4H4S_2S2D([ValueSource(nameof(_SU_Mlal_Mlsl_Mull_V_8B8H_4H4S_2S2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory] + [PairwiseData] + public void SU_Mlal_Mlsl_Mull_V_8B8H_4H4S_2S2D([CombinatorialMemberData(nameof(_SU_Mlal_Mlsl_Mull_V_8B8H_4H4S_2S2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -2581,15 +2682,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Mlal_Mlsl_Mull_V_16B8H_8H4S_4S2D([ValueSource(nameof(_SU_Mlal_Mlsl_Mull_V_16B8H_8H4S_4S2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory] + [PairwiseData] + public void SU_Mlal_Mlsl_Mull_V_16B8H_8H4S_4S2D([CombinatorialMemberData(nameof(_SU_Mlal_Mlsl_Mull_V_16B8H_8H4S_4S2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -2603,14 +2705,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SQADD , , ")] - public void Sqadd_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [ValueSource(nameof(_1B1H1S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "SQADD , , ")] + [PairwiseData] + public void Sqadd_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x5E200C00; // SQADD B0, B0, B0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2625,14 +2728,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQADD ., ., .")] - public void Sqadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SQADD ., ., .")] + [PairwiseData] + public void Sqadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E200C00; // SQADD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2647,14 +2751,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQADD ., ., .")] - public void Sqadd_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "SQADD ., ., .")] + [PairwiseData] + public void Sqadd_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E200C00; // SQADD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2669,14 +2774,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQDMULH , , ")] - public void Sqdmulh_S_H_S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1H1S_))] ulong z, - [ValueSource(nameof(_1H1S_))] ulong a, - [ValueSource(nameof(_1H1S_))] ulong b, - [Values(0b01u, 0b10u)] uint size) // + [SkippableTheory(DisplayName = "SQDMULH , , ")] + [PairwiseData] + public void Sqdmulh_S_H_S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1H1S_))] ulong z, + [CombinatorialMemberData(nameof(_1H1S_))] ulong a, + [CombinatorialMemberData(nameof(_1H1S_))] ulong b, + [CombinatorialValues(0b01u, 0b10u)] uint size) // { uint opcode = 0x5E20B400; // SQDMULH B0, B0, B0 (RESERVED) opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2691,14 +2797,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQDMULH ., ., .")] - public void Sqdmulh_V_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S_))] ulong z, - [ValueSource(nameof(_4H2S_))] ulong a, - [ValueSource(nameof(_4H2S_))] ulong b, - [Values(0b01u, 0b10u)] uint size) // <4H, 2S> + [SkippableTheory(DisplayName = "SQDMULH ., ., .")] + [PairwiseData] + public void Sqdmulh_V_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S_))] ulong b, + [CombinatorialValues(0b01u, 0b10u)] uint size) // <4H, 2S> { uint opcode = 0x0E20B400; // SQDMULH V0.8B, V0.8B, V0.8B (RESERVED) opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2713,14 +2820,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQDMULH ., ., .")] - public void Sqdmulh_V_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S_))] ulong z, - [ValueSource(nameof(_4H2S_))] ulong a, - [ValueSource(nameof(_4H2S_))] ulong b, - [Values(0b01u, 0b10u)] uint size) // <8H, 4S> + [SkippableTheory(DisplayName = "SQDMULH ., ., .")] + [PairwiseData] + public void Sqdmulh_V_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S_))] ulong b, + [CombinatorialValues(0b01u, 0b10u)] uint size) // <8H, 4S> { uint opcode = 0x4E20B400; // SQDMULH V0.16B, V0.16B, V0.16B (RESERVED) opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2735,14 +2843,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQRDMULH , , ")] - public void Sqrdmulh_S_H_S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1H1S_))] ulong z, - [ValueSource(nameof(_1H1S_))] ulong a, - [ValueSource(nameof(_1H1S_))] ulong b, - [Values(0b01u, 0b10u)] uint size) // + [SkippableTheory(DisplayName = "SQRDMULH , , ")] + [PairwiseData] + public void Sqrdmulh_S_H_S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1H1S_))] ulong z, + [CombinatorialMemberData(nameof(_1H1S_))] ulong a, + [CombinatorialMemberData(nameof(_1H1S_))] ulong b, + [CombinatorialValues(0b01u, 0b10u)] uint size) // { uint opcode = 0x7E20B400; // SQRDMULH B0, B0, B0 (RESERVED) opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2757,14 +2866,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQRDMULH ., ., .")] - public void Sqrdmulh_V_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S_))] ulong z, - [ValueSource(nameof(_4H2S_))] ulong a, - [ValueSource(nameof(_4H2S_))] ulong b, - [Values(0b01u, 0b10u)] uint size) // <4H, 2S> + [SkippableTheory(DisplayName = "SQRDMULH ., ., .")] + [PairwiseData] + public void Sqrdmulh_V_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S_))] ulong b, + [CombinatorialValues(0b01u, 0b10u)] uint size) // <4H, 2S> { uint opcode = 0x2E20B400; // SQRDMULH V0.8B, V0.8B, V0.8B (RESERVED) opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2779,14 +2889,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQRDMULH ., ., .")] - public void Sqrdmulh_V_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S_))] ulong z, - [ValueSource(nameof(_4H2S_))] ulong a, - [ValueSource(nameof(_4H2S_))] ulong b, - [Values(0b01u, 0b10u)] uint size) // <8H, 4S> + [SkippableTheory(DisplayName = "SQRDMULH ., ., .")] + [PairwiseData] + public void Sqrdmulh_V_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S_))] ulong b, + [CombinatorialValues(0b01u, 0b10u)] uint size) // <8H, 4S> { uint opcode = 0x6E20B400; // SQRDMULH V0.16B, V0.16B, V0.16B (RESERVED) opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2801,14 +2912,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQSUB , , ")] - public void Sqsub_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [ValueSource(nameof(_1B1H1S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "SQSUB , , ")] + [PairwiseData] + public void Sqsub_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x5E202C00; // SQSUB B0, B0, B0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2823,14 +2935,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQSUB ., ., .")] - public void Sqsub_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SQSUB ., ., .")] + [PairwiseData] + public void Sqsub_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E202C00; // SQSUB V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2845,14 +2958,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SQSUB ., ., .")] - public void Sqsub_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "SQSUB ., ., .")] + [PairwiseData] + public void Sqsub_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E202C00; // SQSUB V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2867,14 +2981,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SRHADD ., ., .")] - public void Srhadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SRHADD ., ., .")] + [PairwiseData] + public void Srhadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E201400; // SRHADD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2889,14 +3004,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SRHADD ., ., .")] - public void Srhadd_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "SRHADD ., ., .")] + [PairwiseData] + public void Srhadd_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x4E201400; // SRHADD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2911,14 +3027,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShlReg_S_D([ValueSource(nameof(_ShlReg_S_D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory] + [PairwiseData] + public void ShlReg_S_D([CombinatorialMemberData(nameof(_ShlReg_S_D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2931,15 +3048,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void ShlReg_V_8B_4H_2S([ValueSource(nameof(_ShlReg_V_8B_4H_2S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory] + [PairwiseData] + public void ShlReg_V_8B_4H_2S([CombinatorialMemberData(nameof(_ShlReg_V_8B_4H_2S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -2953,15 +3071,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void ShlReg_V_16B_8H_4S_2D([ValueSource(nameof(_ShlReg_V_16B_8H_4S_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory] + [PairwiseData] + public void ShlReg_V_16B_8H_4S_2D([CombinatorialMemberData(nameof(_ShlReg_V_16B_8H_4S_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((size & 3) << 22); @@ -2975,14 +3094,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("SSUBL{2} ., ., .")] - public void Ssubl_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "SSUBL{2} ., ., .")] + [PairwiseData] + public void Ssubl_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x0E202000; // SSUBL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -2997,14 +3117,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SSUBL{2} ., ., .")] - public void Ssubl_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "SSUBL{2} ., ., .")] + [PairwiseData] + public void Ssubl_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x4E202000; // SSUBL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3019,14 +3140,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SSUBW{2} ., ., .")] - public void Ssubw_V_8B8H8H_4H4S4S_2S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> + [SkippableTheory(DisplayName = "SSUBW{2} ., ., .")] + [PairwiseData] + public void Ssubw_V_8B8H8H_4H4S4S_2S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> { uint opcode = 0x0E203000; // SSUBW V0.8H, V0.8H, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3041,14 +3163,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SSUBW{2} ., ., .")] - public void Ssubw_V_16B8H8H_8H4S4S_4S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> + [SkippableTheory(DisplayName = "SSUBW{2} ., ., .")] + [PairwiseData] + public void Ssubw_V_16B8H8H_8H4S4S_4S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> { uint opcode = 0x4E203000; // SSUBW2 V0.8H, V0.8H, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3063,13 +3186,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB , , ")] - public void Sub_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [ValueSource(nameof(_1D_))] ulong b) + [SkippableTheory(DisplayName = "SUB , , ")] + [PairwiseData] + public void Sub_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialMemberData(nameof(_1D_))] ulong b) { uint opcode = 0x7EE08400; // SUB D0, D0, D0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3083,14 +3207,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB ., ., .")] - public void Sub_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "SUB ., ., .")] + [PairwiseData] + public void Sub_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E208400; // SUB V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3105,14 +3230,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUB ., ., .")] - public void Sub_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "SUB ., ., .")] + [PairwiseData] + public void Sub_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E208400; // SUB V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3127,14 +3253,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBHN{2} ., ., .")] - public void Subhn_V_8H8B_4S4H_2D2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> + [SkippableTheory(DisplayName = "SUBHN{2} ., ., .")] + [PairwiseData] + public void Subhn_V_8H8B_4S4H_2D2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S> { uint opcode = 0x0E206000; // SUBHN V0.8B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3149,14 +3276,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SUBHN{2} ., ., .")] - public void Subhn_V_8H16B_4S8H_2D4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))] ulong a, - [ValueSource(nameof(_4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> + [SkippableTheory(DisplayName = "SUBHN{2} ., ., .")] + [PairwiseData] + public void Subhn_V_8H16B_4S8H_2D4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S> { uint opcode = 0x4E206000; // SUBHN2 V0.16B, V0.8H, V0.8H opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3171,14 +3299,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("TRN1 ., ., .")] - public void Trn1_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "TRN1 ., ., .")] + [PairwiseData] + public void Trn1_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E002800; // TRN1 V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3193,14 +3322,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("TRN1 ., ., .")] - public void Trn1_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "TRN1 ., ., .")] + [PairwiseData] + public void Trn1_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E002800; // TRN1 V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3215,14 +3345,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("TRN2 ., ., .")] - public void Trn2_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "TRN2 ., ., .")] + [PairwiseData] + public void Trn2_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E006800; // TRN2 V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3237,14 +3368,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("TRN2 ., ., .")] - public void Trn2_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "TRN2 ., ., .")] + [PairwiseData] + public void Trn2_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E006800; // TRN2 V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3259,14 +3391,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABA ., ., .")] - public void Uaba_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UABA ., ., .")] + [PairwiseData] + public void Uaba_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E207C00; // UABA V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3281,14 +3414,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABA ., ., .")] - public void Uaba_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "UABA ., ., .")] + [PairwiseData] + public void Uaba_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x6E207C00; // UABA V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3303,14 +3437,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABAL{2} ., ., .")] - public void Uabal_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "UABAL{2} ., ., .")] + [PairwiseData] + public void Uabal_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x2E205000; // UABAL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3325,14 +3460,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABAL{2} ., ., .")] - public void Uabal_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "UABAL{2} ., ., .")] + [PairwiseData] + public void Uabal_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x6E205000; // UABAL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3347,14 +3483,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABD ., ., .")] - public void Uabd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UABD ., ., .")] + [PairwiseData] + public void Uabd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E207400; // UABD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3369,14 +3506,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABD ., ., .")] - public void Uabd_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "UABD ., ., .")] + [PairwiseData] + public void Uabd_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x6E207400; // UABD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3391,14 +3529,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABDL{2} ., ., .")] - public void Uabdl_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "UABDL{2} ., ., .")] + [PairwiseData] + public void Uabdl_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x2E207000; // UABDL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3413,14 +3552,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UABDL{2} ., ., .")] - public void Uabdl_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "UABDL{2} ., ., .")] + [PairwiseData] + public void Uabdl_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x6E207000; // UABDL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3435,14 +3575,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UADDL{2} ., ., .")] - public void Uaddl_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "UADDL{2} ., ., .")] + [PairwiseData] + public void Uaddl_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x2E200000; // UADDL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3457,14 +3598,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UADDL{2} ., ., .")] - public void Uaddl_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "UADDL{2} ., ., .")] + [PairwiseData] + public void Uaddl_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x6E200000; // UADDL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3479,14 +3621,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UADDW{2} ., ., .")] - public void Uaddw_V_8B8H8H_4H4S4S_2S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> + [SkippableTheory(DisplayName = "UADDW{2} ., ., .")] + [PairwiseData] + public void Uaddw_V_8B8H8H_4H4S4S_2S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> { uint opcode = 0x2E201000; // UADDW V0.8H, V0.8H, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3501,14 +3644,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UADDW{2} ., ., .")] - public void Uaddw_V_16B8H8H_8H4S4S_4S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> + [SkippableTheory(DisplayName = "UADDW{2} ., ., .")] + [PairwiseData] + public void Uaddw_V_16B8H8H_8H4S4S_4S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> { uint opcode = 0x6E201000; // UADDW2 V0.8H, V0.8H, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3523,14 +3667,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UHADD ., ., .")] - public void Uhadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UHADD ., ., .")] + [PairwiseData] + public void Uhadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E200400; // UHADD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3545,14 +3690,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UHADD ., ., .")] - public void Uhadd_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "UHADD ., ., .")] + [PairwiseData] + public void Uhadd_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x6E200400; // UHADD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3567,14 +3713,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UHSUB ., ., .")] - public void Uhsub_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UHSUB ., ., .")] + [PairwiseData] + public void Uhsub_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E202400; // UHSUB V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3589,14 +3736,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UHSUB ., ., .")] - public void Uhsub_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "UHSUB ., ., .")] + [PairwiseData] + public void Uhsub_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x6E202400; // UHSUB V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3611,14 +3759,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UQADD , , ")] - public void Uqadd_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [ValueSource(nameof(_1B1H1S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "UQADD , , ")] + [PairwiseData] + public void Uqadd_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x7E200C00; // UQADD B0, B0, B0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3633,14 +3782,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UQADD ., ., .")] - public void Uqadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UQADD ., ., .")] + [PairwiseData] + public void Uqadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E200C00; // UQADD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3655,14 +3805,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UQADD ., ., .")] - public void Uqadd_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "UQADD ., ., .")] + [PairwiseData] + public void Uqadd_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E200C00; // UQADD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3677,14 +3828,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UQSUB , , ")] - public void Uqsub_S_B_H_S_D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1B1H1S1D_))] ulong z, - [ValueSource(nameof(_1B1H1S1D_))] ulong a, - [ValueSource(nameof(_1B1H1S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // + [SkippableTheory(DisplayName = "UQSUB , , ")] + [PairwiseData] + public void Uqsub_S_B_H_S_D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong z, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong a, + [CombinatorialMemberData(nameof(_1B1H1S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // { uint opcode = 0x7E202C00; // UQSUB B0, B0, B0 opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3699,14 +3851,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UQSUB ., ., .")] - public void Uqsub_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UQSUB ., ., .")] + [PairwiseData] + public void Uqsub_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E202C00; // UQSUB V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3721,14 +3874,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("UQSUB ., ., .")] - public void Uqsub_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "UQSUB ., ., .")] + [PairwiseData] + public void Uqsub_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x6E202C00; // UQSUB V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3743,14 +3897,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise, Description("URHADD ., ., .")] - public void Urhadd_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "URHADD ., ., .")] + [PairwiseData] + public void Urhadd_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x2E201400; // URHADD V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3765,14 +3920,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("URHADD ., ., .")] - public void Urhadd_V_16B_8H_4S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> + [SkippableTheory(DisplayName = "URHADD ., ., .")] + [PairwiseData] + public void Urhadd_V_16B_8H_4S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S> { uint opcode = 0x6E201400; // URHADD V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3787,14 +3943,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("USUBL{2} ., ., .")] - public void Usubl_V_8B8H_4H4S_2S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> + [SkippableTheory(DisplayName = "USUBL{2} ., ., .")] + [PairwiseData] + public void Usubl_V_8B8H_4H4S_2S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H, 4H4S, 2S2D> { uint opcode = 0x2E202000; // USUBL V0.8H, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3809,14 +3966,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("USUBL{2} ., ., .")] - public void Usubl_V_16B8H_8H4S_4S2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> + [SkippableTheory(DisplayName = "USUBL{2} ., ., .")] + [PairwiseData] + public void Usubl_V_16B8H_8H4S_4S2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H, 8H4S, 4S2D> { uint opcode = 0x6E202000; // USUBL2 V0.8H, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3831,14 +3989,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("USUBW{2} ., ., .")] - public void Usubw_V_8B8H8H_4H4S4S_2S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> + [SkippableTheory(DisplayName = "USUBW{2} ., ., .")] + [PairwiseData] + public void Usubw_V_8B8H8H_4H4S4S_2S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B8H8H, 4H4S4S, 2S2D2D> { uint opcode = 0x2E203000; // USUBW V0.8H, V0.8H, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3853,14 +4012,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("USUBW{2} ., ., .")] - public void Usubw_V_16B8H8H_8H4S4S_4S2D2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_4H2S1D_))][Random(RndCnt)] ulong a, - [ValueSource(nameof(_8B4H2S_))][Random(RndCnt)] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> + [SkippableTheory(DisplayName = "USUBW{2} ., ., .")] + [PairwiseData] + public void Usubw_V_16B8H8H_8H4S4S_4S2D2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_4H2S1D_))][CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))][CombinatorialRandomData(Count = RndCnt)] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <16B8H8H, 8H4S4S, 4S2D2D> { uint opcode = 0x6E203000; // USUBW2 V0.8H, V0.8H, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3875,14 +4035,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UZP1 ., ., .")] - public void Uzp1_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UZP1 ., ., .")] + [PairwiseData] + public void Uzp1_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E001800; // UZP1 V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3897,14 +4058,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UZP1 ., ., .")] - public void Uzp1_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "UZP1 ., ., .")] + [PairwiseData] + public void Uzp1_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E001800; // UZP1 V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3919,14 +4081,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UZP2 ., ., .")] - public void Uzp2_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "UZP2 ., ., .")] + [PairwiseData] + public void Uzp2_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E005800; // UZP2 V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3941,14 +4104,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("UZP2 ., ., .")] - public void Uzp2_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "UZP2 ., ., .")] + [PairwiseData] + public void Uzp2_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E005800; // UZP2 V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3963,14 +4127,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ZIP1 ., ., .")] - public void Zip1_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "ZIP1 ., ., .")] + [PairwiseData] + public void Zip1_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E003800; // ZIP1 V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -3985,14 +4150,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ZIP1 ., ., .")] - public void Zip1_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "ZIP1 ., ., .")] + [PairwiseData] + public void Zip1_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E003800; // ZIP1 V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -4007,14 +4173,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ZIP2 ., ., .")] - public void Zip2_V_8B_4H_2S([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S_))] ulong z, - [ValueSource(nameof(_8B4H2S_))] ulong a, - [ValueSource(nameof(_8B4H2S_))] ulong b, - [Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> + [SkippableTheory(DisplayName = "ZIP2 ., ., .")] + [PairwiseData] + public void Zip2_V_8B_4H_2S([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S> { uint opcode = 0x0E007800; // ZIP2 V0.8B, V0.8B, V0.8B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); @@ -4029,14 +4196,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("ZIP2 ., ., .")] - public void Zip2_V_16B_8H_4S_2D([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> + [SkippableTheory(DisplayName = "ZIP2 ., ., .")] + [PairwiseData] + public void Zip2_V_16B_8H_4S_2D([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D> { uint opcode = 0x4E007800; // ZIP2 V0.16B, V0.16B, V0.16B opcode |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs index 8bcd143dd3..4008d5dd2e 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdReg32.cs @@ -1,12 +1,21 @@ -// #define SimdReg32 +#define SimdReg32 +using ARMeilleure.State; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdReg32")] public sealed class CpuTestSimdReg32 : CpuTest32 { + public CpuTestSimdReg32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdReg32 #region "ValueSource (Opcodes)" @@ -175,7 +184,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = GenNormalS(); ulong rnd2 = GenSubnormalS(); @@ -273,19 +282,20 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Test, Pairwise, Description("SHA256H.32 , , ")] - public void Sha256h_V([Values(0xF3000C40u)] uint opcode, - [Values(0u)] uint rd, - [Values(2u)] uint rn, - [Values(4u)] uint rm, - [Values(0xAEE65C11943FB939ul)] ulong z0, - [Values(0xA89A87F110291DA3ul)] ulong z1, - [Values(0xE9F766DB7A49EA7Dul)] ulong a0, - [Values(0x3053F46B0C2F3507ul)] ulong a1, - [Values(0x6E86A473B9D4A778ul)] ulong b0, - [Values(0x7BE4F9E638156BB1ul)] ulong b1, - [Values(0x1F1DC4A98DA9C132ul)] ulong resultL, - [Values(0xDB9A2A7B47031A0Dul)] ulong resultH) + [Theory(DisplayName = "SHA256H.32 , , ")] + [PairwiseData] + public void Sha256h_V([CombinatorialValues(0xF3000C40u)] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u)] uint rn, + [CombinatorialValues(4u)] uint rm, + [CombinatorialValues(0xAEE65C11943FB939ul)] ulong z0, + [CombinatorialValues(0xA89A87F110291DA3ul)] ulong z1, + [CombinatorialValues(0xE9F766DB7A49EA7Dul)] ulong a0, + [CombinatorialValues(0x3053F46B0C2F3507ul)] ulong a1, + [CombinatorialValues(0x6E86A473B9D4A778ul)] ulong b0, + [CombinatorialValues(0x7BE4F9E638156BB1ul)] ulong b1, + [CombinatorialValues(0x1F1DC4A98DA9C132ul)] ulong resultL, + [CombinatorialValues(0xDB9A2A7B47031A0Dul)] ulong resultH) { opcode |= ((rd & 0xf) << 12) | ((rd & 0x10) << 18); opcode |= ((rn & 0xf) << 16) | ((rn & 0x10) << 3); @@ -299,27 +309,28 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); // Unicorn does not yet support hash instructions in A32. // CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SHA256H2.32 , , ")] - public void Sha256h2_V([Values(0xF3100C40u)] uint opcode, - [Values(0u)] uint rd, - [Values(2u)] uint rn, - [Values(4u)] uint rm, - [Values(0xAEE65C11943FB939ul)] ulong z0, - [Values(0xA89A87F110291DA3ul)] ulong z1, - [Values(0xE9F766DB7A49EA7Dul)] ulong a0, - [Values(0x3053F46B0C2F3507ul)] ulong a1, - [Values(0x6E86A473B9D4A778ul)] ulong b0, - [Values(0x7BE4F9E638156BB1ul)] ulong b1, - [Values(0x0A1177E9D9C9B611ul)] ulong resultL, - [Values(0xF5A826404928A515ul)] ulong resultH) + [Theory(DisplayName = "SHA256H2.32 , , ")] + [PairwiseData] + public void Sha256h2_V([CombinatorialValues(0xF3100C40u)] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u)] uint rn, + [CombinatorialValues(4u)] uint rm, + [CombinatorialValues(0xAEE65C11943FB939ul)] ulong z0, + [CombinatorialValues(0xA89A87F110291DA3ul)] ulong z1, + [CombinatorialValues(0xE9F766DB7A49EA7Dul)] ulong a0, + [CombinatorialValues(0x3053F46B0C2F3507ul)] ulong a1, + [CombinatorialValues(0x6E86A473B9D4A778ul)] ulong b0, + [CombinatorialValues(0x7BE4F9E638156BB1ul)] ulong b1, + [CombinatorialValues(0x0A1177E9D9C9B611ul)] ulong resultL, + [CombinatorialValues(0xF5A826404928A515ul)] ulong resultH) { opcode |= ((rd & 0xf) << 12) | ((rd & 0x10) << 18); opcode |= ((rn & 0xf) << 16) | ((rn & 0x10) << 3); @@ -333,27 +344,28 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); // Unicorn does not yet support hash instructions in A32. // CompareAgainstUnicorn(); } - [Test, Pairwise, Description("SHA256SU1.32 , , ")] - public void Sha256su1_V([Values(0xF3200C40u)] uint opcode, - [Values(0u)] uint rd, - [Values(2u)] uint rn, - [Values(4u)] uint rm, - [Values(0xAEE65C11943FB939ul)] ulong z0, - [Values(0xA89A87F110291DA3ul)] ulong z1, - [Values(0xE9F766DB7A49EA7Dul)] ulong a0, - [Values(0x3053F46B0C2F3507ul)] ulong a1, - [Values(0x6E86A473B9D4A778ul)] ulong b0, - [Values(0x7BE4F9E638156BB1ul)] ulong b1, - [Values(0x9EE69CC896D7DE66ul)] ulong resultL, - [Values(0x004A147155573E54ul)] ulong resultH) + [Theory(DisplayName = "SHA256SU1.32 , , ")] + [PairwiseData] + public void Sha256su1_V([CombinatorialValues(0xF3200C40u)] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u)] uint rn, + [CombinatorialValues(4u)] uint rm, + [CombinatorialValues(0xAEE65C11943FB939ul)] ulong z0, + [CombinatorialValues(0xA89A87F110291DA3ul)] ulong z1, + [CombinatorialValues(0xE9F766DB7A49EA7Dul)] ulong a0, + [CombinatorialValues(0x3053F46B0C2F3507ul)] ulong a1, + [CombinatorialValues(0x6E86A473B9D4A778ul)] ulong b0, + [CombinatorialValues(0x7BE4F9E638156BB1ul)] ulong b1, + [CombinatorialValues(0x9EE69CC896D7DE66ul)] ulong resultL, + [CombinatorialValues(0x004A147155573E54ul)] ulong resultH) { opcode |= ((rd & 0xf) << 12) | ((rd & 0x10) << 18); opcode |= ((rn & 0xf) << 16) | ((rn & 0x10) << 3); @@ -367,26 +379,26 @@ namespace Ryujinx.Tests.Cpu Assert.Multiple(() => { - Assert.That(GetVectorE0(context.GetV(0)), Is.EqualTo(resultL)); - Assert.That(GetVectorE1(context.GetV(0)), Is.EqualTo(resultH)); + Assert.Equal(resultL, GetVectorE0(context.GetV(0))); + Assert.Equal(resultH, GetVectorE1(context.GetV(0))); }); // Unicorn does not yet support hash instructions in A32. // CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise, Description("VADD.f32 V0, V0, V0")] - public void Vadd_F32([Values(0u)] uint rd, - [Values(0u, 1u)] uint rn, - [Values(0u, 2u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z0, - [ValueSource(nameof(_2S_F_))] ulong z1, - [ValueSource(nameof(_2S_F_))] ulong a0, - [ValueSource(nameof(_2S_F_))] ulong a1, - [ValueSource(nameof(_2S_F_))] ulong b0, - [ValueSource(nameof(_2S_F_))] ulong b1, - [Values] bool q) + [Theory(DisplayName = "VADD.f32 V0, V0, V0")] + [PairwiseData] + public void Vadd_F32([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rn, + [CombinatorialValues(0u, 2u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z1, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a1, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b1, + bool q) { uint opcode = 0xf2000d00u; // VADD.F32 D0, D0, D0 if (q) @@ -410,16 +422,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void V_Add_Sub_Long_Wide_I([ValueSource(nameof(_V_Add_Sub_Long_Wide_I_))] uint opcode, - [Range(0u, 5u)] uint rd, - [Range(0u, 5u)] uint rn, - [Range(0u, 5u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0u, 1u, 2u)] uint size, // - [Values] bool u) // + [Theory] + [PairwiseData] + public void V_Add_Sub_Long_Wide_I([CombinatorialMemberData(nameof(_V_Add_Sub_Long_Wide_I_))] uint opcode, + [CombinatorialRange(0u, 5u, 1)] uint rd, + [CombinatorialRange(0u, 5u, 1)] uint rn, + [CombinatorialRange(0u, 5u, 1)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0u, 1u, 2u)] uint size, // + bool u) // { if (u) { @@ -446,11 +459,12 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VCMP.f Vd, Vm")] - public void Vcmp([Values(2u, 3u)] uint size, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_1S_F_))] ulong b, - [Values] bool e) + [Theory(DisplayName = "VCMP.f Vd, Vm")] + [PairwiseData] + public void Vcmp([CombinatorialValues(2u, 3u)] uint size, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_1S_F_))] ulong b, + bool e) { uint opcode = 0xeeb40840u; uint rm = 1; @@ -476,7 +490,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0(b); - int fpscr = (int)(TestContext.CurrentContext.Random.NextUInt(0xf) << 28); + int fpscr = (int)(Random.Shared.NextUInt(0xf) << 28); SingleOpcode(opcode, v1: v1, v2: v2, fpscr: fpscr); @@ -484,16 +498,16 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void Vfma_Vfms_Vfnma_Vfnms_S_F32([ValueSource(nameof(_Vfma_Vfms_Vfnma_Vfnms_S_F32_))] uint opcode, - [Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rn, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_1S_F_))] ulong s0, - [ValueSource(nameof(_1S_F_))] ulong s1, - [ValueSource(nameof(_1S_F_))] ulong s2, - [ValueSource(nameof(_1S_F_))] ulong s3) + [Theory] + [PairwiseData] + public void Vfma_Vfms_Vfnma_Vfnms_S_F32([CombinatorialMemberData(nameof(_Vfma_Vfms_Vfnma_Vfnms_S_F32_))] uint opcode, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rn, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s0, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s1, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s2, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s3) { opcode |= (((rd & 0x1) << 22) | (rd & 0x1e) << 11); opcode |= (((rn & 0x1) << 7) | (rn & 0x1e) << 15); @@ -507,14 +521,14 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void Vfma_Vfms_Vfnma_Vfnms_S_F64([ValueSource(nameof(_Vfma_Vfms_Vfnma_Vfnms_S_F64_))] uint opcode, - [Values(0u, 1u)] uint rd, - [Values(0u, 1u)] uint rn, - [Values(0u, 1u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong d0, - [ValueSource(nameof(_1D_F_))] ulong d1) + [Theory] + [PairwiseData] + public void Vfma_Vfms_Vfnma_Vfnms_S_F64([CombinatorialMemberData(nameof(_Vfma_Vfms_Vfnma_Vfnms_S_F64_))] uint opcode, + [CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rn, + [CombinatorialValues(0u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d0, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d1) { opcode |= (((rd & 0x10) << 18) | (rd & 0xf) << 12); opcode |= (((rn & 0x10) << 3) | (rn & 0xf) << 16); @@ -528,17 +542,17 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void Vfma_Vfms_V_F32([ValueSource(nameof(_Vfma_Vfms_V_F32_))] uint opcode, - [Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rn, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong d0, - [ValueSource(nameof(_2S_F_))] ulong d1, - [ValueSource(nameof(_2S_F_))] ulong d2, - [ValueSource(nameof(_2S_F_))] ulong d3, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vfma_Vfms_V_F32([CombinatorialMemberData(nameof(_Vfma_Vfms_V_F32_))] uint opcode, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rn, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d1, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d2, + [CombinatorialMemberData(nameof(_2S_F_))] ulong d3, + bool q) { if (q) { @@ -564,16 +578,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void Vmla_Vmls_Vnmla_Vnmls_S_F32([ValueSource(nameof(_Vmla_Vmls_Vnmla_Vnmls_S_F32_))] uint opcode, - [Values(0u, 1u, 2u, 3u)] uint rd, - [Values(0u, 1u, 2u, 3u)] uint rn, - [Values(0u, 1u, 2u, 3u)] uint rm, - [ValueSource(nameof(_1S_F_))] ulong s0, - [ValueSource(nameof(_1S_F_))] ulong s1, - [ValueSource(nameof(_1S_F_))] ulong s2, - [ValueSource(nameof(_1S_F_))] ulong s3) + [Theory] + [PairwiseData] + public void Vmla_Vmls_Vnmla_Vnmls_S_F32([CombinatorialMemberData(nameof(_Vmla_Vmls_Vnmla_Vnmls_S_F32_))] uint opcode, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rd, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rn, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint rm, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s0, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s1, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s2, + [CombinatorialMemberData(nameof(_1S_F_))] ulong s3) { opcode |= (((rd & 0x1) << 22) | (rd & 0x1e) << 11); opcode |= (((rn & 0x1) << 7) | (rn & 0x1e) << 15); @@ -586,14 +600,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void Vmla_Vmls_Vnmla_Vnmls_S_F64([ValueSource(nameof(_Vmla_Vmls_Vnmla_Vnmls_S_F64_))] uint opcode, - [Values(0u, 1u)] uint rd, - [Values(0u, 1u)] uint rn, - [Values(0u, 1u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong d0, - [ValueSource(nameof(_1D_F_))] ulong d1) + [Theory] + [PairwiseData] + public void Vmla_Vmls_Vnmla_Vnmls_S_F64([CombinatorialMemberData(nameof(_Vmla_Vmls_Vnmla_Vnmls_S_F64_))] uint opcode, + [CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rn, + [CombinatorialValues(0u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d0, + [CombinatorialMemberData(nameof(_1D_F_))] ulong d1) { opcode |= (((rd & 0x10) << 18) | (rd & 0xf) << 12); opcode |= (((rn & 0x10) << 3) | (rn & 0xf) << 16); @@ -606,16 +620,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vmlal_Vmlsl_I([ValueSource(nameof(_Vmlal_Vmlsl_V_I_))] uint opcode, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool u) + [Theory] + [PairwiseData] + public void Vmlal_Vmlsl_I([CombinatorialMemberData(nameof(_Vmlal_Vmlsl_V_I_))] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool u) { opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); opcode |= ((rd & 0xf) << 12) | ((rd & 0x10) << 18); @@ -637,16 +652,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMULL. , , ")] - public void Vmull_I([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool op, - [Values] bool u) + [Theory(DisplayName = "VMULL. , , ")] + [PairwiseData] + public void Vmull_I([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool op, + bool u) { uint opcode = 0xf2800c00u; // VMULL.S8 Q0, D0, D0 @@ -677,13 +693,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMULL. , , ")] - public void Vmull_I_P8_P64([Values(0u, 1u)] uint rd, - [Values(0u, 1u)] uint rn, - [Values(0u, 1u)] uint rm, - [ValueSource(nameof(_8B1D_))] ulong d0, - [ValueSource(nameof(_8B1D_))] ulong d1, - [Values(0u/*, 2u*/)] uint size) // + [Theory(DisplayName = "VMULL. , , ")] + [PairwiseData] + public void Vmull_I_P8_P64([CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(0u, 1u)] uint rn, + [CombinatorialValues(0u, 1u)] uint rm, + [CombinatorialMemberData(nameof(_8B1D_))] ulong d0, + [CombinatorialMemberData(nameof(_8B1D_))] ulong d1, + [CombinatorialValues(0u/*, 2u*/)] uint size) // { /*if (size == 2u) { @@ -708,21 +725,19 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VSHL. {}, , ")] - public void Vshl([Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [Values(0u, 1u, 2u, 3u)] uint size, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool q, - [Values] bool u) + [Theory(DisplayName = "VSHL. {}, , ")] + [PairwiseData] + public void Vshl([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint size, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool q, + bool u) { - if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64) - { - Assert.Ignore("Unicorn on ARM64 crash while executing this test"); - } + Skip.If(RuntimeInformation.ProcessArchitecture == Architecture.Arm64, "Unicorn on ARM64 crashes while executing this test"); uint opcode = 0xf2000400u; // VSHL.S8 D0, D0, D0 if (q) @@ -753,18 +768,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Explicit] - [Test, Pairwise] - public void Vp_Add_Max_Min_F([ValueSource(nameof(_Vp_Add_Max_Min_F_))] uint opcode, - [Values(0u)] uint rd, - [Range(0u, 7u)] uint rn, - [Range(0u, 7u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z0, - [ValueSource(nameof(_2S_F_))] ulong z1, - [ValueSource(nameof(_2S_F_))] ulong a0, - [ValueSource(nameof(_2S_F_))] ulong a1, - [ValueSource(nameof(_2S_F_))] ulong b0, - [ValueSource(nameof(_2S_F_))] ulong b1) + [Theory] + [PairwiseData] + public void Vp_Add_Max_Min_F([CombinatorialMemberData(nameof(_Vp_Add_Max_Min_F_))] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialRange(0u, 7u, 1)] uint rn, + [CombinatorialRange(0u, 7u, 1)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z1, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a1, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b0, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b1) { opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); opcode |= ((rd & 0xf) << 12) | ((rd & 0x10) << 18); @@ -779,15 +794,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vp_Add_I([ValueSource(nameof(_Vp_Add_I_))] uint opcode, - [Values(0u)] uint rd, - [Range(0u, 5u)] uint rn, - [Range(0u, 5u)] uint rm, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b) + [Theory] + [PairwiseData] + public void Vp_Add_I([CombinatorialMemberData(nameof(_Vp_Add_I_))] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialRange(0u, 5u, 1)] uint rn, + [CombinatorialRange(0u, 5u, 1)] uint rm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b) { opcode |= ((rm & 0xf) << 0) | ((rm & 0x10) << 1); opcode |= ((rd & 0xf) << 12) | ((rd & 0x10) << 18); @@ -804,16 +820,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void V_Pmax_Pmin_Rhadd_I([ValueSource(nameof(_V_Pmax_Pmin_Rhadd_I_))] uint opcode, - [Values(0u)] uint rd, - [Range(0u, 5u)] uint rn, - [Range(0u, 5u)] uint rm, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool u) + [Theory] + [PairwiseData] + public void V_Pmax_Pmin_Rhadd_I([CombinatorialMemberData(nameof(_V_Pmax_Pmin_Rhadd_I_))] uint opcode, + [CombinatorialValues(0u)] uint rd, + [CombinatorialRange(0u, 5u, 1)] uint rn, + [CombinatorialRange(0u, 5u, 1)] uint rm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool u) { if (u) { @@ -835,16 +852,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vq_Add_Sub_I([ValueSource(nameof(_Vq_Add_Sub_I_))] uint opcode, - [Range(0u, 5u)] uint rd, - [Range(0u, 5u)] uint rn, - [Range(0u, 5u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(0u, 1u, 2u)] uint size, // - [Values] bool u) // + [Theory] + [PairwiseData] + public void Vq_Add_Sub_I([CombinatorialMemberData(nameof(_Vq_Add_Sub_I_))] uint opcode, + [CombinatorialRange(0u, 5u, 1)] uint rd, + [CombinatorialRange(0u, 5u, 1)] uint rn, + [CombinatorialRange(0u, 5u, 1)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(0u, 1u, 2u)] uint size, // + bool u) // { if (u) { @@ -873,14 +891,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VQDMULH. , , ")] - public void Vqdmulh_I([Range(0u, 5u)] uint rd, - [Range(0u, 5u)] uint rn, - [Range(0u, 5u)] uint rm, - [ValueSource(nameof(_8B4H2S1D_))] ulong z, - [ValueSource(nameof(_8B4H2S1D_))] ulong a, - [ValueSource(nameof(_8B4H2S1D_))] ulong b, - [Values(1u, 2u)] uint size) // + [Theory(DisplayName = "VQDMULH. , , ")] + [PairwiseData] + public void Vqdmulh_I([CombinatorialRange(0u, 5u, 1)] uint rd, + [CombinatorialRange(0u, 5u, 1)] uint rn, + [CombinatorialRange(0u, 5u, 1)] uint rm, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong z, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong a, + [CombinatorialMemberData(nameof(_8B4H2S1D_))] ulong b, + [CombinatorialValues(1u, 2u)] uint size) // { rd >>= 1; rd <<= 1; diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem.cs index 033c03fcca..956cde2e1c 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem.cs @@ -1,12 +1,18 @@ -// #define SimdRegElem +#define SimdRegElem +using ARMeilleure.State; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdRegElem")] public sealed class CpuTestSimdRegElem : CpuTest { + public CpuTestSimdRegElem(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdRegElem #region "ValueSource (Types)" @@ -80,16 +86,17 @@ namespace Ryujinx.Tests.Cpu #endregion - [Test, Pairwise] - public void Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_4H_8H([ValueSource(nameof(_Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_4H_8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [ValueSource(nameof(_4H_))] ulong b, - [Values(0u, 7u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory] + [PairwiseData] + public void Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_4H_8H([CombinatorialMemberData(nameof(_Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_4H_8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialMemberData(nameof(_4H_))] ulong b, + [CombinatorialValues(0u, 7u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint h = (index >> 2) & 1; uint l = (index >> 1) & 1; @@ -108,16 +115,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_2S_4S([ValueSource(nameof(_Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [ValueSource(nameof(_2S_))] ulong b, - [Values(0u, 1u, 2u, 3u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_2S_4S([CombinatorialMemberData(nameof(_Mla_Mls_Mul_Sqdmulh_Sqrdmulh_Ve_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialMemberData(nameof(_2S_))] ulong b, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint h = (index >> 1) & 1; uint l = index & 1; @@ -135,16 +143,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void SU_Mlal_Mlsl_Mull_Ve_4H4S_8H4S([ValueSource(nameof(_SU_Mlal_Mlsl_Mull_Ve_4H4S_8H4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [ValueSource(nameof(_4H_))] ulong b, - [Values(0u, 7u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <4H4S, 8H4S> + [SkippableTheory] + [PairwiseData] + public void SU_Mlal_Mlsl_Mull_Ve_4H4S_8H4S([CombinatorialMemberData(nameof(_SU_Mlal_Mlsl_Mull_Ve_4H4S_8H4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialMemberData(nameof(_4H_))] ulong b, + [CombinatorialValues(0u, 7u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H4S, 8H4S> { uint h = (index >> 2) & 1; uint l = (index >> 1) & 1; @@ -163,16 +172,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Mlal_Mlsl_Mull_Ve_2S2D_4S2D([ValueSource(nameof(_SU_Mlal_Mlsl_Mull_Ve_2S2D_4S2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [ValueSource(nameof(_2S_))] ulong b, - [Values(0u, 1u, 2u, 3u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <2S2D, 4S2D> + [SkippableTheory] + [PairwiseData] + public void SU_Mlal_Mlsl_Mull_Ve_2S2D_4S2D([CombinatorialMemberData(nameof(_SU_Mlal_Mlsl_Mull_Ve_2S2D_4S2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialMemberData(nameof(_2S_))] ulong b, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S2D, 4S2D> { uint h = (index >> 1) & 1; uint l = index & 1; diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem32.cs index cbe52d1c88..93f6c92e04 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElem32.cs @@ -1,24 +1,31 @@ -// #define SimdRegElem32 +#define SimdRegElem32 +using ARMeilleure.State; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdRegElem32")] public sealed class CpuTestSimdRegElem32 : CpuTest32 { + public CpuTestSimdRegElem32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdRegElem32 private const int RndCnt = 2; - [Test, Pairwise, Description("VMUL. {}, , []")] - public void Vmul_1I([Values(1u, 0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(26u, 25u, 10u, 9u, 2u, 0u)] uint rm, - [Values(1u, 2u)] uint size, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool q) + [Theory(DisplayName = "VMUL. {}, , []")] + [PairwiseData] + public void Vmul_1I([CombinatorialValues(1u, 0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(26u, 25u, 10u, 9u, 2u, 0u)] uint rm, + [CombinatorialValues(1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool q) { uint opcode = 0xf2900840u & ~(3u << 20); // VMUL.I16 D0, D0, D0[0] if (q) @@ -43,15 +50,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VMULL. , , []")] - public void Vmull_1([Values(2u, 0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(26u, 25u, 10u, 9u, 2u, 0u)] uint rm, - [Values(1u, 2u)] uint size, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool u) + [Theory(DisplayName = "VMULL. , , []")] + [PairwiseData] + public void Vmull_1([CombinatorialValues(2u, 0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(26u, 25u, 10u, 9u, 2u, 0u)] uint rm, + [CombinatorialValues(1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool u) { uint opcode = 0xf2900a40u & ~(3u << 20); // VMULL.S16 Q0, D0, D0[0] diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs index 869db8869a..27921e3b9e 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdRegElemF.cs @@ -1,12 +1,20 @@ -// #define SimdRegElemF +#define SimdRegElemF +using ARMeilleure.State; +using System; using Xunit; +using System.Collections.Generic; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdRegElemF")] public sealed class CpuTestSimdRegElemF : CpuTest { + public CpuTestSimdRegElemF(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdRegElemF #region "ValueSource (Types)" @@ -43,7 +51,7 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong grbg = TestContext.CurrentContext.Random.NextUInt(); + ulong grbg = Random.Shared.NextUInt(); ulong rnd1 = GenNormalS(); ulong rnd2 = GenSubnormalS(); @@ -216,13 +224,13 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noNaNs = false; // Fused. - [Test, Pairwise] - [Explicit] - public void F_Mla_Mls_Se_S([ValueSource(nameof(_F_Mla_Mls_Se_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong z, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0u, 1u, 2u, 3u)] uint index) + [SkippableTheory] + [PairwiseData] + public void F_Mla_Mls_Se_S([CombinatorialMemberData(nameof(_F_Mla_Mls_Se_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong z, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index) { uint h = (index >> 1) & 1; uint l = index & 1; @@ -233,7 +241,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -244,13 +252,13 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Mla_Mls_Se_D([ValueSource(nameof(_F_Mla_Mls_Se_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b, - [Values(0u, 1u)] uint index) + [SkippableTheory] + [PairwiseData] + public void F_Mla_Mls_Se_D([CombinatorialMemberData(nameof(_F_Mla_Mls_Se_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b, + [CombinatorialValues(0u, 1u)] uint index) { uint h = index & 1; @@ -260,7 +268,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -271,17 +279,17 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Mla_Mls_Ve_2S_4S([ValueSource(nameof(_F_Mla_Mls_Ve_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0u, 1u, 2u, 3u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Mla_Mls_Ve_2S_4S([CombinatorialMemberData(nameof(_F_Mla_Mls_Ve_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint h = (index >> 1) & 1; uint l = index & 1; @@ -294,7 +302,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a * q); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -305,16 +313,16 @@ namespace Ryujinx.Tests.Cpu } // Fused. - [Test, Pairwise] - [Explicit] - public void F_Mla_Mls_Ve_2D([ValueSource(nameof(_F_Mla_Mls_Ve_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b, - [Values(0u, 1u)] uint index) + [SkippableTheory] + [PairwiseData] + public void F_Mla_Mls_Ve_2D([CombinatorialMemberData(nameof(_F_Mla_Mls_Ve_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b, + [CombinatorialValues(0u, 1u)] uint index) { uint h = index & 1; @@ -325,7 +333,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -335,24 +343,24 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(Fpsr.Ioc | Fpsr.Idc, FpSkips.IfUnderflow, FpTolerances.UpToOneUlpsD); } - [Test, Pairwise] - [Explicit] - public void F_Mul_Mulx_Se_S([ValueSource(nameof(_F_Mul_Mulx_Se_S_))] uint opcodes, - [ValueSource(nameof(_1S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0u, 1u, 2u, 3u)] uint index) + [SkippableTheory] + [PairwiseData] + public void F_Mul_Mulx_Se_S([CombinatorialMemberData(nameof(_F_Mul_Mulx_Se_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index) { uint h = (index >> 1) & 1; uint l = index & 1; opcodes |= (l << 21) | (h << 11); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -362,23 +370,23 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Mul_Mulx_Se_D([ValueSource(nameof(_F_Mul_Mulx_Se_D_))] uint opcodes, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b, - [Values(0u, 1u)] uint index) + [SkippableTheory] + [PairwiseData] + public void F_Mul_Mulx_Se_D([CombinatorialMemberData(nameof(_F_Mul_Mulx_Se_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b, + [CombinatorialValues(0u, 1u)] uint index) { uint h = index & 1; opcodes |= h << 11; - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -388,17 +396,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Mul_Mulx_Ve_2S_4S([ValueSource(nameof(_F_Mul_Mulx_Ve_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_2S_F_))] ulong z, - [ValueSource(nameof(_2S_F_))] ulong a, - [ValueSource(nameof(_2S_F_))] ulong b, - [Values(0u, 1u, 2u, 3u)] uint index, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Mul_Mulx_Ve_2S_4S([CombinatorialMemberData(nameof(_F_Mul_Mulx_Ve_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_2S_F_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_))] ulong a, + [CombinatorialMemberData(nameof(_2S_F_))] ulong b, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint index, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint h = (index >> 1) & 1; uint l = index & 1; @@ -411,7 +419,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a * q); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); @@ -421,16 +429,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Ioc | Fpsr.Idc); } - [Test, Pairwise] - [Explicit] - public void F_Mul_Mulx_Ve_2D([ValueSource(nameof(_F_Mul_Mulx_Ve_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [Values(2u, 0u)] uint rm, - [ValueSource(nameof(_1D_F_))] ulong z, - [ValueSource(nameof(_1D_F_))] ulong a, - [ValueSource(nameof(_1D_F_))] ulong b, - [Values(0u, 1u)] uint index) + [SkippableTheory] + [PairwiseData] + public void F_Mul_Mulx_Ve_2D([CombinatorialMemberData(nameof(_F_Mul_Mulx_Ve_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialMemberData(nameof(_1D_F_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_))] ulong a, + [CombinatorialMemberData(nameof(_1D_F_))] ulong b, + [CombinatorialValues(0u, 1u)] uint index) { uint h = index & 1; @@ -441,7 +449,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, a); V128 v2 = MakeVectorE0E1(b, b * h); - int rnd = (int)TestContext.CurrentContext.Random.NextUInt(); + int rnd = (int)Random.Shared.NextUInt(); int fpcr = rnd & (1 << (int)Fpcr.Fz); fpcr |= rnd & (1 << (int)Fpcr.Dn); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs index dbc018f9f8..44c7196334 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm.cs @@ -1,12 +1,20 @@ -// #define SimdShImm +#define SimdShImm +using ARMeilleure.State; using Xunit; +using System; +using System.Collections.Generic; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdShImm")] public sealed class CpuTestSimdShImm : CpuTest { + public CpuTestSimdShImm(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdShImm #region "ValueSource (Types)" @@ -104,8 +112,8 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { - ulong rnd1 = (uint)BitConverter.SingleToInt32Bits((int)TestContext.CurrentContext.Random.NextUInt()); - ulong rnd2 = (uint)BitConverter.SingleToInt32Bits(TestContext.CurrentContext.Random.NextUInt()); + ulong rnd1 = (uint)BitConverter.SingleToInt32Bits((int)Random.Shared.NextUInt()); + ulong rnd2 = (uint)BitConverter.SingleToInt32Bits(Random.Shared.NextUInt()); ulong rnd3 = GenNormalS(); ulong rnd4 = GenSubnormalS(); @@ -165,9 +173,9 @@ namespace Ryujinx.Tests.Cpu for (int cnt = 1; cnt <= RndCnt; cnt++) { ulong rnd1 = (ulong)BitConverter.DoubleToInt64Bits( - (long)TestContext.CurrentContext.Random.NextULong()); + (long)Random.Shared.NextULong()); ulong rnd2 = (ulong)BitConverter.DoubleToInt64Bits( - TestContext.CurrentContext.Random.NextULong()); + Random.Shared.NextULong()); ulong rnd3 = GenNormalD(); ulong rnd4 = GenSubnormalD(); @@ -540,15 +548,15 @@ namespace Ryujinx.Tests.Cpu private static readonly bool _noInfs = false; private static readonly bool _noNaNs = false; - [Test, Pairwise] - [Explicit] - public void F_Cvt_Z_SU_V_Fixed_2S_4S([ValueSource(nameof(_F_Cvt_Z_SU_V_Fixed_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_F_W_))] ulong z, - [ValueSource(nameof(_2S_F_W_))] ulong a, - [Values(1u, 32u)] uint fBits, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void F_Cvt_Z_SU_V_Fixed_2S_4S([CombinatorialMemberData(nameof(_F_Cvt_Z_SU_V_Fixed_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_F_W_))] ulong z, + [CombinatorialMemberData(nameof(_2S_F_W_))] ulong a, + [CombinatorialValues(1u, 32u)] uint fBits, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint immHb = (64 - fBits) & 0x7F; @@ -564,14 +572,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void F_Cvt_Z_SU_V_Fixed_2D([ValueSource(nameof(_F_Cvt_Z_SU_V_Fixed_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_F_X_))] ulong z, - [ValueSource(nameof(_1D_F_X_))] ulong a, - [Values(1u, 64u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void F_Cvt_Z_SU_V_Fixed_2D([CombinatorialMemberData(nameof(_F_Cvt_Z_SU_V_Fixed_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_F_X_))] ulong z, + [CombinatorialMemberData(nameof(_1D_F_X_))] ulong a, + [CombinatorialValues(1u, 64u)] uint fBits) { uint immHb = (128 - fBits) & 0x7F; @@ -586,17 +594,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_S_Fixed_S([ValueSource(nameof(_SU_Cvt_F_S_Fixed_S_))] uint opcodes, - [ValueSource(nameof(_1S_))] ulong a, - [Values(1u, 32u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_S_Fixed_S([CombinatorialMemberData(nameof(_SU_Cvt_F_S_Fixed_S_))] uint opcodes, + [CombinatorialMemberData(nameof(_1S_))] ulong a, + [CombinatorialValues(1u, 32u)] uint fBits) { uint immHb = (64 - fBits) & 0x7F; opcodes |= (immHb << 16); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE0E1(z, z); V128 v1 = MakeVectorE0(a); @@ -605,17 +613,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_S_Fixed_D([ValueSource(nameof(_SU_Cvt_F_S_Fixed_D_))] uint opcodes, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 64u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_S_Fixed_D([CombinatorialMemberData(nameof(_SU_Cvt_F_S_Fixed_D_))] uint opcodes, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 64u)] uint fBits) { uint immHb = (128 - fBits) & 0x7F; opcodes |= (immHb << 16); - ulong z = TestContext.CurrentContext.Random.NextULong(); + ulong z = Random.Shared.NextULong(); V128 v0 = MakeVectorE1(z); V128 v1 = MakeVectorE0(a); @@ -624,15 +632,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_V_Fixed_2S_4S([ValueSource(nameof(_SU_Cvt_F_V_Fixed_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(1u, 32u)] uint fBits, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_V_Fixed_2S_4S([CombinatorialMemberData(nameof(_SU_Cvt_F_V_Fixed_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(1u, 32u)] uint fBits, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint immHb = (64 - fBits) & 0x7F; @@ -648,14 +656,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - [Explicit] - public void SU_Cvt_F_V_Fixed_2D([ValueSource(nameof(_SU_Cvt_F_V_Fixed_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 64u)] uint fBits) + [SkippableTheory] + [PairwiseData] + public void SU_Cvt_F_V_Fixed_2D([CombinatorialMemberData(nameof(_SU_Cvt_F_V_Fixed_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 64u)] uint fBits) { uint immHb = (128 - fBits) & 0x7F; @@ -670,13 +678,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Shl_Sli_S_D([ValueSource(nameof(_Shl_Sli_S_D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(0u, 63u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void Shl_Sli_S_D([CombinatorialMemberData(nameof(_Shl_Sli_S_D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(0u, 63u)] uint shift) { uint immHb = (64 + shift) & 0x7F; @@ -691,14 +700,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Shl_Sli_V_8B_16B([ValueSource(nameof(_Shl_Sli_V_8B_16B_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 7u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <8B, 16B> + [SkippableTheory] + [PairwiseData] + public void Shl_Sli_V_8B_16B([CombinatorialMemberData(nameof(_Shl_Sli_V_8B_16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 7u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { uint immHb = (8 + shift) & 0x7F; @@ -714,14 +724,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Shl_Sli_V_4H_8H([ValueSource(nameof(_Shl_Sli_V_4H_8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 15u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory] + [PairwiseData] + public void Shl_Sli_V_4H_8H([CombinatorialMemberData(nameof(_Shl_Sli_V_4H_8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 15u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint immHb = (16 + shift) & 0x7F; @@ -737,14 +748,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Shl_Sli_V_2S_4S([ValueSource(nameof(_Shl_Sli_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(0u, 31u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void Shl_Sli_V_2S_4S([CombinatorialMemberData(nameof(_Shl_Sli_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0u, 31u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint immHb = (32 + shift) & 0x7F; @@ -760,13 +772,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Shl_Sli_V_2D([ValueSource(nameof(_Shl_Sli_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(0u, 63u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void Shl_Sli_V_2D([CombinatorialMemberData(nameof(_Shl_Sli_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(0u, 63u)] uint shift) { uint immHb = (64 + shift) & 0x7F; @@ -781,14 +794,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Shll_V_8B8H_16B8H([ValueSource(nameof(_SU_Shll_V_8B8H_16B8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [Values(0u, 7u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <8B8H, 16B8H> + [SkippableTheory] + [PairwiseData] + public void SU_Shll_V_8B8H_16B8H([CombinatorialMemberData(nameof(_SU_Shll_V_8B8H_16B8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(0u, 7u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B8H, 16B8H> { uint immHb = (8 + shift) & 0x7F; @@ -804,14 +818,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Shll_V_4H4S_8H4S([ValueSource(nameof(_SU_Shll_V_4H4S_8H4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(0u, 15u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <4H4S, 8H4S> + [SkippableTheory] + [PairwiseData] + public void SU_Shll_V_4H4S_8H4S([CombinatorialMemberData(nameof(_SU_Shll_V_4H4S_8H4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(0u, 15u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H4S, 8H4S> { uint immHb = (16 + shift) & 0x7F; @@ -827,14 +842,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void SU_Shll_V_2S2D_4S2D([ValueSource(nameof(_SU_Shll_V_2S2D_4S2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(0u, 31u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <2S2D, 4S2D> + [SkippableTheory] + [PairwiseData] + public void SU_Shll_V_2S2D_4S2D([CombinatorialMemberData(nameof(_SU_Shll_V_2S2D_4S2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(0u, 31u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S2D, 4S2D> { uint immHb = (32 + shift) & 0x7F; @@ -850,13 +866,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShlImm_S_D([ValueSource(nameof(_ShlImm_S_D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 64u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void ShlImm_S_D([CombinatorialMemberData(nameof(_ShlImm_S_D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 64u)] uint shift) { uint immHb = (64 + shift) & 0x7F; @@ -871,14 +888,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShlImm_V_8B_16B([ValueSource(nameof(_ShlImm_V_8B_16B_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [Values(1u, 8u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <8B, 16B> + [SkippableTheory] + [PairwiseData] + public void ShlImm_V_8B_16B([CombinatorialMemberData(nameof(_ShlImm_V_8B_16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(1u, 8u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { uint immHb = (8 + shift) & 0x7F; @@ -894,14 +912,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShlImm_V_4H_8H([ValueSource(nameof(_ShlImm_V_4H_8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(1u, 16u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory] + [PairwiseData] + public void ShlImm_V_4H_8H([CombinatorialMemberData(nameof(_ShlImm_V_4H_8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(1u, 16u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint immHb = (16 + shift) & 0x7F; @@ -917,14 +936,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShlImm_V_2S_4S([ValueSource(nameof(_ShlImm_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(1u, 32u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void ShlImm_V_2S_4S([CombinatorialMemberData(nameof(_ShlImm_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(1u, 32u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint immHb = (32 + shift) & 0x7F; @@ -940,13 +960,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShlImm_V_2D([ValueSource(nameof(_ShlImm_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 64u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void ShlImm_V_2D([CombinatorialMemberData(nameof(_ShlImm_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 64u)] uint shift) { uint immHb = (64 + shift) & 0x7F; @@ -961,13 +982,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImm_Sri_S_D([ValueSource(nameof(_ShrImm_Sri_S_D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 64u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void ShrImm_Sri_S_D([CombinatorialMemberData(nameof(_ShrImm_Sri_S_D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 64u)] uint shift) { uint immHb = (128 - shift) & 0x7F; @@ -982,14 +1004,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImm_Sri_V_8B_16B([ValueSource(nameof(_ShrImm_Sri_V_8B_16B_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong a, - [Values(1u, 8u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <8B, 16B> + [SkippableTheory] + [PairwiseData] + public void ShrImm_Sri_V_8B_16B([CombinatorialMemberData(nameof(_ShrImm_Sri_V_8B_16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong a, + [CombinatorialValues(1u, 8u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { uint immHb = (16 - shift) & 0x7F; @@ -1005,14 +1028,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImm_Sri_V_4H_8H([ValueSource(nameof(_ShrImm_Sri_V_4H_8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(1u, 16u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <4H, 8H> + [SkippableTheory] + [PairwiseData] + public void ShrImm_Sri_V_4H_8H([CombinatorialMemberData(nameof(_ShrImm_Sri_V_4H_8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(1u, 16u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4H, 8H> { uint immHb = (32 - shift) & 0x7F; @@ -1028,14 +1052,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImm_Sri_V_2S_4S([ValueSource(nameof(_ShrImm_Sri_V_2S_4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(1u, 32u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <2S, 4S> + [SkippableTheory] + [PairwiseData] + public void ShrImm_Sri_V_2S_4S([CombinatorialMemberData(nameof(_ShrImm_Sri_V_2S_4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(1u, 32u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2S, 4S> { uint immHb = (64 - shift) & 0x7F; @@ -1051,13 +1076,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImm_Sri_V_2D([ValueSource(nameof(_ShrImm_Sri_V_2D_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 64u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void ShrImm_Sri_V_2D([CombinatorialMemberData(nameof(_ShrImm_Sri_V_2D_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 64u)] uint shift) { uint immHb = (128 - shift) & 0x7F; @@ -1072,14 +1098,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImmNarrow_V_8H8B_8H16B([ValueSource(nameof(_ShrImmNarrow_V_8H8B_8H16B_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(1u, 8u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <8H8B, 8H16B> + [SkippableTheory] + [PairwiseData] + public void ShrImmNarrow_V_8H8B_8H16B([CombinatorialMemberData(nameof(_ShrImmNarrow_V_8H8B_8H16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(1u, 8u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8H8B, 8H16B> { uint immHb = (16 - shift) & 0x7F; @@ -1095,14 +1122,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImmNarrow_V_4S4H_4S8H([ValueSource(nameof(_ShrImmNarrow_V_4S4H_4S8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(1u, 16u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <4S4H, 4S8H> + [SkippableTheory] + [PairwiseData] + public void ShrImmNarrow_V_4S4H_4S8H([CombinatorialMemberData(nameof(_ShrImmNarrow_V_4S4H_4S8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(1u, 16u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4S4H, 4S8H> { uint immHb = (32 - shift) & 0x7F; @@ -1118,14 +1146,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImmNarrow_V_2D2S_2D4S([ValueSource(nameof(_ShrImmNarrow_V_2D2S_2D4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 32u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <2D2S, 2D4S> + [SkippableTheory] + [PairwiseData] + public void ShrImmNarrow_V_2D2S_2D4S([CombinatorialMemberData(nameof(_ShrImmNarrow_V_2D2S_2D4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 32u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2D2S, 2D4S> { uint immHb = (64 - shift) & 0x7F; @@ -1141,13 +1170,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void ShrImmSaturatingNarrow_S_HB([ValueSource(nameof(_ShrImmSaturatingNarrow_S_HB_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1H_))] ulong z, - [ValueSource(nameof(_1H_))] ulong a, - [Values(1u, 8u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void ShrImmSaturatingNarrow_S_HB([CombinatorialMemberData(nameof(_ShrImmSaturatingNarrow_S_HB_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1H_))] ulong z, + [CombinatorialMemberData(nameof(_1H_))] ulong a, + [CombinatorialValues(1u, 8u)] uint shift) { uint immHb = (16 - shift) & 0x7F; @@ -1162,13 +1192,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void ShrImmSaturatingNarrow_S_SH([ValueSource(nameof(_ShrImmSaturatingNarrow_S_SH_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1S_))] ulong z, - [ValueSource(nameof(_1S_))] ulong a, - [Values(1u, 16u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void ShrImmSaturatingNarrow_S_SH([CombinatorialMemberData(nameof(_ShrImmSaturatingNarrow_S_SH_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1S_))] ulong z, + [CombinatorialMemberData(nameof(_1S_))] ulong a, + [CombinatorialValues(1u, 16u)] uint shift) { uint immHb = (32 - shift) & 0x7F; @@ -1183,13 +1214,14 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void ShrImmSaturatingNarrow_S_DS([ValueSource(nameof(_ShrImmSaturatingNarrow_S_DS_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 32u)] uint shift) + [SkippableTheory] + [PairwiseData] + public void ShrImmSaturatingNarrow_S_DS([CombinatorialMemberData(nameof(_ShrImmSaturatingNarrow_S_DS_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 32u)] uint shift) { uint immHb = (64 - shift) & 0x7F; @@ -1204,14 +1236,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void ShrImmSaturatingNarrow_V_8H8B_8H16B([ValueSource(nameof(_ShrImmSaturatingNarrow_V_8H8B_8H16B_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong a, - [Values(1u, 8u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <8H8B, 8H16B> + [SkippableTheory] + [PairwiseData] + public void ShrImmSaturatingNarrow_V_8H8B_8H16B([CombinatorialMemberData(nameof(_ShrImmSaturatingNarrow_V_8H8B_8H16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong a, + [CombinatorialValues(1u, 8u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8H8B, 8H16B> { uint immHb = (16 - shift) & 0x7F; @@ -1227,14 +1260,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void ShrImmSaturatingNarrow_V_4S4H_4S8H([ValueSource(nameof(_ShrImmSaturatingNarrow_V_4S4H_4S8H_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong a, - [Values(1u, 16u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <4S4H, 4S8H> + [SkippableTheory] + [PairwiseData] + public void ShrImmSaturatingNarrow_V_4S4H_4S8H([CombinatorialMemberData(nameof(_ShrImmSaturatingNarrow_V_4S4H_4S8H_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong a, + [CombinatorialValues(1u, 16u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <4S4H, 4S8H> { uint immHb = (32 - shift) & 0x7F; @@ -1250,14 +1284,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void ShrImmSaturatingNarrow_V_2D2S_2D4S([ValueSource(nameof(_ShrImmSaturatingNarrow_V_2D2S_2D4S_))] uint opcodes, - [Values(0u)] uint rd, - [Values(1u, 0u)] uint rn, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong a, - [Values(1u, 32u)] uint shift, - [Values(0b0u, 0b1u)] uint q) // <2D2S, 2D4S> + [SkippableTheory] + [PairwiseData] + public void ShrImmSaturatingNarrow_V_2D2S_2D4S([CombinatorialMemberData(nameof(_ShrImmSaturatingNarrow_V_2D2S_2D4S_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u, 0u)] uint rn, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong a, + [CombinatorialValues(1u, 32u)] uint shift, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <2D2S, 2D4S> { uint immHb = (64 - shift) & 0x7F; diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm32.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm32.cs index 4d3c3f4292..f68a0d4150 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm32.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdShImm32.cs @@ -1,12 +1,19 @@ -// #define SimdShImm32 +#define SimdShImm32 +using ARMeilleure.State; +using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdShImm32")] public sealed class CpuTestSimdShImm32 : CpuTest32 { + public CpuTestSimdShImm32(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdShImm32 #region "ValueSource (Types)" @@ -110,60 +117,64 @@ namespace Ryujinx.Tests.Cpu private const int RndCnt = 2; private const int RndCntShiftImm = 2; - [Test, Pairwise] - public void Vshr_Imm_SU8([ValueSource(nameof(_Vshr_Imm_SU8_))] uint opcode, - [Range(0u, 3u)] uint rd, - [Range(0u, 3u)] uint rm, - [ValueSource(nameof(_8B_))] ulong z, - [ValueSource(nameof(_8B_))] ulong b, - [Values(1u, 8u)] uint shiftImm, - [Values] bool u, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vshr_Imm_SU8([CombinatorialMemberData(nameof(_Vshr_Imm_SU8_))] uint opcode, + [CombinatorialRange(0u, 3u, 1)] uint rd, + [CombinatorialRange(0u, 3u, 1)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong b, + [CombinatorialValues(1u, 8u)] uint shiftImm, + bool u, + bool q) { uint imm6 = 16 - shiftImm; Vshr_Imm_SU(opcode, rd, rm, z, b, imm6, u, q); } - [Test, Pairwise] - public void Vshr_Imm_SU16([ValueSource(nameof(_Vshr_Imm_SU16_))] uint opcode, - [Range(0u, 3u)] uint rd, - [Range(0u, 3u)] uint rm, - [ValueSource(nameof(_4H_))] ulong z, - [ValueSource(nameof(_4H_))] ulong b, - [Values(1u, 16u)] uint shiftImm, - [Values] bool u, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vshr_Imm_SU16([CombinatorialMemberData(nameof(_Vshr_Imm_SU16_))] uint opcode, + [CombinatorialRange(0u, 3u, 1)] uint rd, + [CombinatorialRange(0u, 3u, 1)] uint rm, + [CombinatorialMemberData(nameof(_4H_))] ulong z, + [CombinatorialMemberData(nameof(_4H_))] ulong b, + [CombinatorialValues(1u, 16u)] uint shiftImm, + bool u, + bool q) { uint imm6 = 32 - shiftImm; Vshr_Imm_SU(opcode, rd, rm, z, b, imm6, u, q); } - [Test, Pairwise] - public void Vshr_Imm_SU32([ValueSource(nameof(_Vshr_Imm_SU32_))] uint opcode, - [Range(0u, 3u)] uint rd, - [Range(0u, 3u)] uint rm, - [ValueSource(nameof(_2S_))] ulong z, - [ValueSource(nameof(_2S_))] ulong b, - [Values(1u, 32u)] uint shiftImm, - [Values] bool u, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vshr_Imm_SU32([CombinatorialMemberData(nameof(_Vshr_Imm_SU32_))] uint opcode, + [CombinatorialRange(0u, 3u, 1)] uint rd, + [CombinatorialRange(0u, 3u, 1)] uint rm, + [CombinatorialMemberData(nameof(_2S_))] ulong z, + [CombinatorialMemberData(nameof(_2S_))] ulong b, + [CombinatorialValues(1u, 32u)] uint shiftImm, + bool u, + bool q) { uint imm6 = 64 - shiftImm; Vshr_Imm_SU(opcode, rd, rm, z, b, imm6, u, q); } - [Test, Pairwise] - public void Vshr_Imm_SU64([ValueSource(nameof(_Vshr_Imm_SU64_))] uint opcode, - [Range(0u, 3u)] uint rd, - [Range(0u, 3u)] uint rm, - [ValueSource(nameof(_1D_))] ulong z, - [ValueSource(nameof(_1D_))] ulong b, - [Values(1u, 64u)] uint shiftImm, - [Values] bool u, - [Values] bool q) + [Theory] + [PairwiseData] + public void Vshr_Imm_SU64([CombinatorialMemberData(nameof(_Vshr_Imm_SU64_))] uint opcode, + [CombinatorialRange(0u, 3u, 1)] uint rd, + [CombinatorialRange(0u, 3u, 1)] uint rm, + [CombinatorialMemberData(nameof(_1D_))] ulong z, + [CombinatorialMemberData(nameof(_1D_))] ulong b, + [CombinatorialValues(1u, 64u)] uint shiftImm, + bool u, + bool q) { uint imm6 = 64 - shiftImm; @@ -200,15 +211,16 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VSHL. {}, , #")] - public void Vshl_Imm([Values(0u)] uint rd, - [Values(2u, 0u)] uint rm, - [Values(0u, 1u, 2u, 3u)] uint size, - [Random(RndCntShiftImm)] uint shiftImm, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool q) + [Theory(DisplayName = "VSHL. {}, , #")] + [PairwiseData] + public void Vshl_Imm([CombinatorialValues(0u)] uint rd, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0u, 1u, 2u, 3u)] uint size, + [CombinatorialRandomData(Count = RndCntShiftImm)] uint shiftImm, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool q) { uint opcode = 0xf2800510u; // VORR.I32 D0, #0 (immediate value changes it into SHL) if (q) @@ -234,14 +246,15 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise, Description("VSHRN. , , #")] - public void Vshrn_Imm([Values(0u, 1u)] uint rd, - [Values(2u, 0u)] uint rm, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCntShiftImm)] uint shiftImm, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b) + [Theory(DisplayName = "VSHRN. , , #")] + [PairwiseData] + public void Vshrn_Imm([CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCntShiftImm)] uint shiftImm, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b) { uint opcode = 0xf2800810u; // VMOV.I16 D0, #0 (immediate value changes it into SHRN) @@ -261,16 +274,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - [Test, Pairwise] - public void Vqshrn_Vqrshrn_Vrshrn_Imm([ValueSource(nameof(_Vqshrn_Vqrshrn_Vrshrn_Imm_))] uint opcode, - [Values(0u, 1u)] uint rd, - [Values(2u, 0u)] uint rm, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCntShiftImm)] uint shiftImm, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b, - [Values] bool u) + [Theory] + [PairwiseData] + public void Vqshrn_Vqrshrn_Vrshrn_Imm([CombinatorialMemberData(nameof(_Vqshrn_Vqrshrn_Vrshrn_Imm_))] uint opcode, + [CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCntShiftImm)] uint shiftImm, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b, + bool u) { uint imm = 1u << ((int)size + 3); imm |= shiftImm & (imm - 1); @@ -288,22 +302,23 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, z); V128 v2 = MakeVectorE0E1(b, z); - int fpscr = (int)TestContext.CurrentContext.Random.NextUInt() & (int)Fpsr.Qc; + int fpscr = (int)Random.Shared.NextUInt() & (int)Fpsr.Qc; SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, fpscr: fpscr); CompareAgainstUnicorn(fpsrMask: Fpsr.Qc); } - [Test, Pairwise] - public void Vqshrun_Vqrshrun_Imm([ValueSource(nameof(_Vqshrun_Vqrshrun_Imm_))] uint opcode, - [Values(0u, 1u)] uint rd, - [Values(2u, 0u)] uint rm, - [Values(0u, 1u, 2u)] uint size, - [Random(RndCntShiftImm)] uint shiftImm, - [Random(RndCnt)] ulong z, - [Random(RndCnt)] ulong a, - [Random(RndCnt)] ulong b) + [Theory] + [PairwiseData] + public void Vqshrun_Vqrshrun_Imm([CombinatorialMemberData(nameof(_Vqshrun_Vqrshrun_Imm_))] uint opcode, + [CombinatorialValues(0u, 1u)] uint rd, + [CombinatorialValues(2u, 0u)] uint rm, + [CombinatorialValues(0u, 1u, 2u)] uint size, + [CombinatorialRandomData(Count = RndCntShiftImm)] uint shiftImm, + [CombinatorialRandomData(Count = RndCnt)] ulong z, + [CombinatorialRandomData(Count = RndCnt)] ulong a, + [CombinatorialRandomData(Count = RndCnt)] ulong b) { uint imm = 1u << ((int)size + 3); imm |= shiftImm & (imm - 1); @@ -316,7 +331,7 @@ namespace Ryujinx.Tests.Cpu V128 v1 = MakeVectorE0E1(a, z); V128 v2 = MakeVectorE0E1(b, z); - int fpscr = (int)TestContext.CurrentContext.Random.NextUInt() & (int)Fpsr.Qc; + int fpscr = (int)Random.Shared.NextUInt() & (int)Fpsr.Qc; SingleOpcode(opcode, v0: v0, v1: v1, v2: v2, fpscr: fpscr); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSimdTbl.cs b/src/Ryujinx.Tests/Cpu/CpuTestSimdTbl.cs index d086209f22..94a341550b 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSimdTbl.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSimdTbl.cs @@ -4,12 +4,17 @@ using ARMeilleure.State; using System; using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("SimdTbl")] public sealed class CpuTestSimdTbl : CpuTest { + public CpuTestSimdTbl(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if SimdTbl #region "Helper methods" @@ -138,28 +143,16 @@ namespace Ryujinx.Tests.Cpu private const int RndCntIdxs = 2; - private static readonly uint[] _testData_rd = - { - 0u, - }; - private static readonly uint[] _testData_rn = - { - 1u, - }; - private static readonly uint[] _testData_rm = - { - 2u, - }; - private static readonly uint[] _testData_q = - { - 0b0u, 0b1u, // <8B, 16B> - }; - - public static readonly MatrixTheoryData TestData = new(_SingleRegisterTable_V_8B_16B_(), _testData_rd, _testData_rn, _testData_rm, _8B_(), _8B_(), _GenIdxsForTbl1_(), _testData_q); - - [Theory] - [MemberData(nameof(TestData))] - public void SingleRegisterTable_V_8B_16B(uint opcodes, uint rd, uint rn, uint rm, ulong z, ulong table0, ulong indexes, uint q) + [SkippableTheory] + [PairwiseData] + public void SingleRegisterTable_V_8B_16B([CombinatorialMemberData(nameof(_SingleRegisterTable_V_8B_16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(2u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong table0, + [CombinatorialMemberData(nameof(_GenIdxsForTbl1_))] ulong indexes, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -173,17 +166,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_Two_rm = - { - 3u, - }; - - public static readonly MatrixTheoryData TestData_Two = - new(_TwoRegisterTable_V_8B_16B_(), _testData_rd, _testData_rn, _testData_Two_rm, _8B_(), _8B_(), _8B_(), _GenIdxsForTbl2_(), _testData_q); - - [Theory] - [MemberData(nameof(TestData_Two))] - public void TwoRegisterTable_V_8B_16B(uint opcodes, uint rd, uint rn, uint rm, ulong z, ulong table0, ulong table1, ulong indexes, uint q) + [SkippableTheory] + [PairwiseData] + public void TwoRegisterTable_V_8B_16B([CombinatorialMemberData(nameof(_TwoRegisterTable_V_8B_16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(3u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong table0, + [CombinatorialMemberData(nameof(_8B_))] ulong table1, + [CombinatorialMemberData(nameof(_GenIdxsForTbl2_))] ulong indexes, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -198,25 +191,17 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_ModTwo_rd = - { - 30u, 1u, - }; - private static readonly uint[] _testData_ModTwo_rn = - { - 31u, - }; - private static readonly uint[] _testData_ModTwo_rm = - { - 1u, 30u, - }; - - public static readonly MatrixTheoryData TestData_ModTwo = - new(_TwoRegisterTable_V_8B_16B_(), _testData_ModTwo_rd, _testData_ModTwo_rn, _testData_ModTwo_rm, _8B_(), _8B_(), _8B_(), _GenIdxsForTbl2_(), _testData_q); - - [Theory] - [MemberData(nameof(TestData_ModTwo))] - public void Mod_TwoRegisterTable_V_8B_16B(uint opcodes, uint rd, uint rn, uint rm, ulong z, ulong table0, ulong table1, ulong indexes, uint q) + [SkippableTheory] + [PairwiseData] + public void Mod_TwoRegisterTable_V_8B_16B([CombinatorialMemberData(nameof(_TwoRegisterTable_V_8B_16B_))] uint opcodes, + [CombinatorialValues(30u, 1u)] uint rd, + [CombinatorialValues(31u)] uint rn, + [CombinatorialValues(1u, 30u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong table0, + [CombinatorialMemberData(nameof(_8B_))] ulong table1, + [CombinatorialMemberData(nameof(_GenIdxsForTbl2_))] ulong indexes, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -231,17 +216,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_Three_rm = - { - 4u, - }; - - public static readonly MatrixTheoryData TestData_Three = - new(_TwoRegisterTable_V_8B_16B_(), _testData_rd, _testData_rn, _testData_Three_rm, _8B_(), _8B_(), _8B_(), _8B_(), _GenIdxsForTbl3_(), _testData_q); - - [Theory] - [MemberData(nameof(TestData_Three))] - public void ThreeRegisterTable_V_8B_16B(uint opcodes, uint rd, uint rn, uint rm, ulong z, ulong table0, ulong table1, ulong table2, ulong indexes, uint q) + [SkippableTheory] + [PairwiseData] + public void ThreeRegisterTable_V_8B_16B([CombinatorialMemberData(nameof(_ThreeRegisterTable_V_8B_16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(4u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong table0, + [CombinatorialMemberData(nameof(_8B_))] ulong table1, + [CombinatorialMemberData(nameof(_8B_))] ulong table2, + [CombinatorialMemberData(nameof(_GenIdxsForTbl3_))] ulong indexes, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -257,21 +243,18 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_ModThree_rd = - { - 30u, 2u, - }; - private static readonly uint[] _testData_ModThree_rm = - { - 2u, 30u, - }; - - public static readonly MatrixTheoryData TestData_ModThree = - new(_ThreeRegisterTable_V_8B_16B_(), _testData_ModThree_rd, _testData_ModTwo_rn, _testData_ModThree_rm, _8B_(), _8B_(), _8B_(), _8B_(), _GenIdxsForTbl3_(), _testData_q); - - [Theory] - [MemberData(nameof(TestData_ModThree))] - public void Mod_ThreeRegisterTable_V_8B_16B(uint opcodes, uint rd, uint rn, uint rm, ulong z, ulong table0, ulong table1, ulong table2, ulong indexes, uint q) + [SkippableTheory] + [PairwiseData] + public void Mod_ThreeRegisterTable_V_8B_16B([CombinatorialMemberData(nameof(_ThreeRegisterTable_V_8B_16B_))] uint opcodes, + [CombinatorialValues(30u, 2u)] uint rd, + [CombinatorialValues(31u)] uint rn, + [CombinatorialValues(2u, 30u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong table0, + [CombinatorialMemberData(nameof(_8B_))] ulong table1, + [CombinatorialMemberData(nameof(_8B_))] ulong table2, + [CombinatorialMemberData(nameof(_GenIdxsForTbl3_))] ulong indexes, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -287,17 +270,19 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_Four_rm = - { - 5u, - }; - - public static readonly MatrixTheoryData TestData_Four = - new(_FourRegisterTable_V_8B_16B_(), _testData_rd, _testData_rn, _testData_Four_rm, _8B_(), _8B_(), _8B_(), _8B_(), _8B_(), _GenIdxsForTbl4_(), _testData_q); - - [Theory] - [MemberData(nameof(TestData_Four))] - public void FourRegisterTable_V_8B_16B(uint opcodes, uint rd, uint rn, uint rm, ulong z, ulong table0, ulong table1, ulong table2, ulong table3, ulong indexes, uint q) + [SkippableTheory] + [PairwiseData] + public void FourRegisterTable_V_8B_16B([CombinatorialMemberData(nameof(_FourRegisterTable_V_8B_16B_))] uint opcodes, + [CombinatorialValues(0u)] uint rd, + [CombinatorialValues(1u)] uint rn, + [CombinatorialValues(5u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong table0, + [CombinatorialMemberData(nameof(_8B_))] ulong table1, + [CombinatorialMemberData(nameof(_8B_))] ulong table2, + [CombinatorialMemberData(nameof(_8B_))] ulong table3, + [CombinatorialMemberData(nameof(_GenIdxsForTbl4_))] ulong indexes, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); @@ -314,21 +299,19 @@ namespace Ryujinx.Tests.Cpu CompareAgainstUnicorn(); } - private static readonly uint[] _testData_ModFour_rd = - { - 30u, 3u, - }; - private static readonly uint[] _testData_ModFour_rm = - { - 3u, 30u, - }; - - public static readonly MatrixTheoryData TestData_ModFour = - new(_FourRegisterTable_V_8B_16B_(), _testData_ModFour_rd, _testData_ModTwo_rn, _testData_ModFour_rm, _8B_(), _8B_(), _8B_(), _8B_(), _8B_(), _GenIdxsForTbl4_(), _testData_q); - - [Theory] - [MemberData(nameof(TestData_ModFour))] - public void Mod_FourRegisterTable_V_8B_16B(uint opcodes, uint rd, uint rn, uint rm, ulong z, ulong table0, ulong table1, ulong table2, ulong table3, ulong indexes, uint q) + [SkippableTheory] + [PairwiseData] + public void Mod_FourRegisterTable_V_8B_16B([CombinatorialMemberData(nameof(_FourRegisterTable_V_8B_16B_))] uint opcodes, + [CombinatorialValues(30u, 3u)] uint rd, + [CombinatorialValues(31u)] uint rn, + [CombinatorialValues(3u, 30u)] uint rm, + [CombinatorialMemberData(nameof(_8B_))] ulong z, + [CombinatorialMemberData(nameof(_8B_))] ulong table0, + [CombinatorialMemberData(nameof(_8B_))] ulong table1, + [CombinatorialMemberData(nameof(_8B_))] ulong table2, + [CombinatorialMemberData(nameof(_8B_))] ulong table3, + [CombinatorialMemberData(nameof(_GenIdxsForTbl4_))] ulong indexes, + [CombinatorialValues(0b0u, 0b1u)] uint q) // <8B, 16B> { opcodes |= ((rm & 31) << 16) | ((rn & 31) << 5) | ((rd & 31) << 0); opcodes |= ((q & 1) << 30); diff --git a/src/Ryujinx.Tests/Cpu/CpuTestSystem.cs b/src/Ryujinx.Tests/Cpu/CpuTestSystem.cs index 8415cef8ef..84ae7158e0 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestSystem.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestSystem.cs @@ -4,12 +4,17 @@ using ARMeilleure.State; using System; using System.Collections.Generic; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("System")] public sealed class CpuTestSystem : CpuTest { + public CpuTestSystem(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if System #region "ValueSource (Types)" @@ -47,16 +52,11 @@ namespace Ryujinx.Tests.Cpu } #endregion - private static readonly uint[] _testData_rt = - { - 0u, 1u, 31u, - }; - - public static readonly MatrixTheoryData TestData = new(_MrsMsr_Nzcv_(), _testData_rt, _GenNzcv_()); - - [Theory] - [MemberData(nameof(TestData))] - public void MrsMsr_Nzcv(uint opcodes, uint rt, ulong xt) + [SkippableTheory] + [PairwiseData] + public void MrsMsr_Nzcv([CombinatorialMemberData(nameof(_MrsMsr_Nzcv_))] uint opcodes, + [CombinatorialValues(0u, 1u, 31u)] uint rt, + [CombinatorialMemberData(nameof(_GenNzcv_))] ulong xt) { opcodes |= (rt & 31) << 0; diff --git a/src/Ryujinx.Tests/Cpu/CpuTestT32Alu.cs b/src/Ryujinx.Tests/Cpu/CpuTestT32Alu.cs index a25c9c827c..c106dd1b10 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestT32Alu.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestT32Alu.cs @@ -1,12 +1,17 @@ -#define T32Alu +#define T32Alu using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("T32Alu")] public sealed class CpuTestT32Alu : CpuTest32 { + public CpuTestT32Alu(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if T32Alu public static readonly PrecomputedThumbTestCase[] RsImmTestCases = { diff --git a/src/Ryujinx.Tests/Cpu/CpuTestT32Flow.cs b/src/Ryujinx.Tests/Cpu/CpuTestT32Flow.cs index 7670cfc3af..805babb007 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestT32Flow.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestT32Flow.cs @@ -1,14 +1,20 @@ -#define T32Flow +#define T32Flow using ARMeilleure.State; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("T32Flow")] public sealed class CpuTestT32Flow : CpuTest32 { + public CpuTestT32Flow(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if T32Flow + [Fact] public void TestT32B1() { diff --git a/src/Ryujinx.Tests/Cpu/CpuTestT32Mem.cs b/src/Ryujinx.Tests/Cpu/CpuTestT32Mem.cs index 47582be3ca..688638cbeb 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestT32Mem.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestT32Mem.cs @@ -1,13 +1,18 @@ -#define T32Mem +#define T32Mem using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("T32Mem")] public sealed class CpuTestT32Mem : CpuTest32 { + public CpuTestT32Mem(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if T32Mem public static readonly PrecomputedMemoryThumbTestCase[] ImmTestCases = { diff --git a/src/Ryujinx.Tests/Cpu/CpuTestThumb.cs b/src/Ryujinx.Tests/Cpu/CpuTestThumb.cs index 6eecf6baae..ac8ee666ac 100644 --- a/src/Ryujinx.Tests/Cpu/CpuTestThumb.cs +++ b/src/Ryujinx.Tests/Cpu/CpuTestThumb.cs @@ -1,26 +1,30 @@ -#define Thumb +#define Thumb using ARMeilleure.State; -using System; using Xunit; +using Xunit.Abstractions; namespace Ryujinx.Tests.Cpu { [Collection("Thumb")] public sealed class CpuTestThumb : CpuTest32 { + public CpuTestThumb(ITestOutputHelper testOutputHelper) : base(testOutputHelper) + { + } + #if Thumb + private const int RndCnt = 2; + private static uint RotateRight(uint value, int count) { return (value >> count) | (value << (32 - count)); } - public static readonly StaticTheoryData TestData_Imm = new(new[] {0u, 2u}, new[] { 1u, 0x1fu }, Random.Shared.NextUInt(), Random.Shared.NextUInt()); - [Theory] - [MemberData(nameof(TestData_Imm))] - public void ShiftImm(uint shiftType, uint shiftImm, uint w1, uint w2) + [PairwiseData] + public void ShiftImm([CombinatorialRange(0u, 2u, 1u)] uint shiftType, [CombinatorialRange(1u, 0x1fu, 1u)] uint shiftImm, [CombinatorialRandomData(Count = RndCnt)] uint w1, [CombinatorialRandomData(Count = RndCnt)] uint w2) { uint opcode = 0x0000; // MOVS , , # @@ -33,22 +37,20 @@ namespace Ryujinx.Tests.Cpu switch (shiftType) { case 0: - Assert.Equal(((w2 << (int)shiftImm) & 0xffffffffu), GetContext().GetX(1)); + Assert.Equal((w2 << (int)shiftImm) & 0xffffffffu, GetContext().GetX(1)); break; case 1: - Assert.Equal(((w2 >> (int)shiftImm) & 0xffffffffu), GetContext().GetX(1)); + Assert.Equal((w2 >> (int)shiftImm) & 0xffffffffu, GetContext().GetX(1)); break; case 2: - Assert.Equal((ulong)(((int)w2 >> (int)shiftImm) & 0xffffffffu), GetContext().GetX(1)); + Assert.Equal((ulong)((int)w2 >> (int)shiftImm) & 0xffffffffu, GetContext().GetX(1)); break; } } - public static readonly StaticTheoryData TestData_Reg = new(RangeUtils.RangeData(0u, 1u, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - [Theory] - [MemberData(nameof(TestData_Reg))] - public void AddSubReg(uint op, uint w1, uint w2) + [PairwiseData] + public void AddSubReg([CombinatorialRange(0u, 1u, 1u)] uint op, [CombinatorialRandomData(Count = RndCnt)] uint w1, [CombinatorialRandomData(Count = RndCnt)] uint w2) { uint opcode = 0x1800; // ADDS , , @@ -70,14 +72,9 @@ namespace Ryujinx.Tests.Cpu } } - // TODO: Change StaticTheoryData to work with differently sized lists - public static readonly StaticTheoryData TestData_Imm3_1 = new(0u, RangeUtils.RangeData(0u, 7u, 1u), Random.Shared.NextUInt()); - public static readonly StaticTheoryData TestData_Imm3_2 = new(1u, RangeUtils.RangeData(0u, 7u, 1u), Random.Shared.NextUInt()); - [Theory] - [MemberData(nameof(TestData_Imm3_1))] - [MemberData(nameof(TestData_Imm3_2))] - public void AddSubImm3(uint op, uint imm, uint w1) + [PairwiseData] + public void AddSubImm3([CombinatorialRange(0u, 1u, 1u)] uint op, [CombinatorialRange(0u, 7u, 1u)] uint imm, [CombinatorialRandomData(Count = RndCnt)] uint w1) { uint opcode = 0x1c00; // ADDS , , # @@ -98,13 +95,9 @@ namespace Ryujinx.Tests.Cpu } } - public static readonly StaticTheoryData TestData_AluImm1 = new(RangeUtils.RangeData(0u, 3u, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - public static readonly StaticTheoryData TestData_AluImm2 = new(RangeUtils.RangeData(0u, 3u, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - [Theory] - [MemberData(nameof(TestData_AluImm1))] - [MemberData(nameof(TestData_AluImm2))] - public void AluImm8(uint op, uint imm, uint w1) + [PairwiseData] + public void AluImm8([CombinatorialRange(0u, 3u, 1u)] uint op, [CombinatorialRandomData(Count = RndCnt)] uint imm, [CombinatorialRandomData(Count = RndCnt)] uint w1) { imm &= 0xff; @@ -141,13 +134,9 @@ namespace Ryujinx.Tests.Cpu } } - public static readonly StaticTheoryData TestData_AluRegLow1 = new(RangeUtils.RangeData(0u, 0xfu, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - public static readonly StaticTheoryData TestData_AluRegLow2 = new(RangeUtils.RangeData(0u, 0xfu, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - [Theory] - [MemberData(nameof(TestData_AluRegLow1))] - [MemberData(nameof(TestData_AluRegLow2))] - public void AluRegLow(uint op, uint w1, uint w2) + [PairwiseData] + public void AluRegLow([CombinatorialRange(0u, 0xfu, 1u)] uint op, [CombinatorialRandomData(Count = RndCnt)] uint w1, [CombinatorialRandomData(Count = RndCnt)] uint w2) { uint opcode = 0x4000; // ANDS , @@ -232,15 +221,9 @@ namespace Ryujinx.Tests.Cpu } } - public static readonly StaticTheoryData TestData_AluRegHigh1 = new(0u, RangeUtils.RangeData(0u, 13u, 1u), RangeUtils.RangeData(0u, 13u, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - public static readonly StaticTheoryData TestData_AluRegHigh2 = new(1u, RangeUtils.RangeData(0u, 13u, 1u), RangeUtils.RangeData(0u, 13u, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - public static readonly StaticTheoryData TestData_AluRegHigh3 = new(2u, RangeUtils.RangeData(0u, 13u, 1u), RangeUtils.RangeData(0u, 13u, 1u), Random.Shared.NextUInt(), Random.Shared.NextUInt()); - [Theory] - [MemberData(nameof(TestData_AluRegHigh1))] - [MemberData(nameof(TestData_AluRegHigh2))] - [MemberData(nameof(TestData_AluRegHigh3))] - public void AluRegHigh(uint op, uint rd, uint rm, uint w1, uint w2) + [PairwiseData] + public void AluRegHigh([CombinatorialRange(0u, 2u, 1u)] uint op, [CombinatorialRange(0u, 13u, 1u)] uint rd, [CombinatorialRange(0u, 13u, 1u)] uint rm, [CombinatorialRandomData(Count = RndCnt)] uint w1, [CombinatorialRandomData(Count = RndCnt)] uint w2) { if (rd == rm) {