OpCode32SimdRegElem.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdRegElem : OpCode32SimdReg
  4. {
  5. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdRegElem(inst, address, opCode);
  6. public OpCode32SimdRegElem(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  7. {
  8. Q = ((opCode >> 24) & 0x1) != 0;
  9. F = ((opCode >> 8) & 0x1) != 0;
  10. Size = (opCode >> 20) & 0x3;
  11. RegisterSize = Q ? RegisterSize.Simd128 : RegisterSize.Simd64;
  12. if (Size == 1)
  13. {
  14. Vm = ((opCode >> 3) & 0x1) | ((opCode >> 4) & 0x2) | ((opCode << 2) & 0x1c);
  15. }
  16. else /* if (Size == 2) */
  17. {
  18. Vm = ((opCode >> 5) & 0x1) | ((opCode << 1) & 0x1e);
  19. }
  20. if (GetType() == typeof(OpCode32SimdRegElem) && DecoderHelper.VectorArgumentsInvalid(Q, Vd, Vn) || Size == 0 || (Size == 1 && F))
  21. {
  22. Instruction = InstDescriptor.Undefined;
  23. }
  24. }
  25. }
  26. }