OpCode32SimdImm44.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdImm44 : OpCode32, IOpCode32SimdImm
  4. {
  5. public int Vd { get; }
  6. public long Immediate { get; }
  7. public int Size { get; }
  8. public int Elems { get; }
  9. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCode32SimdImm44(inst, address, opCode);
  10. public OpCode32SimdImm44(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  11. {
  12. Size = (opCode >> 8) & 0x3;
  13. bool single = Size != 3;
  14. if (single)
  15. {
  16. Vd = ((opCode >> 22) & 0x1) | ((opCode >> 11) & 0x1e);
  17. }
  18. else
  19. {
  20. Vd = ((opCode >> 18) & 0x10) | ((opCode >> 12) & 0xf);
  21. }
  22. long imm;
  23. imm = ((uint)opCode >> 0) & 0xf;
  24. imm |= ((uint)opCode >> 12) & 0xf0;
  25. Immediate = (Size == 3) ? (long)DecoderHelper.Imm8ToFP64Table[(int)imm] : DecoderHelper.Imm8ToFP32Table[(int)imm];
  26. RegisterSize = (!single) ? RegisterSize.Int64 : RegisterSize.Int32;
  27. Elems = 1;
  28. }
  29. }
  30. }