aboutsummaryrefslogtreecommitdiff
path: root/src/ARMeilleure/Decoders/OpCodeSimdMemImm.cs
blob: 14a9d7c9c237e5d246173130b205d13baa7dcb96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
namespace ARMeilleure.Decoders
{
    class OpCodeSimdMemImm : OpCodeMemImm, IOpCodeSimd
    {
        public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCodeSimdMemImm(inst, address, opCode);

        public OpCodeSimdMemImm(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
        {
            Size |= (opCode >> 21) & 4;

            if (Size > 4)
            {
                Instruction = InstDescriptor.Undefined;

                return;
            }

            // Base class already shifts the immediate, we only
            // need to shift it if size (scale) is 4, since this value is only set here.
            if (!WBack && !Unscaled && Size == 4)
            {
                Immediate <<= 4;
            }

            Extend64 = false;
        }
    }
}