OpCode32SimdShImmLong.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdShImmLong : OpCode32Simd
  4. {
  5. public int Shift { get; private set; }
  6. public OpCode32SimdShImmLong(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  7. {
  8. Q = false;
  9. RegisterSize = RegisterSize.Simd64;
  10. int imm6 = (opCode >> 16) & 0x3f;
  11. if ((imm6 & 0x20) == 0b100000)
  12. {
  13. Size = 2;
  14. Shift = imm6 - 32;
  15. }
  16. else if ((imm6 & 0x30) == 0b010000)
  17. {
  18. Size = 1;
  19. Shift = imm6 - 16;
  20. }
  21. else if ((imm6 & 0x38) == 0b001000)
  22. {
  23. Size = 0;
  24. Shift = imm6 - 8;
  25. }
  26. else
  27. {
  28. Instruction = InstDescriptor.Undefined;
  29. }
  30. if (GetType() == typeof(OpCode32SimdShImmLong) && DecoderHelper.VectorArgumentsInvalid(true, Vd))
  31. {
  32. Instruction = InstDescriptor.Undefined;
  33. }
  34. }
  35. }
  36. }