Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/mltree/mltree.sig
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/mltree/mltree.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1053 - (view) (download) (as text)

1 : monnier 245 (* mltree.sig
2 :     *
3 :     * COPYRIGHT (c) 1994 AT&T Bell Laboratories.
4 :     *
5 :     *)
6 : monnier 411
7 : monnier 245 signature MLTREE = sig
8 : leunga 744 structure Constant : CONSTANT
9 :     structure Region : REGION
10 : george 984 (* structure Stream : INSTRUCTION_STREAM *)
11 : leunga 744 structure Basis : MLTREE_BASIS
12 :     structure Extension : MLTREE_EXTENSION
13 : leunga 775 structure I : MACHINE_INT
14 : monnier 245
15 : monnier 475 type ty = Basis.ty
16 :     type fty = Basis.fty
17 : leunga 744 type var = CellsBasis.cell (* variable *)
18 : monnier 411 type src = var (* source variable *)
19 :     type dst = var (* destination variable *)
20 :     type reg = var (* physical register *)
21 : leunga 744 type an = Annotations.annotation
22 : monnier 245
23 : monnier 475 datatype cond = datatype Basis.cond
24 :     datatype fcond = datatype Basis.fcond
25 : george 545 datatype rounding_mode = datatype Basis.rounding_mode
26 : monnier 475 datatype ext = datatype Basis.ext
27 : monnier 429
28 : george 545 (* Statements/effects. These types are parameterized by the statement
29 :     * extension type. Unfortunately, this has to be made polymorphic to make
30 :     * it possible for recursive type definitions to work.
31 :     *)
32 : george 555 datatype stm =
33 : george 545 (* assignment *)
34 : leunga 744 MV of ty * dst * rexp
35 : george 555 | CCMV of dst * ccexp
36 :     | FMV of fty * dst * fexp
37 : george 545
38 :     (* parallel copies *)
39 : leunga 744 | COPY of ty * dst list * src list
40 : monnier 411 | FCOPY of fty * dst list * src list
41 : monnier 245
42 : george 545 (* control flow *)
43 : leunga 744 | JMP of rexp * controlflow
44 : george 984 (*
45 :     | SWITCH of
46 :     {tblLab: Label.label, (* label associated with table *)
47 :     base : rexp option, (* base pointer -- if any *)
48 :     table : fn Label.label -> rexp, (* get table address *)
49 :     index : rexp, (* index into table *)
50 :     targets : controlflow} (* targets of switch *)
51 :     *)
52 : leunga 744 | BCC of ccexp * Label.label
53 : leunga 591 | CALL of {funct:rexp, targets:controlflow,
54 :     defs:mlrisc list, uses:mlrisc list,
55 : blume 839 region: Region.region,
56 :     pops: Int32.int}
57 : leunga 796 | FLOW_TO of stm * controlflow
58 : leunga 744 | RET of controlflow
59 :     | IF of ccexp * stm * stm
60 : monnier 245
61 : george 545 (* memory update: ea, data *)
62 : george 555 | STORE of ty * rexp * rexp * Region.region
63 :     | FSTORE of fty * rexp * fexp * Region.region
64 : george 545
65 :     (* control dependence *)
66 : george 555 | REGION of stm * ctrl
67 : george 545
68 : george 555 | SEQ of stm list (* sequencing *)
69 : george 545 | DEFINE of Label.label (* define local label *)
70 :    
71 : george 555 | ANNOTATION of stm * an
72 :     | EXT of sext (* extension *)
73 : george 545
74 : george 1003 (* synthetic instructions to indicated that the regs are live or
75 :     * killed at this program point. The spilled list must always
76 :     * start out as the empty list.
77 :     *)
78 :     | LIVE of mlrisc list
79 :     | KILL of mlrisc list
80 :    
81 : george 545 (* RTL operators:
82 : leunga 744 * The following are used internally
83 :     * for describing instruction semantics.
84 : george 545 * The frontend must not use these.
85 : monnier 411 *)
86 : leunga 775 | PHI of {preds:int list,block:int}
87 : leunga 744 | ASSIGN of ty * rexp * rexp
88 : leunga 775 | SOURCE
89 :     | SINK
90 : leunga 695 | RTL of {hash:word, attribs:Basis.attribs ref, e:stm}
91 : leunga 744
92 : george 555 and rexp =
93 : leunga 744 REG of ty * reg
94 : monnier 411
95 :     (* sizes of constants are inferred by context *)
96 : leunga 775 | LI of I.machine_int
97 :     | LABEL of Label.label
98 : monnier 245 | CONST of Constant.const
99 : leunga 775 | LABEXP of rexp
100 : monnier 245
101 : george 555 | NEG of ty * rexp
102 : leunga 744 | ADD of ty * rexp * rexp
103 :     | SUB of ty * rexp * rexp
104 : monnier 245
105 : monnier 411 (* signed multiplication etc. *)
106 : leunga 744 | MULS of ty * rexp * rexp
107 :     | DIVS of ty * rexp * rexp
108 :     | QUOTS of ty * rexp * rexp
109 :     | REMS of ty * rexp * rexp
110 : monnier 245
111 : monnier 411 (* unsigned multiplication etc. *)
112 : leunga 744 | MULU of ty * rexp * rexp
113 :     | DIVU of ty * rexp * rexp
114 :     | REMU of ty * rexp * rexp
115 : monnier 245
116 : monnier 411 (* trapping versions of above. These are all signed *)
117 : george 555 | NEGT of ty * rexp
118 : leunga 744 | ADDT of ty * rexp * rexp
119 :     | SUBT of ty * rexp * rexp
120 :     | MULT of ty * rexp * rexp
121 :     | DIVT of ty * rexp * rexp
122 :     | QUOTT of ty * rexp * rexp
123 :     | REMT of ty * rexp * rexp
124 : monnier 245
125 : george 545 (* bit operations *)
126 : leunga 744 | ANDB of ty * rexp * rexp
127 :     | ORB of ty * rexp * rexp
128 :     | XORB of ty * rexp * rexp
129 :     | EQVB of ty * rexp * rexp
130 :     | NOTB of ty * rexp
131 : monnier 245
132 : leunga 744 | SRA of ty * rexp * rexp (* value, shift *)
133 :     | SRL of ty * rexp * rexp
134 :     | SLL of ty * rexp * rexp
135 : monnier 245
136 : george 545 (* type promotion/conversion *)
137 : leunga 744 | SX of ty * ty * rexp (* toTy, fromTy *)
138 :     | ZX of ty * ty * rexp (* toTy, fromTy *)
139 :     | CVTF2I of ty * rounding_mode * fty * fexp
140 : monnier 411
141 :     (*
142 :     * COND(ty,cc,e1,e2):
143 :     * Evaluate into either e1 or e2, depending on cc.
144 : george 545 * Both e1 and e2 are allowed to be evaluated eagerly.
145 : monnier 411 *)
146 : leunga 744 | COND of ty * ccexp * rexp * rexp
147 : monnier 411
148 :     (* integer load *)
149 : leunga 744 | LOAD of ty * rexp * Region.region
150 : monnier 411
151 : george 545 (* predication *)
152 : george 555 | PRED of rexp * ctrl
153 : monnier 245
154 : george 555 | LET of stm * rexp
155 : monnier 411
156 : george 555 | REXT of ty * rext
157 : monnier 411
158 : george 555 | MARK of rexp * an
159 : monnier 411
160 : leunga 744 | OP of ty * oper * rexp list
161 :     | ARG of ty * rep ref * string
162 :     | $ of ty * CellsBasis.cellkind * rexp
163 :     | PARAM of int
164 :     | BITSLICE of ty * (int * int) list * rexp
165 :     | ???
166 :    
167 :     and rep = REP of string
168 :    
169 :     and oper = OPER of Basis.misc_op
170 :    
171 : george 555 and fexp =
172 : monnier 411 FREG of fty * src
173 : george 555 | FLOAD of fty * rexp * Region.region
174 : monnier 245
175 : george 555 | FADD of fty * fexp * fexp
176 :     | FMUL of fty * fexp * fexp
177 :     | FSUB of fty * fexp * fexp
178 :     | FDIV of fty * fexp * fexp
179 :     | FABS of fty * fexp
180 :     | FNEG of fty * fexp
181 :     | FSQRT of fty * fexp
182 :     | FCOND of fty * ccexp *
183 :     fexp * fexp
184 :     | FCOPYSIGN of fty * fexp (*sign*) * fexp (*magnitude*)
185 : monnier 245
186 : george 555 | CVTI2F of fty * ty * rexp (* from signed integer *)
187 :     | CVTF2F of fty * fty * fexp (* float to float conversion *)
188 : monnier 245
189 : george 555 | FPRED of fexp * ctrl
190 : george 545
191 : george 555 | FEXT of fty * fext
192 : monnier 411
193 : george 555 | FMARK of fexp * an
194 : monnier 411
195 : george 555 and ccexp =
196 : leunga 744 CC of Basis.cond * src
197 :     | FCC of Basis.fcond * src
198 :     | TRUE
199 :     | FALSE
200 :     | NOT of ccexp
201 :     | AND of ccexp * ccexp
202 :     | OR of ccexp * ccexp
203 :     | XOR of ccexp * ccexp
204 :     | EQV of ccexp * ccexp
205 :     | CMP of ty * Basis.cond * rexp * rexp
206 : george 555 | FCMP of fty * Basis.fcond * fexp * fexp
207 :     | CCMARK of ccexp * an
208 :     | CCEXT of ty * ccext
209 : monnier 411
210 : george 555 and mlrisc =
211 :     CCR of ccexp
212 :     | GPR of rexp
213 :     | FPR of fexp
214 : monnier 245
215 : george 545 withtype controlflow = Label.label list (* control flow info *)
216 : george 555 and ctrl = var (* control dependence info *)
217 :     and ctrls = ctrl list
218 :     and sext = (stm, rexp, fexp, ccexp) Extension.sx
219 :     and rext = (stm, rexp, fexp, ccexp) Extension.rx
220 :     and fext = (stm, rexp, fexp, ccexp) Extension.fx
221 :     and ccext = (stm, rexp, fexp, ccexp) Extension.ccx
222 : leunga 775 and labexp = rexp
223 : george 545 (*
224 : george 555 * Useful type abbreviations for working for MLTree.
225 :     *)
226 :     type rewriter = (* rewriting functions *)
227 :     {stm:stm->stm, rexp:rexp->rexp, fexp:fexp->fexp, ccexp:ccexp->ccexp}
228 :     type 'a folder = (* aggregation functions *)
229 :     {stm:stm*'a->'a, rexp:rexp*'a->'a, fexp:fexp*'a->'a, ccexp:ccexp*'a->'a}
230 :     type hasher = (* hashing functions *)
231 :     {stm:stm->word, rexp:rexp->word, fexp:fexp->word, ccexp:ccexp->word}
232 :     type equality = (* comparison functions *)
233 :     {stm:stm * stm->bool, rexp:rexp * rexp->bool,
234 :     fexp:fexp * fexp->bool, ccexp:ccexp * ccexp->bool}
235 :     type printer = (* pretty printing functions *)
236 :     {stm:stm->string, rexp:rexp->string, fexp:fexp->string, ccexp:ccexp->string,
237 :     dstReg : ty * var -> string, srcReg : ty * var -> string}
238 : george 545
239 : monnier 245 end (* MLTREE *)
240 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0