aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Decoders/OpCodeAluRs64.cs
blob: bed840b8ea7273f44f7209ba169e984ecd6e3951 (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
29
using ChocolArm64.Instructions;

namespace ChocolArm64.Decoders
{
    class OpCodeAluRs64 : OpCodeAlu64, IOpCodeAluRs64
    {
        public int Shift { get; private set; }
        public int Rm    { get; private set; }

        public ShiftType ShiftType { get; private set; }

        public OpCodeAluRs64(Inst inst, long position, int opCode) : base(inst, position, opCode)
        {
            int shift = (opCode >> 10) & 0x3f;

            if (shift >= GetBitsCount())
            {
                Emitter = InstEmit.Und;

                return;
            }

            Shift = shift;

            Rm        =             (opCode >> 16) & 0x1f;
            ShiftType = (ShiftType)((opCode >> 22) & 0x3);
        }
    }
}