aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Cpu/LightningJit/Arm64/ImmUtils.cs
blob: 8a12756b967e833ff5a3b487dfa95d372d736783 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
namespace Ryujinx.Cpu.LightningJit.Arm64
{
    static class ImmUtils
    {
        public static int ExtractSImm14Times4(uint encoding)
        {
            return ((int)(encoding >> 5) << 18) >> 16;
        }

        public static int ExtractSImm19Times4(uint encoding)
        {
            return ((int)(encoding >> 5) << 13) >> 11;
        }

        public static int ExtractSImm26Times4(uint encoding)
        {
            return (int)(encoding << 6) >> 4;
        }
    }
}