RegClass.hs 750 Bytes
Newer Older
1
-- | An architecture independent description of a register's class.
2
module RegClass
3 4 5
        ( RegClass (..) )

where
6

7 8
import GhcPrelude

9 10
import  Outputable
import  Unique
11

12

13 14
-- | The class of a register.
--      Used in the register allocator.
15
--      We treat all registers in a class as being interchangeable.
16
--
17 18 19 20
data RegClass
        = RcInteger
        | RcFloat
        | RcDouble
21
        deriving Eq
22 23 24


instance Uniquable RegClass where
25 26 27
    getUnique RcInteger = mkRegClassUnique 0
    getUnique RcFloat   = mkRegClassUnique 1
    getUnique RcDouble  = mkRegClassUnique 2
28 29

instance Outputable RegClass where
30 31 32
    ppr RcInteger       = Outputable.text "I"
    ppr RcFloat         = Outputable.text "F"
    ppr RcDouble        = Outputable.text "D"