never executed always true always false
1 -- | An architecture independent description of a register's class.
2 module GHC.Platform.Reg.Class
3 ( RegClass (..) )
4
5 where
6
7 import GHC.Prelude
8
9 import GHC.Utils.Outputable as Outputable
10 import GHC.Types.Unique
11 import GHC.Builtin.Uniques
12
13
14 -- | The class of a register.
15 -- Used in the register allocator.
16 -- We treat all registers in a class as being interchangeable.
17 --
18 data RegClass
19 = RcInteger
20 | RcFloat
21 | RcDouble
22 deriving Eq
23
24
25 instance Uniquable RegClass where
26 getUnique RcInteger = mkRegClassUnique 0
27 getUnique RcFloat = mkRegClassUnique 1
28 getUnique RcDouble = mkRegClassUnique 2
29
30 instance Outputable RegClass where
31 ppr RcInteger = Outputable.text "I"
32 ppr RcFloat = Outputable.text "F"
33 ppr RcDouble = Outputable.text "D"