aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Shader/Decoders/OpCode.cs
blob: b0f2ffdc3270b1dde7e8c8d2497f222ea741e6b2 (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
using Ryujinx.Graphics.Shader.Instructions;

namespace Ryujinx.Graphics.Shader.Decoders
{
    class OpCode
    {
        public InstEmitter Emitter { get; }

        public ulong Address   { get; }
        public long  RawOpCode { get; }

        public Register Predicate { get; protected set; }

        public bool InvertPredicate { get; protected set; }

        //When inverted, the always true predicate == always false.
        public bool NeverExecute => Predicate.Index == RegisterConsts.PredicateTrueIndex && InvertPredicate;

        public OpCode(InstEmitter emitter, ulong address, long opCode)
        {
            Emitter   = emitter;
            Address   = address;
            RawOpCode = opCode;

            Predicate = new Register(opCode.Extract(16, 3), RegisterType.Predicate);

            InvertPredicate = opCode.Extract(19);
        }
    }
}