Fix Fcvtl_V and Fcvtn_V; fix half to float conv. and add float to half conv. (full FP emu.). Add 4 FP Tests. (#468)
* Update CpuTest.cs * Update CpuTestSimd.cs * Superseded. * Update AInstEmitSimdCvt.cs * Update ASoftFloat.cs * Nit. * Update PackageReferences. * Update AInstEmitSimdArithmetic.cs * Update AVectorHelper.cs * Update ASoftFloat.cs * Update ASoftFallback.cs * Update AThreadState.cs * Create FPType.cs * Create FPExc.cs * Create FPCR.cs * Create FPSR.cs * Update ARoundMode.cs * Update APState.cs * Avoid an unwanted implicit cast of the operator >= to long, continuing to check for negative values. Remove a leftover. * Nits.
This commit is contained in:
parent
7920dc1d2f
commit
e674b37710
18 changed files with 863 additions and 200 deletions
|
@ -1,43 +0,0 @@
|
|||
using ChocolArm64.State;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using System.Runtime.Intrinsics;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
|
||||
namespace Ryujinx.Tests.Cpu
|
||||
{
|
||||
public class CpuTestSimdCvt : CpuTest
|
||||
{
|
||||
[TestCase((ushort)0x0000, 0x00000000u)] // Positive Zero
|
||||
[TestCase((ushort)0x8000, 0x80000000u)] // Negative Zero
|
||||
[TestCase((ushort)0x3E00, 0x3FC00000u)] // +1.5
|
||||
[TestCase((ushort)0xBE00, 0xBFC00000u)] // -1.5
|
||||
[TestCase((ushort)0xFFFF, 0xFFFFE000u)] // -QNaN
|
||||
[TestCase((ushort)0x7C00, 0x7F800000u)] // +Inf
|
||||
[TestCase((ushort)0x3C00, 0x3F800000u)] // 1.0
|
||||
[TestCase((ushort)0x3C01, 0x3F802000u)] // 1.0009765625
|
||||
[TestCase((ushort)0xC000, 0xC0000000u)] // -2.0
|
||||
[TestCase((ushort)0x7BFF, 0x477FE000u)] // 65504.0 (Largest Normal)
|
||||
[TestCase((ushort)0x03FF, 0x387FC000u)] // 0.00006097555 (Largest Subnormal)
|
||||
[TestCase((ushort)0x0001, 0x33800000u)] // 5.96046448e-8 (Smallest Subnormal)
|
||||
public void Fcvtl_V_f16(ushort Value, uint Result)
|
||||
{
|
||||
uint Opcode = 0x0E217801; // FCVTL V1.4S, V0.4H
|
||||
|
||||
Vector128<float> V0 = Sse.StaticCast<ushort, float>(Sse2.SetAllVector128(Value));
|
||||
|
||||
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0);
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(Sse41.Extract(Sse.StaticCast<float, uint>(ThreadState.V1), (byte)0), Is.EqualTo(Result));
|
||||
Assert.That(Sse41.Extract(Sse.StaticCast<float, uint>(ThreadState.V1), (byte)1), Is.EqualTo(Result));
|
||||
Assert.That(Sse41.Extract(Sse.StaticCast<float, uint>(ThreadState.V1), (byte)2), Is.EqualTo(Result));
|
||||
Assert.That(Sse41.Extract(Sse.StaticCast<float, uint>(ThreadState.V1), (byte)3), Is.EqualTo(Result));
|
||||
});
|
||||
|
||||
CompareAgainstUnicorn();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue