From 8df0b62fe0befdd2d91f0a971a72781156bfefcd Mon Sep 17 00:00:00 2001 From: Merry Date: Mon, 19 Feb 2018 04:17:26 +0000 Subject: [PATCH] Tests: Add Fmax_S test (#23) --- Ryujinx.Tests/Cpu/CpuTestScalar.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Ryujinx.Tests/Cpu/CpuTestScalar.cs diff --git a/Ryujinx.Tests/Cpu/CpuTestScalar.cs b/Ryujinx.Tests/Cpu/CpuTestScalar.cs new file mode 100644 index 0000000000..26549b8724 --- /dev/null +++ b/Ryujinx.Tests/Cpu/CpuTestScalar.cs @@ -0,0 +1,30 @@ +using ChocolArm64.State; +using NUnit.Framework; + +namespace Ryujinx.Tests.Cpu +{ + [TestFixture] + public partial class CpuTest + { + [TestCase(0x00000000u, 0x80000000u, 0x00000000u)] + [TestCase(0x80000000u, 0x00000000u, 0x00000000u)] + [TestCase(0x80000000u, 0x80000000u, 0x80000000u)] + [TestCase(0x3DCCCCCDu, 0x3C9623B1u, 0x3DCCCCCDu)] + [TestCase(0x8BA98D27u, 0x00000076u, 0x00000076u)] + [TestCase(0x807FFFFFu, 0x7F7FFFFFu, 0x7F7FFFFFu)] + [TestCase(0x7F7FFFFFu, 0x807FFFFFu, 0x7F7FFFFFu)] + [TestCase(0x7FC00000u, 0x3F800000u, 0x7FC00000u)] + [TestCase(0x3F800000u, 0x7FC00000u, 0x7FC00000u)] + // NaN tests + //[TestCase(0x7F800001u, 0x7FC00042u, 0x7FC00001u)] + //[TestCase(0x7FC00042u, 0x7F800001u, 0x7FC00001u)] + //[TestCase(0x7FC0000Au, 0x7FC0000Bu, 0x7FC0000Au)] + public void Fmax_S(uint A, uint B, uint Result) + { + // FMAX S0, S1, S2 + uint Opcode = 0x1E224820; + AThreadState ThreadState = SingleOpcode(Opcode, V1: new AVec { W0 = A }, V2: new AVec { W0 = B }); + Assert.AreEqual(Result, ThreadState.V0.W0); + } + } +}