Add Coercion.lhs
[ghc-hetmet.git] / includes / Liveness.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The University of Glasgow 2004
4  *
5  * Building liveness masks for RET_DYN stack frames.
6  * A few macros that are used in both .cmm and .c sources.
7  *
8  * A liveness mask is constructed like so:
9  *
10  *    R1_PTR & R2_PTR & R3_PTR
11  *
12  * -------------------------------------------------------------------------- */
13
14 #ifndef LIVENESS_H
15 #define LIVENESS_H
16
17 #define NO_PTRS   0xff
18 #define R1_PTR    (NO_PTRS ^ (1<<0))
19 #define R2_PTR    (NO_PTRS ^ (1<<1))
20 #define R3_PTR    (NO_PTRS ^ (1<<2))
21 #define R4_PTR    (NO_PTRS ^ (1<<3))
22 #define R5_PTR    (NO_PTRS ^ (1<<4))
23 #define R6_PTR    (NO_PTRS ^ (1<<5))
24 #define R7_PTR    (NO_PTRS ^ (1<<6))
25 #define R8_PTR    (NO_PTRS ^ (1<<7))
26
27 #define N_NONPTRS(n)  ((n)<<16)
28 #define N_PTRS(n)     ((n)<<24)
29
30 #define RET_DYN_NONPTRS(l) ((l)>>16 & 0xff)
31 #define RET_DYN_PTRS(l)    ((l)>>24 & 0xff)
32 #define RET_DYN_LIVENESS(l) ((l) & 0xffff)
33
34 #endif /* LIVENESS_H */