Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/charisee/src/compiler/low-il/low-il.sml
ViewVC logotype

Annotation of /branches/charisee/src/compiler/low-il/low-il.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2791 - (view) (download)

1 : jhr 458 (* low-il.in
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * Lower-level version of the Diderot IL input file.
7 :     *
8 :     *)
9 :    
10 :     structure LowOps =
11 :     struct
12 :    
13 : jhr 1640 (* required helper functions for types *)
14 : jhr 458 type ty = LowILTypes.ty
15 :     val samety = LowILTypes.same
16 :     val hashty = LowILTypes.hash
17 :     val tyToString = LowILTypes.toString
18 :    
19 : jhr 1640 (* required helper functions for type lists *)
20 :     type tys = ty list
21 :     fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
22 :     fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
23 :     fun tysToString tys = String.concat["[", String.concatWith "," (List.map tyToString tys), "]" ]
24 :    
25 :     (* required helper functions for the int type *)
26 : jhr 458 fun sameint (i1 : int, i2) = (i1 = i2)
27 :     fun hashint i = Word.fromInt i
28 :     fun intToString i = Int.toString i
29 : cchiw 2620
30 : jhr 1640 (* required helper functions for the string type *)
31 : jhr 458 fun samestring (s1 : string, s2) = (s1 = s2)
32 :     val hashstring = HashString.hashString
33 :     fun stringToString s = String.concat["\"", s, "\""]
34 :    
35 :     datatype rator
36 : cchiw 2523 = IAdd
37 :     | ISub
38 :     | IMul
39 :     | IDiv
40 :     | INeg
41 : cchiw 2631 | IndexTensor of int * ty * ty * ty
42 : cchiw 2791 | ProjectTensor of int * int * ty * ty
43 : cchiw 2523 | addSca
44 :     | subSca
45 :     | prodSca
46 :     | divSca
47 : cchiw 2525 | addVec of int
48 :     | subVec of int
49 : cchiw 2690 | prodVec of int
50 : cchiw 2525 | prodScaV of int
51 : cchiw 2690 | sumVec of int
52 :     | dotVec of int
53 : cchiw 2628 | Abs of ty
54 :     | LT of ty
55 :     | LTE of ty
56 :     | EQ of ty
57 :     | NEQ of ty
58 :     | GT of ty
59 :     | GTE of ty
60 :     | Not
61 :     | Max
62 :     | Min
63 : jhr 1295 | Clamp of ty
64 : jhr 1116 | Lerp of ty
65 : jhr 458 | PrincipleEvec of ty
66 : jhr 1640 | EigenVecs2x2
67 :     | EigenVecs3x3
68 :     | EigenVals2x2
69 :     | EigenVals3x3
70 : jhr 1116 | Zero of ty
71 : jhr 1640 | Select of ty * int
72 :     | Index of ty * int
73 : jhr 458 | Subscript of ty
74 : cchiw 2400 | MkDynamic of ty * int
75 :     | Append of ty
76 :     | Prepend of ty
77 :     | Concat of ty
78 : cchiw 2667 | Sqrt
79 : jhr 1116 | Ceiling of int
80 : jhr 458 | Floor of int
81 : jhr 1116 | Round of int
82 :     | Trunc of int
83 : jhr 458 | IntToReal
84 : jhr 1116 | RealToInt of int
85 : cchiw 2523 | Transform of ImageInfo.info
86 :     | Translate of ImageInfo.info
87 : cchiw 2525 | Kernel of Kernel.kernel * int
88 : jhr 511 | ImageAddress of ImageInfo.info
89 : jhr 1116 | LoadVoxels of ImageInfo.info * int
90 :     | Inside of ImageInfo.info * int
91 : cchiw 2400 | LoadSeq of ty * string
92 : cchiw 2525 | LoadImage of ImageInfo.info
93 : cchiw 2628 | imgAddr of ImageInfo.info * ty * int
94 :     | imgLoad of ImageInfo.info * int * int
95 : cchiw 2680 | baseAddr of ImageInfo.info
96 : cchiw 2525 | Input of ty * string * string
97 :     | InputWithDefault of ty * string * string
98 : jhr 1640 | Print of tys
99 : jhr 458
100 : cchiw 2523 fun resultArity IAdd = 1
101 :     | resultArity ISub = 1
102 :     | resultArity IMul = 1
103 :     | resultArity IDiv = 1
104 :     | resultArity INeg = 1
105 : cchiw 2631 | resultArity (IndexTensor _) = 1
106 : cchiw 2791 | resultArity (ProjectTensor _) = 1
107 : cchiw 2523 | resultArity addSca = 1
108 :     | resultArity subSca = 1
109 :     | resultArity prodSca = 1
110 :     | resultArity divSca = 1
111 : cchiw 2525 | resultArity (addVec _) = 1
112 :     | resultArity (subVec _) = 1
113 :     | resultArity (prodVec _) = 1
114 :     | resultArity (prodScaV _) = 1
115 :     | resultArity (sumVec _) = 1
116 : cchiw 2680 | resultArity (dotVec _) = 1
117 : cchiw 2628 | resultArity (Abs _) = 1
118 :     | resultArity (LT _) = 1
119 :     | resultArity (LTE _) = 1
120 :     | resultArity (EQ _) = 1
121 :     | resultArity (NEQ _) = 1
122 :     | resultArity (GT _) = 1
123 :     | resultArity (GTE _) = 1
124 :     | resultArity Not = 1
125 :     | resultArity Max = 1
126 :     | resultArity Min = 1
127 : jhr 1640 | resultArity (Clamp _) = 1
128 :     | resultArity (Lerp _) = 1
129 :     | resultArity (PrincipleEvec _) = 1
130 :     | resultArity EigenVecs2x2 = 1
131 :     | resultArity EigenVecs3x3 = 1
132 :     | resultArity EigenVals2x2 = 1
133 :     | resultArity EigenVals3x3 = 1
134 :     | resultArity (Zero _) = 1
135 :     | resultArity (Select _) = 1
136 :     | resultArity (Index _) = 1
137 :     | resultArity (Subscript _) = 1
138 : cchiw 2400 | resultArity (MkDynamic _) = 1
139 :     | resultArity (Append _) = 2
140 :     | resultArity (Prepend _) = 2
141 :     | resultArity (Concat _) = 2
142 : cchiw 2667 | resultArity Sqrt = 1
143 : jhr 1640 | resultArity (Ceiling _) = 1
144 :     | resultArity (Floor _) = 1
145 :     | resultArity (Round _) = 1
146 :     | resultArity (Trunc _) = 1
147 :     | resultArity IntToReal = 1
148 :     | resultArity (RealToInt _) = 1
149 : cchiw 2523 | resultArity (Transform _) = 1
150 :     | resultArity (Translate _) = 1
151 : cchiw 2525 | resultArity (Kernel _) = 1
152 : jhr 1640 | resultArity (ImageAddress _) = 1
153 :     | resultArity (LoadVoxels _) = 1
154 : cchiw 2400 | resultArity (Inside _) = 1
155 :     | resultArity (LoadSeq _) = 1
156 : jhr 1640 | resultArity (LoadImage _) = 1
157 : cchiw 2628 | resultArity (imgAddr _) = 1
158 :     | resultArity (imgLoad _) = 1
159 : cchiw 2680 | resultArity (baseAddr _) = 1
160 : cchiw 2525 | resultArity (Input _) = 1
161 :     | resultArity (InputWithDefault _) = 1
162 : jhr 1640 | resultArity (Print _) = 0
163 :    
164 : cchiw 2523 fun arity IAdd = 2
165 :     | arity ISub = 2
166 :     | arity IMul = 2
167 :     | arity IDiv = 2
168 :     | arity INeg = 1
169 : cchiw 2631 | arity (IndexTensor _) = 2
170 : cchiw 2791 | arity (ProjectTensor _) = 2
171 : cchiw 2523 | arity addSca = 2
172 :     | arity subSca = 2
173 :     | arity prodSca = 2
174 :     | arity divSca = 2
175 : cchiw 2525 | arity (addVec _) = 2
176 :     | arity (subVec _) = 2
177 :     | arity (prodVec _) = 2
178 :     | arity (prodScaV _) = 2
179 :     | arity (sumVec _) = 2
180 : cchiw 2680 | arity (dotVec _) = 2
181 : cchiw 2628 | arity (Abs _) = 1
182 :     | arity (LT _) = 2
183 :     | arity (LTE _) = 2
184 :     | arity (EQ _) = 2
185 :     | arity (NEQ _) = 2
186 :     | arity (GT _) = 2
187 :     | arity (GTE _) = 2
188 :     | arity Not = 1
189 :     | arity Max = 2
190 :     | arity Min = 2
191 : jhr 1295 | arity (Clamp _) = 3
192 : jhr 1116 | arity (Lerp _) = 3
193 : jhr 458 | arity (PrincipleEvec _) = 2
194 : jhr 1640 | arity EigenVecs2x2 = 1
195 :     | arity EigenVecs3x3 = 1
196 :     | arity EigenVals2x2 = 1
197 :     | arity EigenVals3x3 = 1
198 : jhr 1116 | arity (Zero _) = 0
199 : jhr 1640 | arity (Select _) = 1
200 :     | arity (Index _) = 1
201 : jhr 458 | arity (Subscript _) = 2
202 : cchiw 2400 | arity (MkDynamic _) = 1
203 :     | arity (Append _) = 1
204 :     | arity (Prepend _) = 1
205 :     | arity (Concat _) = 1
206 : cchiw 2667 | arity Sqrt = 1
207 : jhr 1116 | arity (Ceiling _) = 1
208 : jhr 458 | arity (Floor _) = 1
209 : jhr 1116 | arity (Round _) = 1
210 :     | arity (Trunc _) = 1
211 : jhr 458 | arity IntToReal = 1
212 : jhr 1116 | arity (RealToInt _) = 1
213 : cchiw 2690 | arity (Transform _) = 2
214 :     | arity (Translate _) = 2
215 : cchiw 2525 | arity (Kernel _) = 0
216 : jhr 1116 | arity (ImageAddress _) = 1
217 : jhr 458 | arity (LoadVoxels _) = 1
218 : jhr 1116 | arity (Inside _) = 2
219 : cchiw 2400 | arity (LoadSeq _) = 0
220 :     | arity (LoadImage _) = 0
221 : cchiw 2628 | arity (imgAddr _) = 2
222 :     | arity (imgLoad _) = 2
223 : cchiw 2680 | arity (baseAddr _) = 2
224 : cchiw 2525 | arity (Input _) = 0
225 :     | arity (InputWithDefault _) = 1
226 : jhr 1640 | arity (Print _) = ~1
227 : jhr 458
228 : cchiw 2400 fun isPure (MkDynamic _) = false
229 :     | isPure (Append _) = false
230 :     | isPure (Prepend _) = false
231 :     | isPure (Concat _) = false
232 :     | isPure (Print _) = false
233 : jhr 2356 | isPure _ = true
234 :    
235 : cchiw 2522 fun same (IAdd, IAdd) = true
236 :     | same (ISub, ISub) = true
237 :     | same (IMul, IMul) = true
238 :     | same (IDiv, IDiv) = true
239 :     | same (INeg, INeg) = true
240 : cchiw 2631 | same (IndexTensor(a0,a1,a2,a3), IndexTensor(b0,b1,b2,b3)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)
241 : cchiw 2791 | same (ProjectTensor(a0,a1,a2,a3), ProjectTensor(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)
242 : cchiw 2523 | same (addSca, addSca) = true
243 :     | same (subSca, subSca) = true
244 :     | same (prodSca, prodSca) = true
245 :     | same (divSca, divSca) = true
246 : cchiw 2525 | same (addVec(a0), addVec(b0)) = sameint(a0, b0)
247 :     | same (subVec(a0), subVec(b0)) = sameint(a0, b0)
248 : cchiw 2690 | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)
249 : cchiw 2525 | same (prodScaV(a0), prodScaV(b0)) = sameint(a0, b0)
250 : cchiw 2690 | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)
251 :     | same (dotVec(a0), dotVec(b0)) = sameint(a0, b0)
252 : cchiw 2628 | same (Abs(a0), Abs(b0)) = samety(a0, b0)
253 :     | same (LT(a0), LT(b0)) = samety(a0, b0)
254 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
255 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
256 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
257 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
258 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
259 :     | same (Not, Not) = true
260 :     | same (Max, Max) = true
261 :     | same (Min, Min) = true
262 : jhr 1295 | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
263 : jhr 1116 | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
264 : jhr 458 | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)
265 : jhr 1640 | same (EigenVecs2x2, EigenVecs2x2) = true
266 :     | same (EigenVecs3x3, EigenVecs3x3) = true
267 :     | same (EigenVals2x2, EigenVals2x2) = true
268 :     | same (EigenVals3x3, EigenVals3x3) = true
269 : jhr 1116 | same (Zero(a0), Zero(b0)) = samety(a0, b0)
270 : jhr 1640 | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
271 :     | same (Index(a0,a1), Index(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
272 : jhr 458 | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
273 : cchiw 2400 | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
274 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
275 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
276 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
277 : cchiw 2667 | same (Sqrt, Sqrt) = true
278 : jhr 1116 | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
279 : jhr 458 | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
280 : jhr 1116 | same (Round(a0), Round(b0)) = sameint(a0, b0)
281 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
282 : jhr 458 | same (IntToReal, IntToReal) = true
283 : jhr 1116 | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
284 : cchiw 2523 | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
285 :     | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
286 : cchiw 2525 | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)
287 : jhr 511 | same (ImageAddress(a0), ImageAddress(b0)) = ImageInfo.same(a0, b0)
288 : jhr 1116 | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
289 :     | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
290 : cchiw 2400 | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
291 : cchiw 2525 | same (LoadImage(a0), LoadImage(b0)) = ImageInfo.same(a0, b0)
292 : cchiw 2628 | same (imgAddr(a0,a1,a2), imgAddr(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso samety(a1, b1) andalso sameint(a2, b2)
293 :     | same (imgLoad(a0,a1,a2), imgLoad(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
294 : cchiw 2680 | same (baseAddr(a0), baseAddr(b0)) = ImageInfo.same(a0, b0)
295 : cchiw 2525 | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
296 :     | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
297 : jhr 1640 | same (Print(a0), Print(b0)) = sametys(a0, b0)
298 : jhr 458 | same _ = false
299 :    
300 : cchiw 2523 fun hash IAdd = 0w3
301 :     | hash ISub = 0w5
302 :     | hash IMul = 0w7
303 :     | hash IDiv = 0w11
304 :     | hash INeg = 0w13
305 : cchiw 2637 | hash (IndexTensor(a0,a1,a2,a3)) = 0w17 + hashint a0 + hashty a1 + hashty a2 + hashty a3
306 : cchiw 2791 | hash (ProjectTensor(a0,a1,a2,a3)) = 0w19 + hashint a0 + hashint a1 + hashty a2 + hashty a3
307 :     | hash addSca = 0w23
308 :     | hash subSca = 0w29
309 :     | hash prodSca = 0w31
310 :     | hash divSca = 0w37
311 :     | hash (addVec(a0)) = 0w41 + hashint a0
312 :     | hash (subVec(a0)) = 0w43 + hashint a0
313 :     | hash (prodVec(a0)) = 0w47 + hashint a0
314 :     | hash (prodScaV(a0)) = 0w53 + hashint a0
315 :     | hash (sumVec(a0)) = 0w59 + hashint a0
316 :     | hash (dotVec(a0)) = 0w61 + hashint a0
317 :     | hash (Abs(a0)) = 0w67 + hashty a0
318 :     | hash (LT(a0)) = 0w71 + hashty a0
319 :     | hash (LTE(a0)) = 0w73 + hashty a0
320 :     | hash (EQ(a0)) = 0w79 + hashty a0
321 :     | hash (NEQ(a0)) = 0w83 + hashty a0
322 :     | hash (GT(a0)) = 0w89 + hashty a0
323 :     | hash (GTE(a0)) = 0w97 + hashty a0
324 :     | hash Not = 0w101
325 :     | hash Max = 0w103
326 :     | hash Min = 0w107
327 :     | hash (Clamp(a0)) = 0w109 + hashty a0
328 :     | hash (Lerp(a0)) = 0w113 + hashty a0
329 :     | hash (PrincipleEvec(a0)) = 0w127 + hashty a0
330 :     | hash EigenVecs2x2 = 0w131
331 :     | hash EigenVecs3x3 = 0w137
332 :     | hash EigenVals2x2 = 0w139
333 :     | hash EigenVals3x3 = 0w149
334 :     | hash (Zero(a0)) = 0w151 + hashty a0
335 :     | hash (Select(a0,a1)) = 0w157 + hashty a0 + hashint a1
336 :     | hash (Index(a0,a1)) = 0w163 + hashty a0 + hashint a1
337 :     | hash (Subscript(a0)) = 0w167 + hashty a0
338 :     | hash (MkDynamic(a0,a1)) = 0w173 + hashty a0 + hashint a1
339 :     | hash (Append(a0)) = 0w179 + hashty a0
340 :     | hash (Prepend(a0)) = 0w181 + hashty a0
341 :     | hash (Concat(a0)) = 0w191 + hashty a0
342 :     | hash Sqrt = 0w193
343 :     | hash (Ceiling(a0)) = 0w197 + hashint a0
344 :     | hash (Floor(a0)) = 0w199 + hashint a0
345 :     | hash (Round(a0)) = 0w211 + hashint a0
346 :     | hash (Trunc(a0)) = 0w223 + hashint a0
347 :     | hash IntToReal = 0w227
348 :     | hash (RealToInt(a0)) = 0w229 + hashint a0
349 :     | hash (Transform(a0)) = 0w233 + ImageInfo.hash a0
350 :     | hash (Translate(a0)) = 0w239 + ImageInfo.hash a0
351 :     | hash (Kernel(a0,a1)) = 0w241 + Kernel.hash a0 + hashint a1
352 :     | hash (ImageAddress(a0)) = 0w251 + ImageInfo.hash a0
353 :     | hash (LoadVoxels(a0,a1)) = 0w257 + ImageInfo.hash a0 + hashint a1
354 :     | hash (Inside(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1
355 :     | hash (LoadSeq(a0,a1)) = 0w269 + hashty a0 + hashstring a1
356 :     | hash (LoadImage(a0)) = 0w271 + ImageInfo.hash a0
357 :     | hash (imgAddr(a0,a1,a2)) = 0w277 + ImageInfo.hash a0 + hashty a1 + hashint a2
358 :     | hash (imgLoad(a0,a1,a2)) = 0w281 + ImageInfo.hash a0 + hashint a1 + hashint a2
359 :     | hash (baseAddr(a0)) = 0w283 + ImageInfo.hash a0
360 :     | hash (Input(a0,a1,a2)) = 0w293 + hashty a0 + hashstring a1 + hashstring a2
361 :     | hash (InputWithDefault(a0,a1,a2)) = 0w307 + hashty a0 + hashstring a1 + hashstring a2
362 :     | hash (Print(a0)) = 0w311 + hashtys a0
363 : jhr 458
364 : cchiw 2523 fun toString IAdd = "IAdd"
365 :     | toString ISub = "ISub"
366 :     | toString IMul = "IMul"
367 :     | toString IDiv = "IDiv"
368 :     | toString INeg = "INeg"
369 : cchiw 2791 | toString (IndexTensor(a0,a1,a2,a3)) = concat["IndexTensor<", intToString a0, ",", tyToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
370 :     | toString (ProjectTensor(a0,a1,a2,a3)) = concat["ProjectTensor<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
371 : cchiw 2523 | toString addSca = "addSca"
372 :     | toString subSca = "subSca"
373 :     | toString prodSca = "prodSca"
374 :     | toString divSca = "divSca"
375 : cchiw 2525 | toString (addVec(a0)) = concat["addVec<", intToString a0, ">"]
376 :     | toString (subVec(a0)) = concat["subVec<", intToString a0, ">"]
377 : cchiw 2690 | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]
378 : cchiw 2525 | toString (prodScaV(a0)) = concat["prodScaV<", intToString a0, ">"]
379 : cchiw 2690 | toString (sumVec(a0)) = concat["sumVec<", intToString a0, ">"]
380 :     | toString (dotVec(a0)) = concat["dotVec<", intToString a0, ">"]
381 : cchiw 2628 | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
382 :     | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
383 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
384 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
385 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
386 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
387 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
388 :     | toString Not = "Not"
389 :     | toString Max = "Max"
390 :     | toString Min = "Min"
391 : jhr 1295 | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
392 : jhr 1116 | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
393 : jhr 458 | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]
394 : jhr 1640 | toString EigenVecs2x2 = "EigenVecs2x2"
395 :     | toString EigenVecs3x3 = "EigenVecs3x3"
396 :     | toString EigenVals2x2 = "EigenVals2x2"
397 :     | toString EigenVals3x3 = "EigenVals3x3"
398 : jhr 1116 | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
399 : jhr 1640 | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
400 :     | toString (Index(a0,a1)) = concat["Index<", tyToString a0, ",", intToString a1, ">"]
401 : jhr 458 | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
402 : cchiw 2400 | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
403 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
404 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
405 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
406 : cchiw 2667 | toString Sqrt = "Sqrt"
407 : jhr 1116 | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
408 : jhr 458 | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
409 : jhr 1116 | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
410 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
411 : jhr 458 | toString IntToReal = "IntToReal"
412 : jhr 1116 | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
413 : cchiw 2523 | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
414 :     | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
415 : cchiw 2525 | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]
416 : jhr 511 | toString (ImageAddress(a0)) = concat["ImageAddress<", ImageInfo.toString a0, ">"]
417 : jhr 1116 | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
418 :     | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
419 : cchiw 2400 | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
420 : cchiw 2525 | toString (LoadImage(a0)) = concat["LoadImage<", ImageInfo.toString a0, ">"]
421 : cchiw 2628 | toString (imgAddr(a0,a1,a2)) = concat["imgAddr<", ImageInfo.toString a0, ",", tyToString a1, ",", intToString a2, ">"]
422 :     | toString (imgLoad(a0,a1,a2)) = concat["imgLoad<", ImageInfo.toString a0, ",", intToString a1, ",", intToString a2, ">"]
423 : cchiw 2680 | toString (baseAddr(a0)) = concat["baseAddr<", ImageInfo.toString a0, ">"]
424 : cchiw 2525 | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
425 :     | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
426 : cchiw 2523 | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
427 : jhr 458
428 :     end
429 :    
430 :     structure LowIL = SSAFn(
431 : jhr 1232 val ilName = "low-il"
432 : jhr 458 structure Ty = LowILTypes
433 :     structure Op = LowOps)
434 : jhr 1116
435 :     structure LowILCensus = CensusFn(LowIL)
436 :    

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