OpCode32SimdReg.cs 918 B

123456789101112131415161718192021222324
  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);
  10. public OpCode32SimdReg(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  11. {
  12. Vn = ((opCode >> 3) & 0x10) | ((opCode >> 16) & 0xf);
  13. // Subclasses have their own handling of Vx to account for before checking.
  14. if (GetType() == typeof(OpCode32SimdReg) && DecoderHelper.VectorArgumentsInvalid(Q, Vd, Vm, Vn))
  15. {
  16. Instruction = InstDescriptor.Undefined;
  17. }
  18. }
  19. }
  20. }