OpCodeSimdFmov.cs 923 B

1234567891011121314151617181920212223242526272829303132
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCodeSimdFmov : OpCode, IOpCodeSimd
  4. {
  5. public int Rd { get; }
  6. public long Immediate { get; }
  7. public int Size { get; }
  8. public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCodeSimdFmov(inst, address, opCode);
  9. public OpCodeSimdFmov(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  10. {
  11. int type = (opCode >> 22) & 0x3;
  12. Size = type;
  13. long imm;
  14. Rd = (opCode >> 0) & 0x1f;
  15. imm = (opCode >> 13) & 0xff;
  16. if (type == 0)
  17. {
  18. Immediate = (long)DecoderHelper.Imm8ToFP32Table[(int)imm];
  19. }
  20. else /* if (type == 1) */
  21. {
  22. Immediate = (long)DecoderHelper.Imm8ToFP64Table[(int)imm];
  23. }
  24. }
  25. }
  26. }