diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-07-06 08:40:31 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-06 13:40:31 +0200 |
| commit | f7ef6364b79ba04af5c7bf0f5ec77fbb6b4aae29 (patch) | |
| tree | 21cb107e245c3bb788a9110b1b625735920478bc /Ryujinx.Tests/Cpu/CpuTestSimd.cs | |
| parent | b46b63e06a36845175f68331edb5ddeeb34de27b (diff) | |
Implement CPU FCVT Half <-> Double conversion variants (#3439)
* Half <-> Double conversion support
* Add tests, fast path and deduplicate SoftFloat code
* PPTC version
Diffstat (limited to 'Ryujinx.Tests/Cpu/CpuTestSimd.cs')
| -rw-r--r-- | Ryujinx.Tests/Cpu/CpuTestSimd.cs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Ryujinx.Tests/Cpu/CpuTestSimd.cs b/Ryujinx.Tests/Cpu/CpuTestSimd.cs index c20e11ee..be3db0e7 100644 --- a/Ryujinx.Tests/Cpu/CpuTestSimd.cs +++ b/Ryujinx.Tests/Cpu/CpuTestSimd.cs @@ -825,6 +825,14 @@ namespace Ryujinx.Tests.Cpu }; } + private static uint[] _F_Cvt_S_DH_() + { + return new uint[] + { + 0x1E63C020u // FCVT H0, D1 + }; + } + private static uint[] _F_Cvt_S_HS_() { return new uint[] @@ -833,6 +841,14 @@ namespace Ryujinx.Tests.Cpu }; } + private static uint[] _F_Cvt_S_HD_() + { + return new uint[] + { + 0x1EE2C020u // FCVT D0, H1 + }; + } + private static uint[] _F_Cvt_ANZ_SU_S_S_() { return new uint[] @@ -1999,6 +2015,22 @@ namespace Ryujinx.Tests.Cpu } [Test, Pairwise] [Explicit] + public void F_Cvt_S_DH([ValueSource("_F_Cvt_S_DH_")] uint opcodes, + [ValueSource("_1D_F_")] ulong a, + [Values(RMode.Rn)] RMode rMode) + { + ulong z = TestContext.CurrentContext.Random.NextULong(); + V128 v0 = MakeVectorE0E1(z, z); + V128 v1 = MakeVectorE0(a); + + int fpcr = (int)rMode << (int)Fpcr.RMode; + + SingleOpcode(opcodes, v0: v0, v1: v1, fpcr: fpcr); + + CompareAgainstUnicorn(); + } + + [Test, Pairwise] [Explicit] public void F_Cvt_S_HS([ValueSource("_F_Cvt_S_HS_")] uint opcodes, [ValueSource("_1H_F_")] ulong a) { @@ -2012,6 +2044,19 @@ namespace Ryujinx.Tests.Cpu } [Test, Pairwise] [Explicit] + public void F_Cvt_S_HD([ValueSource("_F_Cvt_S_HD_")] uint opcodes, + [ValueSource("_1H_F_")] ulong a) + { + ulong z = TestContext.CurrentContext.Random.NextULong(); + V128 v0 = MakeVectorE0E1(z, z); + V128 v1 = MakeVectorE0(a); + + SingleOpcode(opcodes, v0: v0, v1: v1); + + CompareAgainstUnicorn(); + } + + [Test, Pairwise] [Explicit] public void F_Cvt_ANZ_SU_S_S([ValueSource("_F_Cvt_ANZ_SU_S_S_")] uint opcodes, [ValueSource("_1S_F_W_")] ulong a) { |
