OpCode32Simd.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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, false);
  10. public static OpCode CreateT32(InstDescriptor inst, ulong address, int opCode) => new OpCode32Simd(inst, address, opCode, true);
  11. public OpCode32Simd(InstDescriptor inst, ulong address, int opCode, bool isThumb) : base(inst, address, opCode, isThumb)
  12. {
  13. Size = (opCode >> 20) & 0x3;
  14. Q = ((opCode >> 6) & 0x1) != 0;
  15. F = ((opCode >> 10) & 0x1) != 0;
  16. U = ((opCode >> (isThumb ? 28 : 24)) & 0x1) != 0;
  17. Opc = (opCode >> 7) & 0x3;
  18. RegisterSize = Q ? RegisterSize.Simd128 : RegisterSize.Simd64;
  19. Vd = ((opCode >> 18) & 0x10) | ((opCode >> 12) & 0xf);
  20. Vm = ((opCode >> 1) & 0x10) | ((opCode >> 0) & 0xf);
  21. // Subclasses have their own handling of Vx to account for before checking.
  22. if (GetType() == typeof(OpCode32Simd) && DecoderHelper.VectorArgumentsInvalid(Q, Vd, Vm))
  23. {
  24. Instruction = InstDescriptor.Undefined;
  25. }
  26. }
  27. }
  28. }