CpuTestSimdFmov.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #define SimdFmov
  2. using ARMeilleure.State;
  3. using NUnit.Framework;
  4. namespace Ryujinx.Tests.Cpu
  5. {
  6. [Category("SimdFmov")]
  7. public sealed class CpuTestSimdFmov : CpuTest
  8. {
  9. #if SimdFmov
  10. #region "ValueSource"
  11. private static uint[] _F_Mov_Si_S_()
  12. {
  13. return new uint[]
  14. {
  15. 0x1E201000u // FMOV S0, #2.0
  16. };
  17. }
  18. private static uint[] _F_Mov_Si_D_()
  19. {
  20. return new uint[]
  21. {
  22. 0x1E601000u // FMOV D0, #2.0
  23. };
  24. }
  25. #endregion
  26. [Test, Pairwise] [Explicit]
  27. public void F_Mov_Si_S([ValueSource("_F_Mov_Si_S_")] uint opcodes,
  28. [Range(0u, 255u, 1u)] uint imm8)
  29. {
  30. opcodes |= ((imm8 & 0xFFu) << 13);
  31. ulong z = TestContext.CurrentContext.Random.NextULong();
  32. V128 v0 = MakeVectorE0E1(z, z);
  33. SingleOpcode(opcodes, v0: v0);
  34. CompareAgainstUnicorn();
  35. }
  36. [Test, Pairwise] [Explicit]
  37. public void F_Mov_Si_D([ValueSource("_F_Mov_Si_D_")] uint opcodes,
  38. [Range(0u, 255u, 1u)] uint imm8)
  39. {
  40. opcodes |= ((imm8 & 0xFFu) << 13);
  41. ulong z = TestContext.CurrentContext.Random.NextULong();
  42. V128 v0 = MakeVectorE1(z);
  43. SingleOpcode(opcodes, v0: v0);
  44. CompareAgainstUnicorn();
  45. }
  46. #endif
  47. }
  48. }