diff options
| author | LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com> | 2018-06-26 03:32:29 +0200 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-06-25 22:32:29 -0300 |
| commit | 8f6387128ad6fc6a6106d1347f86ea97e549f5a2 (patch) | |
| tree | 3d14d93182910d614cdcbf01962752e635ded1c9 /Ryujinx.Tests/Cpu/Tester | |
| parent | 37a6e84fd49a4e73747281e92d795c5401be901e (diff) | |
Add Sse Opt. for Cmeq_V_2D, Cmgt_V_2D (Reg). Add Sse Opt. for Crc32cb, Crc32ch, Crc32cw, Crc32cx. Add 10 simple tests for Fcmgt, Fcmge, Fcmeq, Fcmle, Fcmlt (S, V) (Reg, Zero). Add 2 Cnt_V tests. (#183)
* Add files via upload
* Add files via upload
* Add files via upload
* CPE
* Add EmitSse42Crc32()
* Update CpuTestSimdCmp.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimd.cs
* Update Instructions.cs
Diffstat (limited to 'Ryujinx.Tests/Cpu/Tester')
| -rw-r--r-- | Ryujinx.Tests/Cpu/Tester/Instructions.cs | 41 | ||||
| -rw-r--r-- | Ryujinx.Tests/Cpu/Tester/Pseudocode.cs | 18 |
2 files changed, 54 insertions, 5 deletions
diff --git a/Ryujinx.Tests/Cpu/Tester/Instructions.cs b/Ryujinx.Tests/Cpu/Tester/Instructions.cs index aa62ddcc..a4e04e96 100644 --- a/Ryujinx.Tests/Cpu/Tester/Instructions.cs +++ b/Ryujinx.Tests/Cpu/Tester/Instructions.cs @@ -1826,7 +1826,7 @@ namespace Ryujinx.Tests.Cpu.Tester // addp_advsimd_pair.html public static void Addp_S(Bits size, Bits Rn, Bits Rd) { - /* Decode Scalar */ + /* Decode */ int d = (int)UInt(Rd); int n = (int)UInt(Rn); @@ -1875,7 +1875,7 @@ namespace Ryujinx.Tests.Cpu.Tester { const bool U = false; - /* Decode */ + /* Decode Vector */ int d = (int)UInt(Rd); int n = (int)UInt(Rn); @@ -1917,7 +1917,7 @@ namespace Ryujinx.Tests.Cpu.Tester { const bool U = true; - /* Decode */ + /* Decode Vector */ int d = (int)UInt(Rd); int n = (int)UInt(Rn); @@ -2654,6 +2654,37 @@ namespace Ryujinx.Tests.Cpu.Tester V(d, result); } + // cnt_advsimd.html + public static void Cnt_V(bool Q, Bits size, Bits Rn, Bits Rd) + { + /* Decode Vector */ + int d = (int)UInt(Rd); + int n = (int)UInt(Rn); + + /* if size != '00' then ReservedValue(); */ + + int esize = 8; + int datasize = (Q ? 128 : 64); + int elements = datasize / 8; + + /* Operation */ + /* CheckFPAdvSIMDEnabled64(); */ + + Bits result = new Bits(datasize); + Bits operand = V(datasize, n); + + BigInteger count; + + for (int e = 0; e <= elements - 1; e++) + { + count = (BigInteger)BitCount(Elem(operand, e, esize)); + + Elem(result, e, esize, count.SubBigInteger(esize - 1, 0)); + } + + V(d, result); + } + // neg_advsimd.html#NEG_asisdmisc_R public static void Neg_S(Bits size, Bits Rn, Bits Rd) { @@ -2745,7 +2776,7 @@ namespace Ryujinx.Tests.Cpu.Tester // not_advsimd.html public static void Not_V(bool Q, Bits Rn, Bits Rd) { - /* Decode */ + /* Decode Vector */ int d = (int)UInt(Rd); int n = (int)UInt(Rn); @@ -3095,7 +3126,7 @@ namespace Ryujinx.Tests.Cpu.Tester // addp_advsimd_vec.html public static void Addp_V(bool Q, Bits size, Bits Rm, Bits Rn, Bits Rd) { - /* Decode Vector */ + /* Decode */ int d = (int)UInt(Rd); int n = (int)UInt(Rn); int m = (int)UInt(Rm); diff --git a/Ryujinx.Tests/Cpu/Tester/Pseudocode.cs b/Ryujinx.Tests/Cpu/Tester/Pseudocode.cs index 363e2de9..3a877fb1 100644 --- a/Ryujinx.Tests/Cpu/Tester/Pseudocode.cs +++ b/Ryujinx.Tests/Cpu/Tester/Pseudocode.cs @@ -586,6 +586,24 @@ namespace Ryujinx.Tests.Cpu.Tester return (x >= 0 ? x : -x); } + // shared_pseudocode.html#impl-shared.BitCount.1 + public static int BitCount(Bits x) + { + int N = x.Count; + + int result = 0; + + for (int i = 0; i <= N - 1; i++) + { + if (x[i]) + { + result = result + 1; + } + } + + return result; + } + // shared_pseudocode.html#impl-shared.CountLeadingSignBits.1 public static int CountLeadingSignBits(Bits x) { |
