OpCode32SimdDupGP.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdDupGP : OpCode32, IOpCode32Simd
  4. {
  5. public int Size { get; }
  6. public int Vd { get; }
  7. public int Rt { get; }
  8. public bool Q { get; }
  9. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdDupGP(inst, address, opCode);
  10. public OpCode32SimdDupGP(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  11. {
  12. Size = 2 - (((opCode >> 21) & 0x2) | ((opCode >> 5) & 0x1)); // B:E - 0 for 32, 16 then 8.
  13. if (Size == -1)
  14. {
  15. Instruction = InstDescriptor.Undefined;
  16. return;
  17. }
  18. Q = ((opCode >> 21) & 0x1) != 0;
  19. RegisterSize = Q ? RegisterSize.Simd128 : RegisterSize.Simd64;
  20. Vd = ((opCode >> 3) & 0x10) | ((opCode >> 16) & 0xf);
  21. Rt = ((opCode >> 12) & 0xf);
  22. if (DecoderHelper.VectorArgumentsInvalid(Q, Vd))
  23. {
  24. Instruction = InstDescriptor.Undefined;
  25. }
  26. }
  27. }
  28. }