OpCode32SimdS.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdS : OpCode32, IOpCode32Simd
  4. {
  5. public int Vd { get; protected set; }
  6. public int Vm { get; protected set; }
  7. public int Opc { get; protected set; } // "with_zero" (Opc<1>) [Vcmp, Vcmpe].
  8. public int Opc2 { get; private set; } // opc2 or RM (opc2<1:0>) [Vcvt, Vrint].
  9. public int Size { get; protected set; }
  10. public OpCode32SimdS(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  11. {
  12. Opc = (opCode >> 15) & 0x3;
  13. Opc2 = (opCode >> 16) & 0x7;
  14. Size = (opCode >> 8) & 0x3;
  15. bool single = Size != 3;
  16. RegisterSize = single ? RegisterSize.Int32 : RegisterSize.Int64;
  17. if (single)
  18. {
  19. Vm = ((opCode >> 5) & 0x1) | ((opCode << 1) & 0x1e);
  20. Vd = ((opCode >> 22) & 0x1) | ((opCode >> 11) & 0x1e);
  21. }
  22. else
  23. {
  24. Vm = ((opCode >> 1) & 0x10) | ((opCode >> 0) & 0xf);
  25. Vd = ((opCode >> 18) & 0x10) | ((opCode >> 12) & 0xf);
  26. }
  27. }
  28. }
  29. }