RegClass.hs 816 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

-- | An architecture independent description of a register's class.
module RegClass 
	( RegClass (..) )

where

import	Outputable
import	Unique


-- | The class of a register. 
--	Used in the register allocator.
--	We treat all registers in a class as being interchangable.
--
data RegClass 
	= RcInteger 
	| RcFloat
	| RcDouble
20
	| RcDoubleSSE -- x86 only: the SSE regs are a separate class
21
22
23
24
	deriving Eq


instance Uniquable RegClass where
25
26
27
    getUnique RcInteger	= mkRegClassUnique 0
    getUnique RcFloat	= mkRegClassUnique 1
    getUnique RcDouble	= mkRegClassUnique 2
28
    getUnique RcDoubleSSE = mkRegClassUnique 3
29
30
31
32
33

instance Outputable RegClass where
    ppr RcInteger	= Outputable.text "I"
    ppr RcFloat		= Outputable.text "F"
    ppr RcDouble	= Outputable.text "D"
34
    ppr RcDoubleSSE	= Outputable.text "S"