2018-04-20 17:40:15 +02:00
|
|
|
#define Simd
|
|
|
|
|
|
|
|
using ChocolArm64.State;
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
2018-05-12 01:10:27 +02:00
|
|
|
using System.Runtime.Intrinsics;
|
|
|
|
|
2018-04-20 17:40:15 +02:00
|
|
|
namespace Ryujinx.Tests.Cpu
|
|
|
|
{
|
|
|
|
using Tester;
|
|
|
|
using Tester.Types;
|
|
|
|
|
2018-07-03 08:31:16 +02:00
|
|
|
[Category("Simd")/*, Ignore("Tested: second half of 2018.")*/]
|
2018-04-20 17:40:15 +02:00
|
|
|
public sealed class CpuTestSimd : CpuTest
|
|
|
|
{
|
|
|
|
#if Simd
|
|
|
|
[SetUp]
|
|
|
|
public void SetupTester()
|
|
|
|
{
|
|
|
|
AArch64.TakeReset(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
#region "ValueSource"
|
2018-04-21 21:15:04 +02:00
|
|
|
private static ulong[] _1D_()
|
2018-04-20 17:40:15 +02:00
|
|
|
{
|
|
|
|
return new ulong[] { 0x0000000000000000ul, 0x7FFFFFFFFFFFFFFFul,
|
|
|
|
0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul };
|
|
|
|
}
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
private static ulong[] _1H1S1D_()
|
|
|
|
{
|
|
|
|
return new ulong[] { 0x0000000000000000ul, 0x0000000000007FFFul,
|
|
|
|
0x0000000000008000ul, 0x000000000000FFFFul,
|
|
|
|
0x000000007FFFFFFFul, 0x0000000080000000ul,
|
|
|
|
0x00000000FFFFFFFFul, 0x7FFFFFFFFFFFFFFFul,
|
|
|
|
0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul };
|
|
|
|
}
|
|
|
|
|
|
|
|
private static ulong[] _4H2S1D_()
|
|
|
|
{
|
|
|
|
return new ulong[] { 0x0000000000000000ul, 0x7FFF7FFF7FFF7FFFul,
|
|
|
|
0x8000800080008000ul, 0x7FFFFFFF7FFFFFFFul,
|
|
|
|
0x8000000080000000ul, 0x7FFFFFFFFFFFFFFFul,
|
|
|
|
0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul };
|
|
|
|
}
|
|
|
|
|
2018-06-18 19:55:26 +02:00
|
|
|
private static ulong[] _8B_()
|
|
|
|
{
|
|
|
|
return new ulong[] { 0x0000000000000000ul, 0x7F7F7F7F7F7F7F7Ful,
|
|
|
|
0x8080808080808080ul, 0xFFFFFFFFFFFFFFFFul };
|
|
|
|
}
|
|
|
|
|
2018-04-21 21:15:04 +02:00
|
|
|
private static ulong[] _8B4H_()
|
|
|
|
{
|
|
|
|
return new ulong[] { 0x0000000000000000ul, 0x7F7F7F7F7F7F7F7Ful,
|
|
|
|
0x8080808080808080ul, 0x7FFF7FFF7FFF7FFFul,
|
|
|
|
0x8000800080008000ul, 0xFFFFFFFFFFFFFFFFul };
|
|
|
|
}
|
|
|
|
|
2018-04-20 17:40:15 +02:00
|
|
|
private static ulong[] _8B4H2S_()
|
|
|
|
{
|
|
|
|
return new ulong[] { 0x0000000000000000ul, 0x7F7F7F7F7F7F7F7Ful,
|
|
|
|
0x8080808080808080ul, 0x7FFF7FFF7FFF7FFFul,
|
|
|
|
0x8000800080008000ul, 0x7FFFFFFF7FFFFFFFul,
|
|
|
|
0x8000000080000000ul, 0xFFFFFFFFFFFFFFFFul };
|
|
|
|
}
|
|
|
|
|
2018-04-21 21:15:04 +02:00
|
|
|
private static ulong[] _8B4H2S1D_()
|
2018-04-20 17:40:15 +02:00
|
|
|
{
|
|
|
|
return new ulong[] { 0x0000000000000000ul, 0x7F7F7F7F7F7F7F7Ful,
|
|
|
|
0x8080808080808080ul, 0x7FFF7FFF7FFF7FFFul,
|
|
|
|
0x8000800080008000ul, 0x7FFFFFFF7FFFFFFFul,
|
|
|
|
0x8000000080000000ul, 0x7FFFFFFFFFFFFFFFul,
|
|
|
|
0x8000000000000000ul, 0xFFFFFFFFFFFFFFFFul };
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
private const int RndCnt = 1;
|
|
|
|
|
2018-04-20 17:40:15 +02:00
|
|
|
[Test, Description("ABS <V><d>, <V><n>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Abs_S_D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-04-20 17:40:15 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x5EE0B800; // ABS D0, D0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-20 17:40:15 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
2018-04-20 17:40:15 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-04-20 17:40:15 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Abs_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-04-20 17:40:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("ABS <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Abs_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-04-20 17:40:15 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E20B800; // ABS V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-20 17:40:15 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
2018-04-20 17:40:15 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-04-20 17:40:15 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Abs_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-04-20 17:40:15 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("ABS <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Abs_V_16B_8H_4S_2D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-20 17:40:15 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E20B800; // ABS V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-20 17:40:15 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-04-20 17:40:15 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-20 17:40:15 +02:00
|
|
|
SimdFp.Abs_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-05-12 01:10:27 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-20 17:40:15 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("ADDP <V><d>, <Vn>.<T>")]
|
|
|
|
public void Addp_S_2DD([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-04-21 21:15:04 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x5EF1B800; // ADDP D0, V0.2D
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-21 21:15:04 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-04-21 21:15:04 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-21 21:15:04 +02:00
|
|
|
SimdFp.Addp_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-21 21:15:04 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("ADDV <V><d>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Addv_V_8BB_4HH([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H_")] [Random(RndCnt)] ulong A,
|
|
|
|
[Values(0b00u, 0b01u)] uint size) // <8BB, 4HH>
|
2018-04-21 21:15:04 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E31B800; // ADDV B0, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-21 21:15:04 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
2018-04-21 21:15:04 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-04-21 21:15:04 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Addv_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-04-21 21:15:04 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("ADDV <V><d>, <Vn>.<T>")]
|
|
|
|
public void Addv_V_16BB_8HH_4SS([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <16BB, 8HH, 4SS>
|
2018-04-21 21:15:04 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E31B800; // ADDV B0, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-21 21:15:04 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-04-21 21:15:04 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-21 21:15:04 +02:00
|
|
|
SimdFp.Addv_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-21 21:15:04 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
[Test, Description("CLS <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cls_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E204800; // CLS V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cls_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CLS <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Cls_V_16B_8H_4S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E204800; // CLS V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
SimdFp.Cls_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-05-12 01:10:27 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CLZ <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Clz_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E204800; // CLZ V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Clz_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CLZ <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Clz_V_16B_8H_4S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E204800; // CLZ V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
SimdFp.Clz_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-05-12 01:10:27 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
Add Cls_V, Clz_V, Orn_V instructions. Add 18 Tests: And_V, Bic_V, Bif_V, Bit_V, Bsl_V, Cls_V, Clz_V, Orn_V, Orr_V. (#104)
* Update AOpCodeTable.cs
* Update AInstEmitSimdLogical.cs
* Update AInstEmitSimdArithmetic.cs
* Update ASoftFallback.cs
* Update AInstEmitAlu.cs
* Update Pseudocode.cs
* Update Instructions.cs
* Update CpuTestSimdReg.cs
* Update CpuTestSimd.cs
2018-04-26 04:20:22 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-06-18 19:55:26 +02:00
|
|
|
[Test, Description("CMEQ <V><d>, <V><n>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmeq_S_D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x5EE09800; // CMEQ D0, D0, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmeq_Zero_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMEQ <Vd>.<T>, <Vn>.<T>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmeq_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E209800; // CMEQ V0.8B, V0.8B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmeq_Zero_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CMEQ <Vd>.<T>, <Vn>.<T>, #0")]
|
|
|
|
public void Cmeq_V_16B_8H_4S_2D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E209800; // CMEQ V0.16B, V0.16B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-06-18 19:55:26 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-18 19:55:26 +02:00
|
|
|
SimdFp.Cmeq_Zero_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMGE <V><d>, <V><n>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmge_S_D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x7EE08800; // CMGE D0, D0, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmge_Zero_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMGE <Vd>.<T>, <Vn>.<T>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmge_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E208800; // CMGE V0.8B, V0.8B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmge_Zero_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CMGE <Vd>.<T>, <Vn>.<T>, #0")]
|
|
|
|
public void Cmge_V_16B_8H_4S_2D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E208800; // CMGE V0.16B, V0.16B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-06-18 19:55:26 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-18 19:55:26 +02:00
|
|
|
SimdFp.Cmge_Zero_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMGT <V><d>, <V><n>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmgt_S_D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x5EE08800; // CMGT D0, D0, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmgt_Zero_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMGT <Vd>.<T>, <Vn>.<T>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmgt_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E208800; // CMGT V0.8B, V0.8B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmgt_Zero_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CMGT <Vd>.<T>, <Vn>.<T>, #0")]
|
|
|
|
public void Cmgt_V_16B_8H_4S_2D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E208800; // CMGT V0.16B, V0.16B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-06-18 19:55:26 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-18 19:55:26 +02:00
|
|
|
SimdFp.Cmgt_Zero_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMLE <V><d>, <V><n>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmle_S_D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x7EE09800; // CMLE D0, D0, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmle_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMLE <Vd>.<T>, <Vn>.<T>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmle_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E209800; // CMLE V0.8B, V0.8B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmle_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CMLE <Vd>.<T>, <Vn>.<T>, #0")]
|
|
|
|
public void Cmle_V_16B_8H_4S_2D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E209800; // CMLE V0.16B, V0.16B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-06-18 19:55:26 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-18 19:55:26 +02:00
|
|
|
SimdFp.Cmle_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMLT <V><d>, <V><n>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmlt_S_D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x5EE0A800; // CMLT D0, D0, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmlt_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CMLT <Vd>.<T>, <Vn>.<T>, #0")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cmlt_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E20A800; // CMLT V0.8B, V0.8B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cmlt_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CMLT <Vd>.<T>, <Vn>.<T>, #0")]
|
|
|
|
public void Cmlt_V_16B_8H_4S_2D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-18 19:55:26 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E20A800; // CMLT V0.16B, V0.16B, #0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-06-18 19:55:26 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-18 19:55:26 +02:00
|
|
|
SimdFp.Cmlt_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
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
2018-06-26 03:32:29 +02:00
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("CNT <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Cnt_V_8B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
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
2018-06-26 03:32:29 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E205800; // CNT V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
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
2018-06-26 03:32:29 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
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
2018-06-26 03:32:29 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
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
2018-06-26 03:32:29 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Cnt_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
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
2018-06-26 03:32:29 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("CNT <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Cnt_V_16B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
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
2018-06-26 03:32:29 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E205800; // CNT V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
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
2018-06-26 03:32:29 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
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
2018-06-26 03:32:29 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
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
2018-06-26 03:32:29 +02:00
|
|
|
SimdFp.Cnt_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-04-20 17:40:15 +02:00
|
|
|
[Test, Description("NEG <V><d>, <V><n>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Neg_S_D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1D_")] [Random(RndCnt)] ulong A)
|
2018-04-20 17:40:15 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x7EE0B800; // NEG D0, D0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-20 17:40:15 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
2018-04-20 17:40:15 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-04-20 17:40:15 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Neg_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-04-20 17:40:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("NEG <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Neg_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-04-20 17:40:15 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E20B800; // NEG V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-20 17:40:15 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
2018-04-20 17:40:15 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-04-20 17:40:15 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Neg_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-04-20 17:40:15 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("NEG <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Neg_V_16B_8H_4S_2D([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-20 17:40:15 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u, 0b11u)] uint size) // <16B, 8H, 4S, 2D>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E20B800; // NEG V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-20 17:40:15 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-04-20 17:40:15 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-20 17:40:15 +02:00
|
|
|
SimdFp.Neg_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-05-12 01:10:27 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-20 17:40:15 +02:00
|
|
|
});
|
|
|
|
}
|
2018-04-30 01:39:58 +02:00
|
|
|
|
2018-06-18 19:55:26 +02:00
|
|
|
[Test, Description("NOT <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Not_V_8B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E205800; // NOT V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-18 19:55:26 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-18 19:55:26 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Not_V(Op[30], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-18 19:55:26 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("NOT <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Not_V_16B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
2018-06-18 19:55:26 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E205800; // NOT V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-18 19:55:26 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-06-18 19:55:26 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-18 19:55:26 +02:00
|
|
|
SimdFp.Not_V(Op[30], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-03 08:31:16 +02:00
|
|
|
[Test, Description("RBIT <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Rbit_V_8B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
2018-07-03 08:31:16 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E605800; // RBIT V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-07-03 08:31:16 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-07-03 08:31:16 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Rbit_V(Op[30], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-07-03 08:31:16 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("RBIT <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Rbit_V_16B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
2018-07-03 08:31:16 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E605800; // RBIT V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-07-03 08:31:16 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-07-03 08:31:16 +02:00
|
|
|
SimdFp.Rbit_V(Op[30], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("REV16 <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Rev16_V_8B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
2018-07-03 08:31:16 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E201800; // REV16 V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-07-03 08:31:16 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-07-03 08:31:16 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Rev16_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-07-03 08:31:16 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("REV16 <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Rev16_V_16B([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B_")] [Random(RndCnt)] ulong A)
|
2018-07-03 08:31:16 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E201800; // REV16 V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-07-03 08:31:16 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-07-03 08:31:16 +02:00
|
|
|
SimdFp.Rev16_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("REV32 <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Rev32_V_8B_4H([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H_")] [Random(RndCnt)] ulong A,
|
2018-07-03 08:31:16 +02:00
|
|
|
[Values(0b00u, 0b01u)] uint size) // <8B, 4H>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E200800; // REV32 V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-07-03 08:31:16 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-07-03 08:31:16 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Rev32_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-07-03 08:31:16 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("REV32 <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Rev32_V_16B_8H([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H_")] [Random(RndCnt)] ulong A,
|
2018-07-03 08:31:16 +02:00
|
|
|
[Values(0b00u, 0b01u)] uint size) // <16B, 8H>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E200800; // REV32 V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-07-03 08:31:16 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-07-03 08:31:16 +02:00
|
|
|
SimdFp.Rev32_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("REV64 <Vd>.<T>, <Vn>.<T>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Rev64_V_8B_4H_2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-07-03 08:31:16 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8B, 4H, 2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E200800; // REV64 V0.8B, V0.8B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-07-03 08:31:16 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-07-03 08:31:16 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Rev64_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-07-03 08:31:16 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("REV64 <Vd>.<T>, <Vn>.<T>")]
|
|
|
|
public void Rev64_V_16B_8H_4S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_8B4H2S_")] [Random(RndCnt)] ulong A,
|
2018-07-03 08:31:16 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <16B, 8H, 4S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E200800; // REV64 V0.16B, V0.16B
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-07-03 08:31:16 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
2018-07-03 08:31:16 +02:00
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-07-03 08:31:16 +02:00
|
|
|
SimdFp.Rev64_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-04-30 01:39:58 +02:00
|
|
|
[Test, Description("SQXTN <Vb><d>, <Va><n>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Sqxtn_S_HB_SH_DS([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1H1S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1H1S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-30 01:39:58 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <HB, SH, DS>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x5E214800; // SQXTN B0, H0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-30 01:39:58 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
2018-04-30 01:39:58 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-04-30 01:39:58 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Sqxtn_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-06-18 19:55:26 +02:00
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
2018-04-30 01:39:58 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("SQXTN{2} <Vd>.<Tb>, <Vn>.<Ta>")]
|
|
|
|
public void Sqxtn_V_8H8B_4S4H_2D2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-30 01:39:58 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x0E214800; // SQXTN V0.8B, V0.8H
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-30 01:39:58 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-04-30 01:39:58 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-30 01:39:58 +02:00
|
|
|
SimdFp.Sqxtn_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-06-18 19:55:26 +02:00
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
2018-04-30 01:39:58 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("SQXTN{2} <Vd>.<Tb>, <Vn>.<Ta>")]
|
|
|
|
public void Sqxtn_V_8H16B_4S8H_2D4S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-30 01:39:58 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x4E214800; // SQXTN2 V0.16B, V0.8H
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-30 01:39:58 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-04-30 01:39:58 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-30 01:39:58 +02:00
|
|
|
SimdFp.Sqxtn_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
2018-06-26 04:36:20 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
2018-06-26 04:36:20 +02:00
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
|
|
|
});
|
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("SQXTUN <Vb><d>, <Va><n>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Sqxtun_S_HB_SH_DS([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1H1S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1H1S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-26 04:36:20 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <HB, SH, DS>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x7E212800; // SQXTUN B0, H0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-26 04:36:20 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-06-26 04:36:20 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-06-26 04:36:20 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Sqxtun_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-26 04:36:20 +02:00
|
|
|
});
|
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("SQXTUN{2} <Vd>.<Tb>, <Vn>.<Ta>")]
|
|
|
|
public void Sqxtun_V_8H8B_4S4H_2D2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-26 04:36:20 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E212800; // SQXTUN V0.8B, V0.8H
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-26 04:36:20 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-06-26 04:36:20 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-26 04:36:20 +02:00
|
|
|
SimdFp.Sqxtun_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-06-26 04:36:20 +02:00
|
|
|
});
|
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("SQXTUN{2} <Vd>.<Tb>, <Vn>.<Ta>")]
|
|
|
|
public void Sqxtun_V_8H16B_4S8H_2D4S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-06-26 04:36:20 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E212800; // SQXTUN2 V0.16B, V0.8H
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-06-26 04:36:20 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-06-26 04:36:20 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-06-26 04:36:20 +02:00
|
|
|
SimdFp.Sqxtun_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
2018-04-30 01:39:58 +02:00
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
2018-05-12 01:10:27 +02:00
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-06-18 19:55:26 +02:00
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
2018-04-30 01:39:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test, Description("UQXTN <Vb><d>, <Va><n>")]
|
2018-07-15 05:53:26 +02:00
|
|
|
public void Uqxtn_S_HB_SH_DS([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_1H1S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_1H1S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-30 01:39:58 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <HB, SH, DS>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x7E214800; // UQXTN B0, H0
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-30 01:39:58 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
2018-05-12 01:10:27 +02:00
|
|
|
Vector128<float> V1 = MakeVectorE0(A);
|
2018-04-30 01:39:58 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
2018-04-30 01:39:58 +02:00
|
|
|
AArch64.V(1, new Bits(A));
|
|
|
|
SimdFp.Uqxtn_S(Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-06-18 19:55:26 +02:00
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
2018-04-30 01:39:58 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("UQXTN{2} <Vd>.<Tb>, <Vn>.<Ta>")]
|
|
|
|
public void Uqxtn_V_8H8B_4S4H_2D2S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-30 01:39:58 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8H8B, 4S4H, 2D2S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x2E214800; // UQXTN V0.8B, V0.8H
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-30 01:39:58 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-04-30 01:39:58 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-30 01:39:58 +02:00
|
|
|
SimdFp.Uqxtn_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-06-18 19:55:26 +02:00
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
2018-04-30 01:39:58 +02:00
|
|
|
}
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
[Test, Description("UQXTN{2} <Vd>.<Tb>, <Vn>.<Ta>")]
|
|
|
|
public void Uqxtn_V_8H16B_4S8H_2D4S([Values(0u)] uint Rd,
|
|
|
|
[Values(1u, 0u)] uint Rn,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong Z,
|
|
|
|
[ValueSource("_4H2S1D_")] [Random(RndCnt)] ulong A,
|
2018-04-30 01:39:58 +02:00
|
|
|
[Values(0b00u, 0b01u, 0b10u)] uint size) // <8H16B, 4S8H, 2D4S>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
uint Opcode = 0x6E214800; // UQXTN2 V0.16B, V0.8H
|
|
|
|
Opcode |= ((Rn & 31) << 5) | ((Rd & 31) << 0);
|
2018-04-30 01:39:58 +02:00
|
|
|
Opcode |= ((size & 3) << 22);
|
|
|
|
Bits Op = new Bits(Opcode);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
Vector128<float> V0 = MakeVectorE0E1(Z, Z);
|
|
|
|
Vector128<float> V1 = MakeVectorE0E1(A, A);
|
2018-04-30 01:39:58 +02:00
|
|
|
AThreadState ThreadState = SingleOpcode(Opcode, V0: V0, V1: V1);
|
|
|
|
|
2018-07-15 05:53:26 +02:00
|
|
|
AArch64.Vpart(0, 0, new Bits(Z)); AArch64.Vpart(0, 1, new Bits(Z));
|
|
|
|
AArch64.Vpart(1, 0, new Bits(A)); AArch64.Vpart(1, 1, new Bits(A));
|
2018-04-30 01:39:58 +02:00
|
|
|
SimdFp.Uqxtn_V(Op[30], Op[23, 22], Op[9, 5], Op[4, 0]);
|
|
|
|
|
|
|
|
Assert.Multiple(() =>
|
|
|
|
{
|
2018-07-15 05:53:26 +02:00
|
|
|
Assert.That(GetVectorE0(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 0).ToUInt64()));
|
2018-05-12 01:10:27 +02:00
|
|
|
Assert.That(GetVectorE1(ThreadState.V0), Is.EqualTo(AArch64.Vpart(64, 0, 1).ToUInt64()));
|
2018-04-30 01:39:58 +02:00
|
|
|
});
|
2018-06-18 19:55:26 +02:00
|
|
|
Assert.That(((ThreadState.Fpsr >> 27) & 1) != 0, Is.EqualTo(Shared.FPSR[27]));
|
2018-04-30 01:39:58 +02:00
|
|
|
}
|
2018-04-20 17:40:15 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|