OpCode32SimdLong.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdLong : OpCode32SimdBase
  4. {
  5. public bool U { get; }
  6. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdLong(inst, address, opCode, false);
  7. public static OpCode CreateT32(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdLong(inst, address, opCode, true);
  8. public OpCode32SimdLong(InstDescriptor inst, ulong address, int opCode, bool isThumb) : base(inst, address, opCode, isThumb)
  9. {
  10. int imm3h = (opCode >> 19) & 0x7;
  11. // The value must be a power of 2, otherwise it is the encoding of another instruction.
  12. switch (imm3h)
  13. {
  14. case 1: Size = 0; break;
  15. case 2: Size = 1; break;
  16. case 4: Size = 2; break;
  17. }
  18. U = ((opCode >> (isThumb ? 28 : 24)) & 0x1) != 0;
  19. RegisterSize = RegisterSize.Simd64;
  20. Vd = ((opCode >> 18) & 0x10) | ((opCode >> 12) & 0xf);
  21. Vm = ((opCode >> 1) & 0x10) | ((opCode >> 0) & 0xf);
  22. }
  23. }
  24. }