OpCode32SimdReg.cs 1.1 KB

12345678910111213141516171819202122232425
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdReg : OpCode32Simd
  4. {
  5. public int Vn { get; }
  6. public int Qn => GetQuadwordIndex(Vn);
  7. public int In => GetQuadwordSubindex(Vn) << (3 - Size);
  8. public int Fn => GetQuadwordSubindex(Vn) << (1 - (Size & 1));
  9. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdReg(inst, address, opCode, false);
  10. public new static OpCode CreateT32(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdReg(inst, address, opCode, true);
  11. public OpCode32SimdReg(InstDescriptor inst, ulong address, int opCode, bool isThumb) : base(inst, address, opCode, isThumb)
  12. {
  13. Vn = ((opCode >> 3) & 0x10) | ((opCode >> 16) & 0xf);
  14. // Subclasses have their own handling of Vx to account for before checking.
  15. if (GetType() == typeof(OpCode32SimdReg) && DecoderHelper.VectorArgumentsInvalid(Q, Vd, Vm, Vn))
  16. {
  17. Instruction = InstDescriptor.Undefined;
  18. }
  19. }
  20. }
  21. }