OpCode32SimdMemSingle.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using ARMeilleure.State;
  2. namespace ARMeilleure.Decoders
  3. {
  4. class OpCode32SimdMemSingle : OpCode32, IOpCode32Simd
  5. {
  6. public int Vd { get; private set; }
  7. public int Rn { get; private set; }
  8. public int Rm { get; private set; }
  9. public int IndexAlign { get; private set; }
  10. public int Index { get; private set; }
  11. public bool WBack { get; private set; }
  12. public bool RegisterIndex { get; private set; }
  13. public int Size { get; private set; }
  14. public bool Replicate { get; private set; }
  15. public int Increment { get; private set; }
  16. public OpCode32SimdMemSingle(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  17. {
  18. Vd = (opCode >> 12) & 0xf;
  19. Vd |= (opCode >> 18) & 0x10;
  20. IndexAlign = (opCode >> 4) & 0xf;
  21. Size = (opCode >> 10) & 0x3;
  22. Replicate = Size == 3;
  23. if (Replicate)
  24. {
  25. Size = (opCode >> 6) & 0x3;
  26. Increment = ((opCode >> 5) & 1) + 1;
  27. Index = 0;
  28. }
  29. else
  30. {
  31. Increment = (((IndexAlign >> Size) & 1) == 0) ? 1 : 2;
  32. Index = IndexAlign >> (1 + Size);
  33. }
  34. Rm = (opCode >> 0) & 0xf;
  35. Rn = (opCode >> 16) & 0xf;
  36. WBack = Rm != RegisterAlias.Aarch32Pc;
  37. RegisterIndex = Rm != RegisterAlias.Aarch32Pc && Rm != RegisterAlias.Aarch32Sp;
  38. }
  39. }
  40. }