aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Decoder/AOpCodeSimdIns.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ChocolArm64/Decoder/AOpCodeSimdIns.cs')
-rw-r--r--ChocolArm64/Decoder/AOpCodeSimdIns.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/ChocolArm64/Decoder/AOpCodeSimdIns.cs b/ChocolArm64/Decoder/AOpCodeSimdIns.cs
new file mode 100644
index 00000000..0b60bbe8
--- /dev/null
+++ b/ChocolArm64/Decoder/AOpCodeSimdIns.cs
@@ -0,0 +1,36 @@
+using ChocolArm64.Instruction;
+
+namespace ChocolArm64.Decoder
+{
+ class AOpCodeSimdIns : AOpCodeSimd
+ {
+ public int SrcIndex { get; private set; }
+ public int DstIndex { get; private set; }
+
+ public AOpCodeSimdIns(AInst Inst, long Position, int OpCode) : base(Inst, Position, OpCode)
+ {
+ int Imm4 = (OpCode >> 11) & 0xf;
+ int Imm5 = (OpCode >> 16) & 0x1f;
+
+ if (Imm5 == 0b10000)
+ {
+ Emitter = AInstEmit.Und;
+
+ return;
+ }
+
+ Size = Imm5 & -Imm5;
+
+ switch (Size)
+ {
+ case 1: Size = 0; break;
+ case 2: Size = 1; break;
+ case 4: Size = 2; break;
+ case 8: Size = 3; break;
+ }
+
+ SrcIndex = Imm4 >> Size;
+ DstIndex = Imm5 >> (Size + 1);
+ }
+ }
+} \ No newline at end of file