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 3697 - (view) (download)

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

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