aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Shader/Decoders/OpCodeAlu.cs
blob: 15fbb9af794f4d66748aacd6dbe7ba99775902f5 (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
33
34
using Ryujinx.Graphics.Shader.Instructions;

namespace Ryujinx.Graphics.Shader.Decoders
{
    class OpCodeAlu : OpCode, IOpCodeAlu, IOpCodeRc
    {
        public Register Rd          { get; }
        public Register Ra          { get; }
        public Register Rc          { get; }
        public Register Predicate39 { get; }

        public int ByteSelection { get; }

        public bool InvertP     { get; }
        public bool Extended    { get; protected set; }
        public bool SetCondCode { get; protected set; }
        public bool Saturate    { get; protected set; }

        public OpCodeAlu(InstEmitter emitter, ulong address, long opCode) : base(emitter, address, opCode)
        {
            Rd          = new Register(opCode.Extract(0,  8), RegisterType.Gpr);
            Ra          = new Register(opCode.Extract(8,  8), RegisterType.Gpr);
            Rc          = new Register(opCode.Extract(39, 8), RegisterType.Gpr);
            Predicate39 = new Register(opCode.Extract(39, 3), RegisterType.Predicate);

            ByteSelection = opCode.Extract(41, 2);

            InvertP     = opCode.Extract(42);
            Extended    = opCode.Extract(43);
            SetCondCode = opCode.Extract(47);
            Saturate    = opCode.Extract(50);
        }
    }
}