OpCode32Simd.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32Simd : OpCode32SimdBase
  4. {
  5. public int Opc { get; protected set; }
  6. public bool Q { get; protected set; }
  7. public bool F { get; protected set; }
  8. public bool U { get; }
  9. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32Simd(inst, address, opCode);
  10. public OpCode32Simd(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  11. {
  12. Size = (opCode >> 20) & 0x3;
  13. Q = ((opCode >> 6) & 0x1) != 0;
  14. F = ((opCode >> 10) & 0x1) != 0;
  15. U = ((opCode >> 24) & 0x1) != 0;
  16. Opc = (opCode >> 7) & 0x3;
  17. RegisterSize = Q ? RegisterSize.Simd128 : RegisterSize.Simd64;
  18. Vd = ((opCode >> 18) & 0x10) | ((opCode >> 12) & 0xf);
  19. Vm = ((opCode >> 1) & 0x10) | ((opCode >> 0) & 0xf);
  20. // Subclasses have their own handling of Vx to account for before checking.
  21. if (GetType() == typeof(OpCode32Simd) && DecoderHelper.VectorArgumentsInvalid(Q, Vd, Vm))
  22. {
  23. Instruction = InstDescriptor.Undefined;
  24. }
  25. }
  26. }
  27. }