aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/State/FPCR.cs
blob: 40d560455545795366ece3c352847c791d62918a (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
using System;

namespace ARMeilleure.State
{
    [Flags]
    public enum FPCR : uint
    {
        Ufe = 1u << 11,
        Fz  = 1u << 24,
        Dn  = 1u << 25,
        Ahp = 1u << 26,

        A32Mask = 0x07FF9F00u
    }

    public static class FPCRExtensions
    {
        private const int RModeShift = 22;

        public static FPRoundingMode GetRoundingMode(this FPCR fpcr)
        {
            return (FPRoundingMode)(((int)fpcr >> RModeShift) & 3);
        }
    }
}