Remove dead generics-related code from OccName
[ghc.git] / compiler / nativeGen / RegClass.hs
1 -- | An architecture independent description of a register's class.
2 module RegClass
3 ( RegClass (..) )
4
5 where
6
7 import Outputable
8 import Unique
9
10
11 -- | The class of a register.
12 -- Used in the register allocator.
13 -- We treat all registers in a class as being interchangable.
14 --
15 data RegClass
16 = RcInteger
17 | RcFloat
18 | RcDouble
19 | RcDoubleSSE -- x86 only: the SSE regs are a separate class
20 deriving Eq
21
22
23 instance Uniquable RegClass where
24 getUnique RcInteger = mkRegClassUnique 0
25 getUnique RcFloat = mkRegClassUnique 1
26 getUnique RcDouble = mkRegClassUnique 2
27 getUnique RcDoubleSSE = mkRegClassUnique 3
28
29 instance Outputable RegClass where
30 ppr RcInteger = Outputable.text "I"
31 ppr RcFloat = Outputable.text "F"
32 ppr RcDouble = Outputable.text "D"
33 ppr RcDoubleSSE = Outputable.text "S"