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

using static Ryujinx.Graphics.Shader.Instructions.InstEmitHelper;

namespace Ryujinx.Graphics.Shader.Instructions
{
    static partial class InstEmit
    {
        public static void Mov(EmitterContext context)
        {
            OpCodeAlu op = (OpCodeAlu)context.CurrOp;

            context.Copy(GetDest(context), GetSrcB(context));
        }

        public static void Sel(EmitterContext context)
        {
            OpCodeAlu op = (OpCodeAlu)context.CurrOp;

            Operand pred = GetPredicate39(context);

            Operand srcA = GetSrcA(context);
            Operand srcB = GetSrcB(context);

            Operand res = context.ConditionalSelect(pred, srcA, srcB);

            context.Copy(GetDest(context), res);
        }
    }
}