aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Shader/Decoders/OpCodeFArithImm32.cs
blob: ec9da6f3023bbb31d44fd7be4d1eda67bb5d8088 (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;
using System;

namespace Ryujinx.Graphics.Shader.Decoders
{
    class OpCodeFArithImm32 : OpCodeAlu, IOpCodeFArith, IOpCodeImmF
    {
        public RoundingMode RoundingMode => RoundingMode.ToNearest;

        public FmulScale Scale => FmulScale.None;

        public bool FlushToZero { get; }
        public bool AbsoluteA   { get; }

        public float Immediate { get; }

        public OpCodeFArithImm32(InstEmitter emitter, ulong address, long opCode) : base(emitter, address, opCode)
        {
            int imm = opCode.Extract(20, 32);

            Immediate = BitConverter.Int32BitsToSingle(imm);

            SetCondCode = opCode.Extract(52);
            AbsoluteA   = opCode.Extract(54);
            FlushToZero = opCode.Extract(55);

            Saturate = false;
        }
    }
}