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 3138 - (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 : jhr 3060 (* required helper functions for the input type *)
36 :     type input = ty Inputs.input
37 :     val sameinput = Inputs.same
38 :     val hashinput = Inputs.hash
39 :     val inputToString = Inputs.toString
40 :    
41 : jhr 458 datatype rator
42 : cchiw 2523 = IAdd
43 :     | ISub
44 :     | IMul
45 :     | IDiv
46 :     | INeg
47 : cchiw 2870 | R of ty
48 : cchiw 2795 | IndexTensor of int * ty * ty
49 : cchiw 2791 | ProjectTensor of int * int * ty * ty
50 : cchiw 2523 | addSca
51 :     | subSca
52 :     | prodSca
53 :     | divSca
54 : cchiw 2870 | powRat of ty
55 :     | powInt
56 : cchiw 2525 | addVec of int
57 :     | subVec of int
58 : cchiw 2690 | prodVec of int
59 : cchiw 2525 | prodScaV of int
60 : cchiw 2690 | sumVec of int
61 :     | dotVec of int
62 : cchiw 2628 | Abs of ty
63 :     | LT of ty
64 :     | LTE of ty
65 :     | EQ of ty
66 :     | NEQ of ty
67 :     | GT of ty
68 :     | GTE of ty
69 :     | Not
70 :     | Max
71 :     | Min
72 : jhr 1295 | Clamp of ty
73 : jhr 1116 | Lerp of ty
74 : cchiw 2838 | Normalize of int
75 : jhr 458 | PrincipleEvec of ty
76 : jhr 1640 | EigenVecs2x2
77 :     | EigenVecs3x3
78 :     | EigenVals2x2
79 :     | EigenVals3x3
80 : jhr 1116 | Zero of ty
81 : jhr 1640 | Select of ty * int
82 :     | Index of ty * int
83 : jhr 458 | Subscript of ty
84 : cchiw 2400 | MkDynamic of ty * int
85 :     | Append of ty
86 :     | Prepend of ty
87 :     | Concat of ty
88 : cchiw 2667 | Sqrt
89 : cchiw 3138 | Cosine
90 :     | ArcCosine
91 :     | Sine
92 :     | ArcSine
93 : jhr 1116 | Ceiling of int
94 : jhr 458 | Floor of int
95 : jhr 1116 | Round of int
96 :     | Trunc of int
97 : jhr 458 | IntToReal
98 : jhr 1116 | RealToInt of int
99 : cchiw 2523 | Transform of ImageInfo.info
100 :     | Translate of ImageInfo.info
101 : cchiw 2525 | Kernel of Kernel.kernel * int
102 : jhr 511 | ImageAddress of ImageInfo.info
103 : jhr 1116 | LoadVoxels of ImageInfo.info * int
104 :     | Inside of ImageInfo.info * int
105 : cchiw 2628 | imgAddr of ImageInfo.info * ty * int
106 :     | imgLoad of ImageInfo.info * int * int
107 : cchiw 2680 | baseAddr of ImageInfo.info
108 : jhr 3060 | LoadSeq of ty * string
109 :     | LoadImage of ty * string * ImageInfo.info
110 :     | Input of input
111 : jhr 1640 | Print of tys
112 : jhr 458
113 : cchiw 2523 fun resultArity IAdd = 1
114 :     | resultArity ISub = 1
115 :     | resultArity IMul = 1
116 :     | resultArity IDiv = 1
117 :     | resultArity INeg = 1
118 : cchiw 2870 | resultArity (R _) = 1
119 : cchiw 2631 | resultArity (IndexTensor _) = 1
120 : cchiw 2791 | resultArity (ProjectTensor _) = 1
121 : cchiw 2523 | resultArity addSca = 1
122 :     | resultArity subSca = 1
123 :     | resultArity prodSca = 1
124 :     | resultArity divSca = 1
125 : cchiw 2870 | resultArity (powRat _) = 1
126 :     | resultArity powInt = 1
127 : cchiw 2525 | resultArity (addVec _) = 1
128 :     | resultArity (subVec _) = 1
129 :     | resultArity (prodVec _) = 1
130 :     | resultArity (prodScaV _) = 1
131 :     | resultArity (sumVec _) = 1
132 : cchiw 2680 | resultArity (dotVec _) = 1
133 : cchiw 2628 | resultArity (Abs _) = 1
134 :     | resultArity (LT _) = 1
135 :     | resultArity (LTE _) = 1
136 :     | resultArity (EQ _) = 1
137 :     | resultArity (NEQ _) = 1
138 :     | resultArity (GT _) = 1
139 :     | resultArity (GTE _) = 1
140 :     | resultArity Not = 1
141 :     | resultArity Max = 1
142 :     | resultArity Min = 1
143 : jhr 1640 | resultArity (Clamp _) = 1
144 :     | resultArity (Lerp _) = 1
145 : cchiw 2838 | resultArity (Normalize _) = 1
146 : jhr 1640 | resultArity (PrincipleEvec _) = 1
147 :     | resultArity EigenVecs2x2 = 1
148 :     | resultArity EigenVecs3x3 = 1
149 :     | resultArity EigenVals2x2 = 1
150 :     | resultArity EigenVals3x3 = 1
151 :     | resultArity (Zero _) = 1
152 :     | resultArity (Select _) = 1
153 :     | resultArity (Index _) = 1
154 :     | resultArity (Subscript _) = 1
155 : cchiw 2400 | resultArity (MkDynamic _) = 1
156 :     | resultArity (Append _) = 2
157 :     | resultArity (Prepend _) = 2
158 :     | resultArity (Concat _) = 2
159 : cchiw 2667 | resultArity Sqrt = 1
160 : cchiw 3138 | resultArity Cosine = 1
161 :     | resultArity ArcCosine = 1
162 :     | resultArity Sine = 1
163 :     | resultArity ArcSine = 1
164 : jhr 1640 | resultArity (Ceiling _) = 1
165 :     | resultArity (Floor _) = 1
166 :     | resultArity (Round _) = 1
167 :     | resultArity (Trunc _) = 1
168 :     | resultArity IntToReal = 1
169 :     | resultArity (RealToInt _) = 1
170 : cchiw 2523 | resultArity (Transform _) = 1
171 :     | resultArity (Translate _) = 1
172 : cchiw 2525 | resultArity (Kernel _) = 1
173 : jhr 1640 | resultArity (ImageAddress _) = 1
174 :     | resultArity (LoadVoxels _) = 1
175 : cchiw 2400 | resultArity (Inside _) = 1
176 : cchiw 2628 | resultArity (imgAddr _) = 1
177 :     | resultArity (imgLoad _) = 1
178 : cchiw 2680 | resultArity (baseAddr _) = 1
179 : jhr 3060 | resultArity (LoadSeq _) = 1
180 :     | resultArity (LoadImage _) = 1
181 :     | resultArity (Input _) = 0
182 : jhr 1640 | resultArity (Print _) = 0
183 :    
184 : cchiw 2523 fun arity IAdd = 2
185 :     | arity ISub = 2
186 :     | arity IMul = 2
187 :     | arity IDiv = 2
188 :     | arity INeg = 1
189 : cchiw 2870 | arity (R _) = 1
190 : cchiw 2631 | arity (IndexTensor _) = 2
191 : cchiw 2791 | arity (ProjectTensor _) = 2
192 : cchiw 2523 | arity addSca = 2
193 :     | arity subSca = 2
194 :     | arity prodSca = 2
195 :     | arity divSca = 2
196 : cchiw 2870 | arity (powRat _) = 2
197 :     | arity powInt = 2
198 : cchiw 2525 | arity (addVec _) = 2
199 :     | arity (subVec _) = 2
200 :     | arity (prodVec _) = 2
201 :     | arity (prodScaV _) = 2
202 :     | arity (sumVec _) = 2
203 : cchiw 2680 | arity (dotVec _) = 2
204 : cchiw 2628 | arity (Abs _) = 1
205 :     | arity (LT _) = 2
206 :     | arity (LTE _) = 2
207 :     | arity (EQ _) = 2
208 :     | arity (NEQ _) = 2
209 :     | arity (GT _) = 2
210 :     | arity (GTE _) = 2
211 :     | arity Not = 1
212 :     | arity Max = 2
213 :     | arity Min = 2
214 : jhr 1295 | arity (Clamp _) = 3
215 : jhr 1116 | arity (Lerp _) = 3
216 : cchiw 2838 | arity (Normalize _) = 1
217 : jhr 458 | arity (PrincipleEvec _) = 2
218 : jhr 1640 | arity EigenVecs2x2 = 1
219 :     | arity EigenVecs3x3 = 1
220 :     | arity EigenVals2x2 = 1
221 :     | arity EigenVals3x3 = 1
222 : jhr 1116 | arity (Zero _) = 0
223 : jhr 1640 | arity (Select _) = 1
224 :     | arity (Index _) = 1
225 : jhr 458 | arity (Subscript _) = 2
226 : cchiw 2400 | arity (MkDynamic _) = 1
227 :     | arity (Append _) = 1
228 :     | arity (Prepend _) = 1
229 :     | arity (Concat _) = 1
230 : cchiw 2667 | arity Sqrt = 1
231 : cchiw 3138 | arity Cosine = 1
232 :     | arity ArcCosine = 1
233 :     | arity Sine = 1
234 :     | arity ArcSine = 1
235 : jhr 1116 | arity (Ceiling _) = 1
236 : jhr 458 | arity (Floor _) = 1
237 : jhr 1116 | arity (Round _) = 1
238 :     | arity (Trunc _) = 1
239 : jhr 458 | arity IntToReal = 1
240 : jhr 1116 | arity (RealToInt _) = 1
241 : cchiw 2690 | arity (Transform _) = 2
242 :     | arity (Translate _) = 2
243 : cchiw 2525 | arity (Kernel _) = 0
244 : jhr 1116 | arity (ImageAddress _) = 1
245 : jhr 458 | arity (LoadVoxels _) = 1
246 : jhr 1116 | arity (Inside _) = 2
247 : cchiw 2628 | arity (imgAddr _) = 2
248 :     | arity (imgLoad _) = 2
249 : cchiw 2680 | arity (baseAddr _) = 2
250 : jhr 3060 | arity (LoadSeq _) = 0
251 :     | arity (LoadImage _) = 0
252 : cchiw 2525 | arity (Input _) = 0
253 : jhr 1640 | arity (Print _) = ~1
254 : jhr 458
255 : cchiw 2400 fun isPure (MkDynamic _) = false
256 :     | isPure (Append _) = false
257 :     | isPure (Prepend _) = false
258 :     | isPure (Concat _) = false
259 : jhr 3060 | isPure (Input _) = false
260 : cchiw 2400 | isPure (Print _) = false
261 : jhr 2356 | isPure _ = true
262 :    
263 : cchiw 2522 fun same (IAdd, IAdd) = true
264 :     | same (ISub, ISub) = true
265 :     | same (IMul, IMul) = true
266 :     | same (IDiv, IDiv) = true
267 :     | same (INeg, INeg) = true
268 : cchiw 2870 | same (R(a0), R(b0)) = samety(a0, b0)
269 : cchiw 2838 | same (IndexTensor(a0,a1,a2), IndexTensor(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)
270 :     | 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)
271 : cchiw 2523 | same (addSca, addSca) = true
272 :     | same (subSca, subSca) = true
273 :     | same (prodSca, prodSca) = true
274 :     | same (divSca, divSca) = true
275 : cchiw 2870 | same (powRat(a0), powRat(b0)) = samety(a0, b0)
276 :     | same (powInt, powInt) = true
277 : cchiw 2525 | same (addVec(a0), addVec(b0)) = sameint(a0, b0)
278 :     | same (subVec(a0), subVec(b0)) = sameint(a0, b0)
279 : cchiw 2690 | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)
280 : cchiw 2525 | same (prodScaV(a0), prodScaV(b0)) = sameint(a0, b0)
281 : cchiw 2690 | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)
282 :     | same (dotVec(a0), dotVec(b0)) = sameint(a0, b0)
283 : cchiw 2628 | same (Abs(a0), Abs(b0)) = samety(a0, b0)
284 :     | same (LT(a0), LT(b0)) = samety(a0, b0)
285 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
286 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
287 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
288 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
289 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
290 :     | same (Not, Not) = true
291 :     | same (Max, Max) = true
292 :     | same (Min, Min) = true
293 : jhr 1295 | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
294 : jhr 1116 | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
295 : cchiw 2838 | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)
296 : jhr 458 | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)
297 : jhr 1640 | same (EigenVecs2x2, EigenVecs2x2) = true
298 :     | same (EigenVecs3x3, EigenVecs3x3) = true
299 :     | same (EigenVals2x2, EigenVals2x2) = true
300 :     | same (EigenVals3x3, EigenVals3x3) = true
301 : jhr 1116 | same (Zero(a0), Zero(b0)) = samety(a0, b0)
302 : jhr 1640 | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
303 :     | same (Index(a0,a1), Index(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
304 : jhr 458 | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
305 : cchiw 2400 | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
306 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
307 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
308 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
309 : cchiw 2667 | same (Sqrt, Sqrt) = true
310 : cchiw 3138 | same (Cosine, Cosine) = true
311 :     | same (ArcCosine, ArcCosine) = true
312 :     | same (Sine, Sine) = true
313 :     | same (ArcSine, ArcSine) = true
314 : jhr 1116 | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
315 : jhr 458 | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
316 : jhr 1116 | same (Round(a0), Round(b0)) = sameint(a0, b0)
317 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
318 : jhr 458 | same (IntToReal, IntToReal) = true
319 : jhr 1116 | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
320 : cchiw 2523 | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
321 :     | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
322 : cchiw 2525 | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)
323 : jhr 511 | same (ImageAddress(a0), ImageAddress(b0)) = ImageInfo.same(a0, b0)
324 : jhr 1116 | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
325 :     | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
326 : cchiw 2628 | same (imgAddr(a0,a1,a2), imgAddr(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso samety(a1, b1) andalso sameint(a2, b2)
327 :     | same (imgLoad(a0,a1,a2), imgLoad(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
328 : cchiw 2680 | same (baseAddr(a0), baseAddr(b0)) = ImageInfo.same(a0, b0)
329 : jhr 3060 | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
330 :     | same (LoadImage(a0,a1,a2), LoadImage(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso ImageInfo.same(a2, b2)
331 :     | same (Input(a0), Input(b0)) = sameinput(a0, b0)
332 : jhr 1640 | same (Print(a0), Print(b0)) = sametys(a0, b0)
333 : jhr 458 | same _ = false
334 :    
335 : cchiw 2523 fun hash IAdd = 0w3
336 :     | hash ISub = 0w5
337 :     | hash IMul = 0w7
338 :     | hash IDiv = 0w11
339 :     | hash INeg = 0w13
340 : cchiw 2870 | hash (R(a0)) = 0w17 + hashty a0
341 :     | hash (IndexTensor(a0,a1,a2)) = 0w19 + hashint a0 + hashty a1 + hashty a2
342 :     | hash (ProjectTensor(a0,a1,a2,a3)) = 0w23 + hashint a0 + hashint a1 + hashty a2 + hashty a3
343 :     | hash addSca = 0w29
344 :     | hash subSca = 0w31
345 :     | hash prodSca = 0w37
346 :     | hash divSca = 0w41
347 :     | hash (powRat(a0)) = 0w43 + hashty a0
348 :     | hash powInt = 0w47
349 :     | hash (addVec(a0)) = 0w53 + hashint a0
350 :     | hash (subVec(a0)) = 0w59 + hashint a0
351 :     | hash (prodVec(a0)) = 0w61 + hashint a0
352 :     | hash (prodScaV(a0)) = 0w67 + hashint a0
353 :     | hash (sumVec(a0)) = 0w71 + hashint a0
354 :     | hash (dotVec(a0)) = 0w73 + hashint a0
355 :     | hash (Abs(a0)) = 0w79 + hashty a0
356 :     | hash (LT(a0)) = 0w83 + hashty a0
357 :     | hash (LTE(a0)) = 0w89 + hashty a0
358 :     | hash (EQ(a0)) = 0w97 + hashty a0
359 :     | hash (NEQ(a0)) = 0w101 + hashty a0
360 :     | hash (GT(a0)) = 0w103 + hashty a0
361 :     | hash (GTE(a0)) = 0w107 + hashty a0
362 :     | hash Not = 0w109
363 :     | hash Max = 0w113
364 :     | hash Min = 0w127
365 :     | hash (Clamp(a0)) = 0w131 + hashty a0
366 :     | hash (Lerp(a0)) = 0w137 + hashty a0
367 :     | hash (Normalize(a0)) = 0w139 + hashint a0
368 :     | hash (PrincipleEvec(a0)) = 0w149 + hashty a0
369 :     | hash EigenVecs2x2 = 0w151
370 :     | hash EigenVecs3x3 = 0w157
371 :     | hash EigenVals2x2 = 0w163
372 :     | hash EigenVals3x3 = 0w167
373 :     | hash (Zero(a0)) = 0w173 + hashty a0
374 :     | hash (Select(a0,a1)) = 0w179 + hashty a0 + hashint a1
375 :     | hash (Index(a0,a1)) = 0w181 + hashty a0 + hashint a1
376 :     | hash (Subscript(a0)) = 0w191 + hashty a0
377 :     | hash (MkDynamic(a0,a1)) = 0w193 + hashty a0 + hashint a1
378 :     | hash (Append(a0)) = 0w197 + hashty a0
379 :     | hash (Prepend(a0)) = 0w199 + hashty a0
380 :     | hash (Concat(a0)) = 0w211 + hashty a0
381 :     | hash Sqrt = 0w223
382 : cchiw 3138 | hash Cosine = 0w227
383 :     | hash ArcCosine = 0w229
384 :     | hash Sine = 0w233
385 :     | hash ArcSine = 0w239
386 :     | hash (Ceiling(a0)) = 0w241 + hashint a0
387 :     | hash (Floor(a0)) = 0w251 + hashint a0
388 :     | hash (Round(a0)) = 0w257 + hashint a0
389 :     | hash (Trunc(a0)) = 0w263 + hashint a0
390 :     | hash IntToReal = 0w269
391 :     | hash (RealToInt(a0)) = 0w271 + hashint a0
392 :     | hash (Transform(a0)) = 0w277 + ImageInfo.hash a0
393 :     | hash (Translate(a0)) = 0w281 + ImageInfo.hash a0
394 :     | hash (Kernel(a0,a1)) = 0w283 + Kernel.hash a0 + hashint a1
395 :     | hash (ImageAddress(a0)) = 0w293 + ImageInfo.hash a0
396 :     | hash (LoadVoxels(a0,a1)) = 0w307 + ImageInfo.hash a0 + hashint a1
397 :     | hash (Inside(a0,a1)) = 0w311 + ImageInfo.hash a0 + hashint a1
398 :     | hash (imgAddr(a0,a1,a2)) = 0w313 + ImageInfo.hash a0 + hashty a1 + hashint a2
399 :     | hash (imgLoad(a0,a1,a2)) = 0w317 + ImageInfo.hash a0 + hashint a1 + hashint a2
400 :     | hash (baseAddr(a0)) = 0w331 + ImageInfo.hash a0
401 :     | hash (LoadSeq(a0,a1)) = 0w337 + hashty a0 + hashstring a1
402 :     | hash (LoadImage(a0,a1,a2)) = 0w347 + hashty a0 + hashstring a1 + ImageInfo.hash a2
403 :     | hash (Input(a0)) = 0w349 + hashinput a0
404 :     | hash (Print(a0)) = 0w353 + hashtys a0
405 : jhr 458
406 : cchiw 2523 fun toString IAdd = "IAdd"
407 :     | toString ISub = "ISub"
408 :     | toString IMul = "IMul"
409 :     | toString IDiv = "IDiv"
410 :     | toString INeg = "INeg"
411 : cchiw 2870 | toString (R(a0)) = concat["R<", tyToString a0, ">"]
412 : cchiw 2795 | toString (IndexTensor(a0,a1,a2)) = concat["IndexTensor<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]
413 : cchiw 2791 | toString (ProjectTensor(a0,a1,a2,a3)) = concat["ProjectTensor<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
414 : cchiw 2523 | toString addSca = "addSca"
415 :     | toString subSca = "subSca"
416 :     | toString prodSca = "prodSca"
417 :     | toString divSca = "divSca"
418 : cchiw 2870 | toString (powRat(a0)) = concat["powRat<", tyToString a0, ">"]
419 :     | toString powInt = "powInt"
420 : cchiw 2525 | toString (addVec(a0)) = concat["addVec<", intToString a0, ">"]
421 :     | toString (subVec(a0)) = concat["subVec<", intToString a0, ">"]
422 : cchiw 2690 | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]
423 : cchiw 2525 | toString (prodScaV(a0)) = concat["prodScaV<", intToString a0, ">"]
424 : cchiw 2690 | toString (sumVec(a0)) = concat["sumVec<", intToString a0, ">"]
425 :     | toString (dotVec(a0)) = concat["dotVec<", intToString a0, ">"]
426 : cchiw 2628 | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
427 :     | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
428 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
429 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
430 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
431 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
432 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
433 :     | toString Not = "Not"
434 :     | toString Max = "Max"
435 :     | toString Min = "Min"
436 : jhr 1295 | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
437 : jhr 1116 | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
438 : cchiw 2838 | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]
439 : jhr 458 | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]
440 : jhr 1640 | toString EigenVecs2x2 = "EigenVecs2x2"
441 :     | toString EigenVecs3x3 = "EigenVecs3x3"
442 :     | toString EigenVals2x2 = "EigenVals2x2"
443 :     | toString EigenVals3x3 = "EigenVals3x3"
444 : jhr 1116 | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
445 : jhr 1640 | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
446 :     | toString (Index(a0,a1)) = concat["Index<", tyToString a0, ",", intToString a1, ">"]
447 : jhr 458 | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
448 : cchiw 2400 | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
449 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
450 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
451 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
452 : cchiw 2667 | toString Sqrt = "Sqrt"
453 : cchiw 3138 | toString Cosine = "Cosine"
454 :     | toString ArcCosine = "ArcCosine"
455 :     | toString Sine = "Sine"
456 :     | toString ArcSine = "ArcSine"
457 : jhr 1116 | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
458 : jhr 458 | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
459 : jhr 1116 | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
460 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
461 : jhr 458 | toString IntToReal = "IntToReal"
462 : jhr 1116 | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
463 : cchiw 2523 | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
464 :     | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
465 : cchiw 2525 | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]
466 : jhr 511 | toString (ImageAddress(a0)) = concat["ImageAddress<", ImageInfo.toString a0, ">"]
467 : jhr 1116 | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
468 :     | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
469 : cchiw 2628 | toString (imgAddr(a0,a1,a2)) = concat["imgAddr<", ImageInfo.toString a0, ",", tyToString a1, ",", intToString a2, ">"]
470 :     | toString (imgLoad(a0,a1,a2)) = concat["imgLoad<", ImageInfo.toString a0, ",", intToString a1, ",", intToString a2, ">"]
471 : cchiw 2680 | toString (baseAddr(a0)) = concat["baseAddr<", ImageInfo.toString a0, ">"]
472 : jhr 3060 | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
473 :     | toString (LoadImage(a0,a1,a2)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ",", ImageInfo.toString a2, ">"]
474 :     | toString (Input(a0)) = concat["Input<", inputToString a0, ">"]
475 : cchiw 2523 | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
476 : jhr 458
477 :     end
478 :    
479 :     structure LowIL = SSAFn(
480 : jhr 1232 val ilName = "low-il"
481 : jhr 458 structure Ty = LowILTypes
482 :     structure Op = LowOps)
483 : jhr 1116
484 :     structure LowILCensus = CensusFn(LowIL)
485 :    

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