OpCode32SimdDupElem.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace ARMeilleure.Decoders
  2. {
  3. class OpCode32SimdDupElem : OpCode32Simd
  4. {
  5. public int Index { get; private set; }
  6. public OpCode32SimdDupElem(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
  7. {
  8. var opc = (opCode >> 16) & 0xf;
  9. if ((opc & 0b1) == 1)
  10. {
  11. Size = 0;
  12. Index = (opc >> 1) & 0x7;
  13. }
  14. else if ((opc & 0b11) == 0b10)
  15. {
  16. Size = 1;
  17. Index = (opc >> 2) & 0x3;
  18. }
  19. else if ((opc & 0b111) == 0b100)
  20. {
  21. Size = 2;
  22. Index = (opc >> 3) & 0x1;
  23. }
  24. else
  25. {
  26. Instruction = InstDescriptor.Undefined;
  27. }
  28. Vd = ((opCode >> 18) & 0x10) | ((opCode >> 12) & 0xf);
  29. Vm = ((opCode >> 1) & 0x10) | ((opCode >> 0) & 0xf);
  30. if (DecoderHelper.VectorArgumentsInvalid(Q, Vd))
  31. {
  32. Instruction = InstDescriptor.Undefined;
  33. }
  34. }
  35. }
  36. }