diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-05-11 20:10:27 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-11 20:10:27 -0300 |
| commit | f9f111bc85a4735391a8479e9a8d36a30ae7f3a9 (patch) | |
| tree | a1b29a56dc151875a58611382b3a67050b32a95c /Ryujinx.Tests/Cpu/CpuTestScalar.cs | |
| parent | 8e306b3ac14f93ef4e77210c2a23a219760bb55c (diff) | |
Add intrinsics support (#121)
* Initial intrinsics support
* Update tests to work with the new Vector128 type and intrinsics
* Drop SSE4.1 requirement
* Fix copy-paste mistake
Diffstat (limited to 'Ryujinx.Tests/Cpu/CpuTestScalar.cs')
| -rw-r--r-- | Ryujinx.Tests/Cpu/CpuTestScalar.cs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Ryujinx.Tests/Cpu/CpuTestScalar.cs b/Ryujinx.Tests/Cpu/CpuTestScalar.cs index c7c3aa05..d1a0c313 100644 --- a/Ryujinx.Tests/Cpu/CpuTestScalar.cs +++ b/Ryujinx.Tests/Cpu/CpuTestScalar.cs @@ -1,6 +1,9 @@ using ChocolArm64.State; + using NUnit.Framework; +using System.Runtime.Intrinsics.X86; + namespace Ryujinx.Tests.Cpu { public class CpuTestScalar : CpuTest @@ -25,8 +28,10 @@ namespace Ryujinx.Tests.Cpu public void Fmax_S(uint Opcode, ulong A, ulong B, ulong Result) { // FMAX S0, S1, S2 - AThreadState ThreadState = SingleOpcode(Opcode, V1: new AVec { X0 = A }, V2: new AVec { X0 = B }); - Assert.AreEqual(Result, ThreadState.V0.X0); + AThreadState ThreadState = SingleOpcode(Opcode, + V1: Sse.StaticCast<ulong, float>(Sse2.SetVector128(0, A)), + V2: Sse.StaticCast<ulong, float>(Sse2.SetVector128(0, B))); + Assert.AreEqual(Result, Sse41.Extract(Sse.StaticCast<float, ulong>(ThreadState.V0), 0)); } [TestCase(0x1E225820u, 0x0000000000000000ul, 0x0000000080000000ul, 0x0000000080000000ul)] @@ -49,8 +54,10 @@ namespace Ryujinx.Tests.Cpu public void Fmin_S(uint Opcode, ulong A, ulong B, ulong Result) { // FMIN S0, S1, S2 - AThreadState ThreadState = SingleOpcode(Opcode, V1: new AVec { X0 = A }, V2: new AVec { X0 = B }); - Assert.AreEqual(Result, ThreadState.V0.X0); + AThreadState ThreadState = SingleOpcode(Opcode, + V1: Sse.StaticCast<ulong, float>(Sse2.SetVector128(0, A)), + V2: Sse.StaticCast<ulong, float>(Sse2.SetVector128(0, B))); + Assert.AreEqual(Result, Sse41.Extract(Sse.StaticCast<float, ulong>(ThreadState.V0), 0)); } } } |
