2018-10-30 21:43:02 -04:00
|
|
|
using ChocolArm64.Instructions;
|
2018-02-04 18:08:20 -05:00
|
|
|
using ChocolArm64.State;
|
|
|
|
|
2018-10-30 21:43:02 -04:00
|
|
|
namespace ChocolArm64.Decoders
|
2018-02-04 18:08:20 -05:00
|
|
|
{
|
2018-10-30 21:43:02 -04:00
|
|
|
class OpCodeSimdMemMs64 : OpCodeMemReg64, IOpCodeSimd64
|
2018-02-04 18:08:20 -05:00
|
|
|
{
|
|
|
|
public int Reps { get; private set; }
|
|
|
|
public int SElems { get; private set; }
|
|
|
|
public int Elems { get; private set; }
|
|
|
|
public bool WBack { get; private set; }
|
|
|
|
|
2018-10-30 21:43:02 -04:00
|
|
|
public OpCodeSimdMemMs64(Inst inst, long position, int opCode) : base(inst, position, opCode)
|
2018-02-04 18:08:20 -05:00
|
|
|
{
|
2018-10-30 21:43:02 -04:00
|
|
|
switch ((opCode >> 12) & 0xf)
|
2018-02-04 18:08:20 -05:00
|
|
|
{
|
|
|
|
case 0b0000: Reps = 1; SElems = 4; break;
|
|
|
|
case 0b0010: Reps = 4; SElems = 1; break;
|
|
|
|
case 0b0100: Reps = 1; SElems = 3; break;
|
|
|
|
case 0b0110: Reps = 3; SElems = 1; break;
|
|
|
|
case 0b0111: Reps = 1; SElems = 1; break;
|
|
|
|
case 0b1000: Reps = 1; SElems = 2; break;
|
|
|
|
case 0b1010: Reps = 2; SElems = 1; break;
|
|
|
|
|
2018-10-30 21:43:02 -04:00
|
|
|
default: inst = Inst.Undefined; return;
|
2018-02-04 18:08:20 -05:00
|
|
|
}
|
|
|
|
|
2018-10-30 21:43:02 -04:00
|
|
|
Size = (opCode >> 10) & 3;
|
|
|
|
WBack = ((opCode >> 23) & 1) != 0;
|
2018-02-04 18:08:20 -05:00
|
|
|
|
2018-10-30 21:43:02 -04:00
|
|
|
bool q = ((opCode >> 30) & 1) != 0;
|
2018-02-04 18:08:20 -05:00
|
|
|
|
2018-10-30 21:43:02 -04:00
|
|
|
if (!q && Size == 3 && SElems != 1)
|
2018-02-04 18:08:20 -05:00
|
|
|
{
|
2018-10-30 21:43:02 -04:00
|
|
|
inst = Inst.Undefined;
|
2018-02-04 18:08:20 -05:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-02-17 16:06:11 -05:00
|
|
|
Extend64 = false;
|
|
|
|
|
2018-10-30 21:43:02 -04:00
|
|
|
RegisterSize = q
|
|
|
|
? State.RegisterSize.Simd128
|
|
|
|
: State.RegisterSize.Simd64;
|
2018-02-04 18:08:20 -05:00
|
|
|
|
|
|
|
Elems = (GetBitsCount() >> 3) >> Size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|