SCM Repository
Annotation of /sml/trunk/src/compiler/CodeGen/sparc/sparcMask.sml
Parent Directory
|
Revision Log
Revision 134 - (view) (download)
1 : | monnier | 134 | (* sparcMask.sml |
2 : | * | ||
3 : | * COPYRIGHT (c) 1998 AT&T Bell Laboratories. | ||
4 : | *) | ||
5 : | |||
6 : | structure SparcMask : REGMASK = struct | ||
7 : | |||
8 : | fun error msg = ErrorMsg.impossible ("SparcMask." ^ msg) | ||
9 : | |||
10 : | val sentinel = Word.fromInt ~1 | ||
11 : | val regMap = Array.array(32, sentinel) | ||
12 : | val _ = app (fn (i,j) => Array.update(regMap,i,j)) | ||
13 : | [( 1, 0w0), (* stdlink *) | ||
14 : | (26, 0w1), (* stdclos *) | ||
15 : | (24, 0w2), (* stdarg *) | ||
16 : | (25, 0w3), (* stdcont *) | ||
17 : | ( 2, 0w4), (* misc0 *) | ||
18 : | ( 3, 0w5), (* misc1 *) | ||
19 : | ( 8, 0w6), (* ... *) | ||
20 : | ( 9, 0w7), | ||
21 : | (16, 0w8), | ||
22 : | (17, 0w9), | ||
23 : | (18, 0w10), | ||
24 : | (19, 0w11), | ||
25 : | (20, 0w12), | ||
26 : | (21, 0w13), | ||
27 : | (22, 0w14), | ||
28 : | (23, 0w15), | ||
29 : | (28, 0w16), | ||
30 : | (11, 0w17), | ||
31 : | (12, 0w18) | ||
32 : | ] | ||
33 : | |||
34 : | handle _ => error "setting regMap" | ||
35 : | |||
36 : | |||
37 : | fun regMask(reg, mask) = let | ||
38 : | val bit = Array.sub(regMap, reg) | ||
39 : | in | ||
40 : | if bit= sentinel then error ("regMask - " ^ Int.toString reg) | ||
41 : | else Word.orb(mask,Word.<<(0w1,bit)) | ||
42 : | end | ||
43 : | |||
44 : | fun memMask _ = error "memMask" | ||
45 : | end | ||
46 : | |||
47 : | |||
48 : | (* | ||
49 : | * $Log$ | ||
50 : | *) |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |