OpCode32SimdS.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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; } // opc2 or RM (opc2<1:0>) [Vcvt, Vrint].
  9. public int Size { get; protected set; }
  10. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdS(inst, address, opCode);
  11. public OpCode32SimdS(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  12. {
  13. Opc = (opCode >> 15) & 0x3;
  14. Opc2 = (opCode >> 16) & 0x7;
  15. Size = (opCode >> 8) & 0x3;
  16. bool single = Size != 3;
  17. RegisterSize = single ? RegisterSize.Int32 : RegisterSize.Int64;
  18. if (single)
  19. {
  20. Vm = ((opCode >> 5) & 0x1) | ((opCode << 1) & 0x1e);
  21. Vd = ((opCode >> 22) & 0x1) | ((opCode >> 11) & 0x1e);
  22. }
  23. else
  24. {
  25. Vm = ((opCode >> 1) & 0x10) | ((opCode >> 0) & 0xf);
  26. Vd = ((opCode >> 18) & 0x10) | ((opCode >> 12) & 0xf);
  27. }
  28. }
  29. }
  30. }