aboutsummaryrefslogtreecommitdiff
path: root/src/ARMeilleure/Decoders/OpCodeCcmp.cs
blob: d403534864212ea4b0c59a16efb18ec90489c62b (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
30
31
32
using ARMeilleure.State;

namespace ARMeilleure.Decoders
{
    class OpCodeCcmp : OpCodeAlu, IOpCodeCond
    {
        public int Nzcv { get; }
        protected int RmImm;

        public Condition Cond { get; }

        public new static OpCode Create(InstDescriptor inst, ulong address, int opCode) => new OpCodeCcmp(inst, address, opCode);

        public OpCodeCcmp(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
        {
            int o3 = (opCode >> 4) & 1;

            if (o3 != 0)
            {
                Instruction = InstDescriptor.Undefined;

                return;
            }

            Nzcv = (opCode >> 0) & 0xf;
            Cond = (Condition)((opCode >> 12) & 0xf);
            RmImm = (opCode >> 16) & 0x1f;

            Rd = RegisterAlias.Zr;
        }
    }
}