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

SCM Repository

[diderot] Annotation of /branches/vis15/src/compiler/low-ir/low-ir.sml
ViewVC logotype

Annotation of /branches/vis15/src/compiler/low-ir/low-ir.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3967 - (view) (download)

1 : jhr 3609 (* low-ir.sml
2 : jhr 3480 *
3 :     * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     *
5 :     * COPYRIGHT (c) 2015 The University of Chicago
6 :     * All rights reserved.
7 :     *
8 :     * Lower-level version of the Diderot CFG IR
9 :     *
10 :     * Note: this file is generated from gen/ir/low-ir.spec and gen/ir/low-ir.in.
11 :     *)
12 :    
13 :     structure LowOps =
14 :     struct
15 :    
16 :     (* required helper functions for types *)
17 :     type ty = LowTypes.ty
18 :     val samety = LowTypes.same
19 :     val hashty = LowTypes.hash
20 :     val tyToString = LowTypes.toString
21 :    
22 :     (* required helper functions for type lists *)
23 :     type tys = ty list
24 :     fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
25 :     fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
26 : jhr 3652 fun tysToString tys = String.concat["[", String.concatWithMap "," tyToString tys, "]" ]
27 : jhr 3480
28 :     (* required helper functions for the int type *)
29 :     fun sameint (i1 : int, i2) = (i1 = i2)
30 :     fun hashint i = Word.fromInt i
31 :     fun intToString i = Int.toString i
32 :    
33 :     (* required helper functions for the string type *)
34 :     fun samestring (s1 : string, s2) = (s1 = s2)
35 :     val hashstring = HashString.hashString
36 :     fun stringToString s = String.concat["\"", s, "\""]
37 :    
38 : jhr 3652 (* required helper functions for the shape type *)
39 : jhr 3797 type shape = TensorShape.t
40 :     val sameshape = TensorShape.same
41 :     val hashshape = TensorShape.hash
42 :     val shapeToString = TensorShape.toString
43 : jhr 3652
44 : jhr 3480 (* required helper functions for the index control type type *)
45 : jhr 3886 type idxctl = IndexCtl.t
46 : jhr 3480 val sameidxctl = IndexCtl.same
47 :     val hashidxctl = IndexCtl.hash
48 :     val idxctlToString = IndexCtl.toString
49 :    
50 :     datatype rator
51 :     = IAdd
52 :     | ISub
53 :     | IMul
54 :     | IDiv
55 :     | IMod
56 :     | INeg
57 : jhr 3609 | RAdd
58 :     | RSub
59 :     | RMul
60 :     | RDiv
61 :     | RNeg
62 : jhr 3480 | LT of ty
63 :     | LTE of ty
64 :     | EQ of ty
65 :     | NEQ of ty
66 :     | GT of ty
67 :     | GTE of ty
68 :     | Not
69 : jhr 3483 | Abs of ty
70 :     | Max of ty
71 :     | Min of ty
72 : jhr 3830 | RClamp
73 :     | RLerp
74 : jhr 3766 | VAdd of int
75 :     | VSub of int
76 :     | VScale of int
77 :     | VMul of int
78 :     | VNeg of int
79 :     | VSum of int
80 : jhr 3832 | VIndex of int * int
81 : jhr 3830 | VClamp of int
82 :     | VMapClamp of int
83 :     | VLerp of int
84 : jhr 3766 | TensorIndex of ty * shape
85 :     | ProjectLast of ty * shape
86 : jhr 3480 | EigenVecs2x2
87 :     | EigenVecs3x3
88 :     | EigenVals2x2
89 :     | EigenVals3x3
90 : jhr 3629 | Zero of ty
91 : jhr 3480 | Select of ty * int
92 :     | Subscript of ty
93 :     | MkDynamic of ty * int
94 :     | Append of ty
95 :     | Prepend of ty
96 :     | Concat of ty
97 : jhr 3508 | Range
98 : jhr 3480 | Length of ty
99 : jhr 3629 | SphereQuery of ty * ty
100 : jhr 3480 | Sqrt
101 :     | Cos
102 :     | ArcCos
103 : jhr 3746 | Sin
104 : jhr 3480 | ArcSin
105 :     | Tan
106 :     | ArcTan
107 : jhr 3967 | Exp
108 : jhr 3480 | Ceiling of int
109 :     | Floor of int
110 :     | Round of int
111 :     | Trunc of int
112 :     | IntToReal
113 :     | RealToInt of int
114 : jhr 3629 | R_All of ty
115 :     | R_Exists of ty
116 :     | R_Max of ty
117 :     | R_Min of ty
118 :     | R_Sum of ty
119 :     | R_Product of ty
120 :     | R_Mean of ty
121 :     | R_Variance of ty
122 : jhr 3480 | Transform of ImageInfo.info
123 :     | Translate of ImageInfo.info
124 :     | ControlIndex of ImageInfo.info * idxctl * int
125 : jhr 3804 | LoadVoxel of ImageInfo.info
126 : jhr 3480 | Inside of ImageInfo.info * int
127 :     | ImageDim of ImageInfo.info * int
128 :     | LoadSeq of ty * string
129 :     | LoadImage of ty * string
130 :     | Print of tys
131 : jhr 3511 | MathFn of MathFns.t
132 : jhr 3480
133 :     fun resultArity IAdd = 1
134 :     | resultArity ISub = 1
135 :     | resultArity IMul = 1
136 :     | resultArity IDiv = 1
137 :     | resultArity IMod = 1
138 :     | resultArity INeg = 1
139 : jhr 3609 | resultArity RAdd = 1
140 :     | resultArity RSub = 1
141 :     | resultArity RMul = 1
142 :     | resultArity RDiv = 1
143 :     | resultArity RNeg = 1
144 : jhr 3480 | resultArity (LT _) = 1
145 :     | resultArity (LTE _) = 1
146 :     | resultArity (EQ _) = 1
147 :     | resultArity (NEQ _) = 1
148 :     | resultArity (GT _) = 1
149 :     | resultArity (GTE _) = 1
150 :     | resultArity Not = 1
151 : jhr 3483 | resultArity (Abs _) = 1
152 :     | resultArity (Max _) = 1
153 :     | resultArity (Min _) = 1
154 : jhr 3830 | resultArity RClamp = 1
155 :     | resultArity RLerp = 1
156 : jhr 3766 | resultArity (VAdd _) = 1
157 :     | resultArity (VSub _) = 1
158 :     | resultArity (VScale _) = 1
159 :     | resultArity (VMul _) = 1
160 :     | resultArity (VNeg _) = 1
161 :     | resultArity (VSum _) = 1
162 : jhr 3832 | resultArity (VIndex _) = 1
163 : jhr 3830 | resultArity (VClamp _) = 1
164 :     | resultArity (VMapClamp _) = 1
165 :     | resultArity (VLerp _) = 1
166 : jhr 3766 | resultArity (TensorIndex _) = 1
167 :     | resultArity (ProjectLast _) = 1
168 : jhr 3480 | resultArity EigenVecs2x2 = 1
169 :     | resultArity EigenVecs3x3 = 1
170 :     | resultArity EigenVals2x2 = 1
171 :     | resultArity EigenVals3x3 = 1
172 : jhr 3629 | resultArity (Zero _) = 1
173 : jhr 3480 | resultArity (Select _) = 1
174 :     | resultArity (Subscript _) = 1
175 :     | resultArity (MkDynamic _) = 1
176 : jhr 3866 | resultArity (Append _) = 1
177 :     | resultArity (Prepend _) = 1
178 :     | resultArity (Concat _) = 1
179 :     | resultArity Range = 1
180 : jhr 3480 | resultArity (Length _) = 1
181 : jhr 3629 | resultArity (SphereQuery _) = 1
182 : jhr 3480 | resultArity Sqrt = 1
183 :     | resultArity Cos = 1
184 :     | resultArity ArcCos = 1
185 : jhr 3746 | resultArity Sin = 1
186 : jhr 3480 | resultArity ArcSin = 1
187 :     | resultArity Tan = 1
188 :     | resultArity ArcTan = 1
189 : jhr 3967 | resultArity Exp = 1
190 : jhr 3480 | resultArity (Ceiling _) = 1
191 :     | resultArity (Floor _) = 1
192 :     | resultArity (Round _) = 1
193 :     | resultArity (Trunc _) = 1
194 :     | resultArity IntToReal = 1
195 :     | resultArity (RealToInt _) = 1
196 : jhr 3629 | resultArity (R_All _) = 1
197 :     | resultArity (R_Exists _) = 1
198 :     | resultArity (R_Max _) = 1
199 :     | resultArity (R_Min _) = 1
200 :     | resultArity (R_Sum _) = 1
201 :     | resultArity (R_Product _) = 1
202 :     | resultArity (R_Mean _) = 1
203 :     | resultArity (R_Variance _) = 1
204 : jhr 3480 | resultArity (Transform _) = 1
205 :     | resultArity (Translate _) = 1
206 :     | resultArity (ControlIndex _) = 1
207 : jhr 3804 | resultArity (LoadVoxel _) = 1
208 : jhr 3480 | resultArity (Inside _) = 1
209 :     | resultArity (ImageDim _) = 1
210 :     | resultArity (LoadSeq _) = 1
211 :     | resultArity (LoadImage _) = 1
212 :     | resultArity (Print _) = 0
213 : jhr 3511 | resultArity (MathFn _) = 1
214 : jhr 3480
215 :     fun arity IAdd = 2
216 :     | arity ISub = 2
217 :     | arity IMul = 2
218 :     | arity IDiv = 2
219 :     | arity IMod = 2
220 :     | arity INeg = 1
221 : jhr 3609 | arity RAdd = 2
222 :     | arity RSub = 2
223 :     | arity RMul = 2
224 :     | arity RDiv = 2
225 :     | arity RNeg = 1
226 : jhr 3480 | arity (LT _) = 2
227 :     | arity (LTE _) = 2
228 :     | arity (EQ _) = 2
229 :     | arity (NEQ _) = 2
230 :     | arity (GT _) = 2
231 :     | arity (GTE _) = 2
232 :     | arity Not = 1
233 : jhr 3483 | arity (Abs _) = 1
234 :     | arity (Max _) = 2
235 :     | arity (Min _) = 2
236 : jhr 3830 | arity RClamp = 3
237 :     | arity RLerp = 3
238 : jhr 3766 | arity (VAdd _) = 2
239 :     | arity (VSub _) = 2
240 :     | arity (VScale _) = 2
241 :     | arity (VMul _) = 2
242 :     | arity (VNeg _) = 2
243 :     | arity (VSum _) = 1
244 : jhr 3832 | arity (VIndex _) = 1
245 : jhr 3830 | arity (VClamp _) = 3
246 :     | arity (VMapClamp _) = 3
247 :     | arity (VLerp _) = 3
248 : jhr 3766 | arity (TensorIndex _) = 1
249 :     | arity (ProjectLast _) = 1
250 : jhr 3480 | arity EigenVecs2x2 = 1
251 :     | arity EigenVecs3x3 = 1
252 :     | arity EigenVals2x2 = 1
253 :     | arity EigenVals3x3 = 1
254 : jhr 3629 | arity (Zero _) = 0
255 : jhr 3480 | arity (Select _) = 1
256 :     | arity (Subscript _) = 2
257 :     | arity (MkDynamic _) = 1
258 : jhr 3866 | arity (Append _) = 2
259 :     | arity (Prepend _) = 2
260 :     | arity (Concat _) = 2
261 :     | arity Range = 2
262 : jhr 3480 | arity (Length _) = 1
263 : jhr 3629 | arity (SphereQuery _) = 2
264 : jhr 3480 | arity Sqrt = 1
265 :     | arity Cos = 1
266 :     | arity ArcCos = 1
267 : jhr 3746 | arity Sin = 1
268 : jhr 3480 | arity ArcSin = 1
269 :     | arity Tan = 1
270 :     | arity ArcTan = 1
271 : jhr 3967 | arity Exp = 1
272 : jhr 3480 | arity (Ceiling _) = 1
273 :     | arity (Floor _) = 1
274 :     | arity (Round _) = 1
275 :     | arity (Trunc _) = 1
276 :     | arity IntToReal = 1
277 :     | arity (RealToInt _) = 1
278 : jhr 3629 | arity (R_All _) = 3
279 :     | arity (R_Exists _) = 3
280 :     | arity (R_Max _) = 3
281 :     | arity (R_Min _) = 3
282 :     | arity (R_Sum _) = 3
283 :     | arity (R_Product _) = 3
284 :     | arity (R_Mean _) = 3
285 :     | arity (R_Variance _) = 4
286 : jhr 3870 | arity (Transform _) = 1
287 :     | arity (Translate _) = 1
288 : jhr 3480 | arity (ControlIndex _) = 2
289 : jhr 3804 | arity (LoadVoxel _) = 2
290 : jhr 3480 | arity (Inside _) = 2
291 :     | arity (ImageDim _) = 1
292 :     | arity (LoadSeq _) = 0
293 :     | arity (LoadImage _) = 0
294 :     | arity (Print _) = ~1
295 : jhr 3511 | arity (MathFn _) = ~1
296 : jhr 3480
297 :     fun isPure (MkDynamic _) = false
298 :     | isPure (Append _) = false
299 :     | isPure (Prepend _) = false
300 :     | isPure (Concat _) = false
301 :     | isPure (Print _) = false
302 :     | isPure _ = true
303 :    
304 :     fun same (IAdd, IAdd) = true
305 :     | same (ISub, ISub) = true
306 :     | same (IMul, IMul) = true
307 :     | same (IDiv, IDiv) = true
308 :     | same (IMod, IMod) = true
309 :     | same (INeg, INeg) = true
310 : jhr 3609 | same (RAdd, RAdd) = true
311 :     | same (RSub, RSub) = true
312 :     | same (RMul, RMul) = true
313 :     | same (RDiv, RDiv) = true
314 :     | same (RNeg, RNeg) = true
315 : jhr 3480 | same (LT(a0), LT(b0)) = samety(a0, b0)
316 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
317 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
318 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
319 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
320 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
321 :     | same (Not, Not) = true
322 : jhr 3483 | same (Abs(a0), Abs(b0)) = samety(a0, b0)
323 :     | same (Max(a0), Max(b0)) = samety(a0, b0)
324 :     | same (Min(a0), Min(b0)) = samety(a0, b0)
325 : jhr 3830 | same (RClamp, RClamp) = true
326 :     | same (RLerp, RLerp) = true
327 : jhr 3766 | same (VAdd(a0), VAdd(b0)) = sameint(a0, b0)
328 :     | same (VSub(a0), VSub(b0)) = sameint(a0, b0)
329 :     | same (VScale(a0), VScale(b0)) = sameint(a0, b0)
330 :     | same (VMul(a0), VMul(b0)) = sameint(a0, b0)
331 :     | same (VNeg(a0), VNeg(b0)) = sameint(a0, b0)
332 :     | same (VSum(a0), VSum(b0)) = sameint(a0, b0)
333 : jhr 3832 | same (VIndex(a0,a1), VIndex(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
334 : jhr 3830 | same (VClamp(a0), VClamp(b0)) = sameint(a0, b0)
335 :     | same (VMapClamp(a0), VMapClamp(b0)) = sameint(a0, b0)
336 :     | same (VLerp(a0), VLerp(b0)) = sameint(a0, b0)
337 : jhr 3766 | same (TensorIndex(a0,a1), TensorIndex(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
338 :     | same (ProjectLast(a0,a1), ProjectLast(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
339 : jhr 3480 | same (EigenVecs2x2, EigenVecs2x2) = true
340 :     | same (EigenVecs3x3, EigenVecs3x3) = true
341 :     | same (EigenVals2x2, EigenVals2x2) = true
342 :     | same (EigenVals3x3, EigenVals3x3) = true
343 : jhr 3629 | same (Zero(a0), Zero(b0)) = samety(a0, b0)
344 : jhr 3480 | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
345 :     | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
346 :     | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
347 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
348 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
349 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
350 : jhr 3508 | same (Range, Range) = true
351 : jhr 3480 | same (Length(a0), Length(b0)) = samety(a0, b0)
352 : jhr 3629 | same (SphereQuery(a0,a1), SphereQuery(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
353 : jhr 3480 | same (Sqrt, Sqrt) = true
354 :     | same (Cos, Cos) = true
355 :     | same (ArcCos, ArcCos) = true
356 : jhr 3746 | same (Sin, Sin) = true
357 : jhr 3480 | same (ArcSin, ArcSin) = true
358 :     | same (Tan, Tan) = true
359 :     | same (ArcTan, ArcTan) = true
360 : jhr 3967 | same (Exp, Exp) = true
361 : jhr 3480 | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
362 :     | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
363 :     | same (Round(a0), Round(b0)) = sameint(a0, b0)
364 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
365 :     | same (IntToReal, IntToReal) = true
366 :     | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
367 : jhr 3629 | same (R_All(a0), R_All(b0)) = samety(a0, b0)
368 :     | same (R_Exists(a0), R_Exists(b0)) = samety(a0, b0)
369 :     | same (R_Max(a0), R_Max(b0)) = samety(a0, b0)
370 :     | same (R_Min(a0), R_Min(b0)) = samety(a0, b0)
371 :     | same (R_Sum(a0), R_Sum(b0)) = samety(a0, b0)
372 :     | same (R_Product(a0), R_Product(b0)) = samety(a0, b0)
373 :     | same (R_Mean(a0), R_Mean(b0)) = samety(a0, b0)
374 :     | same (R_Variance(a0), R_Variance(b0)) = samety(a0, b0)
375 : jhr 3480 | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
376 :     | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
377 :     | same (ControlIndex(a0,a1,a2), ControlIndex(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameidxctl(a1, b1) andalso sameint(a2, b2)
378 : jhr 3804 | same (LoadVoxel(a0), LoadVoxel(b0)) = ImageInfo.same(a0, b0)
379 : jhr 3480 | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
380 :     | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
381 :     | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
382 :     | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
383 :     | same (Print(a0), Print(b0)) = sametys(a0, b0)
384 : jhr 3511 | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
385 : jhr 3480 | same _ = false
386 :    
387 :     fun hash IAdd = 0w3
388 :     | hash ISub = 0w5
389 :     | hash IMul = 0w7
390 :     | hash IDiv = 0w11
391 :     | hash IMod = 0w13
392 :     | hash INeg = 0w17
393 : jhr 3609 | hash RAdd = 0w19
394 :     | hash RSub = 0w23
395 :     | hash RMul = 0w29
396 :     | hash RDiv = 0w31
397 :     | hash RNeg = 0w37
398 : jhr 3766 | hash (LT(a0)) = 0w41 + hashty a0
399 :     | hash (LTE(a0)) = 0w43 + hashty a0
400 :     | hash (EQ(a0)) = 0w47 + hashty a0
401 :     | hash (NEQ(a0)) = 0w53 + hashty a0
402 :     | hash (GT(a0)) = 0w59 + hashty a0
403 :     | hash (GTE(a0)) = 0w61 + hashty a0
404 :     | hash Not = 0w67
405 :     | hash (Abs(a0)) = 0w71 + hashty a0
406 :     | hash (Max(a0)) = 0w73 + hashty a0
407 :     | hash (Min(a0)) = 0w79 + hashty a0
408 : jhr 3830 | hash RClamp = 0w83
409 :     | hash RLerp = 0w89
410 : jhr 3766 | hash (VAdd(a0)) = 0w97 + hashint a0
411 :     | hash (VSub(a0)) = 0w101 + hashint a0
412 :     | hash (VScale(a0)) = 0w103 + hashint a0
413 :     | hash (VMul(a0)) = 0w107 + hashint a0
414 :     | hash (VNeg(a0)) = 0w109 + hashint a0
415 :     | hash (VSum(a0)) = 0w113 + hashint a0
416 : jhr 3832 | hash (VIndex(a0,a1)) = 0w127 + hashint a0 + hashint a1
417 : jhr 3830 | hash (VClamp(a0)) = 0w131 + hashint a0
418 :     | hash (VMapClamp(a0)) = 0w137 + hashint a0
419 :     | hash (VLerp(a0)) = 0w139 + hashint a0
420 :     | hash (TensorIndex(a0,a1)) = 0w149 + hashty a0 + hashshape a1
421 :     | hash (ProjectLast(a0,a1)) = 0w151 + hashty a0 + hashshape a1
422 :     | hash EigenVecs2x2 = 0w157
423 :     | hash EigenVecs3x3 = 0w163
424 :     | hash EigenVals2x2 = 0w167
425 :     | hash EigenVals3x3 = 0w173
426 :     | hash (Zero(a0)) = 0w179 + hashty a0
427 :     | hash (Select(a0,a1)) = 0w181 + hashty a0 + hashint a1
428 :     | hash (Subscript(a0)) = 0w191 + hashty a0
429 :     | hash (MkDynamic(a0,a1)) = 0w193 + hashty a0 + hashint a1
430 :     | hash (Append(a0)) = 0w197 + hashty a0
431 :     | hash (Prepend(a0)) = 0w199 + hashty a0
432 :     | hash (Concat(a0)) = 0w211 + hashty a0
433 :     | hash Range = 0w223
434 :     | hash (Length(a0)) = 0w227 + hashty a0
435 :     | hash (SphereQuery(a0,a1)) = 0w229 + hashty a0 + hashty a1
436 :     | hash Sqrt = 0w233
437 :     | hash Cos = 0w239
438 :     | hash ArcCos = 0w241
439 :     | hash Sin = 0w251
440 :     | hash ArcSin = 0w257
441 :     | hash Tan = 0w263
442 :     | hash ArcTan = 0w269
443 : jhr 3967 | hash Exp = 0w271
444 :     | hash (Ceiling(a0)) = 0w277 + hashint a0
445 :     | hash (Floor(a0)) = 0w281 + hashint a0
446 :     | hash (Round(a0)) = 0w283 + hashint a0
447 :     | hash (Trunc(a0)) = 0w293 + hashint a0
448 :     | hash IntToReal = 0w307
449 :     | hash (RealToInt(a0)) = 0w311 + hashint a0
450 :     | hash (R_All(a0)) = 0w313 + hashty a0
451 :     | hash (R_Exists(a0)) = 0w317 + hashty a0
452 :     | hash (R_Max(a0)) = 0w331 + hashty a0
453 :     | hash (R_Min(a0)) = 0w337 + hashty a0
454 :     | hash (R_Sum(a0)) = 0w347 + hashty a0
455 :     | hash (R_Product(a0)) = 0w349 + hashty a0
456 :     | hash (R_Mean(a0)) = 0w353 + hashty a0
457 :     | hash (R_Variance(a0)) = 0w359 + hashty a0
458 :     | hash (Transform(a0)) = 0w367 + ImageInfo.hash a0
459 :     | hash (Translate(a0)) = 0w373 + ImageInfo.hash a0
460 :     | hash (ControlIndex(a0,a1,a2)) = 0w379 + ImageInfo.hash a0 + hashidxctl a1 + hashint a2
461 :     | hash (LoadVoxel(a0)) = 0w383 + ImageInfo.hash a0
462 :     | hash (Inside(a0,a1)) = 0w389 + ImageInfo.hash a0 + hashint a1
463 :     | hash (ImageDim(a0,a1)) = 0w397 + ImageInfo.hash a0 + hashint a1
464 :     | hash (LoadSeq(a0,a1)) = 0w401 + hashty a0 + hashstring a1
465 :     | hash (LoadImage(a0,a1)) = 0w409 + hashty a0 + hashstring a1
466 :     | hash (Print(a0)) = 0w419 + hashtys a0
467 :     | hash (MathFn(a0)) = 0w421 + MathFns.hash a0
468 : jhr 3480
469 :     fun toString IAdd = "IAdd"
470 :     | toString ISub = "ISub"
471 :     | toString IMul = "IMul"
472 :     | toString IDiv = "IDiv"
473 :     | toString IMod = "IMod"
474 :     | toString INeg = "INeg"
475 : jhr 3609 | toString RAdd = "RAdd"
476 :     | toString RSub = "RSub"
477 :     | toString RMul = "RMul"
478 :     | toString RDiv = "RDiv"
479 :     | toString RNeg = "RNeg"
480 : jhr 3480 | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
481 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
482 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
483 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
484 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
485 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
486 :     | toString Not = "Not"
487 : jhr 3483 | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
488 :     | toString (Max(a0)) = concat["Max<", tyToString a0, ">"]
489 :     | toString (Min(a0)) = concat["Min<", tyToString a0, ">"]
490 : jhr 3830 | toString RClamp = "RClamp"
491 :     | toString RLerp = "RLerp"
492 : jhr 3766 | toString (VAdd(a0)) = concat["VAdd<", intToString a0, ">"]
493 :     | toString (VSub(a0)) = concat["VSub<", intToString a0, ">"]
494 :     | toString (VScale(a0)) = concat["VScale<", intToString a0, ">"]
495 :     | toString (VMul(a0)) = concat["VMul<", intToString a0, ">"]
496 :     | toString (VNeg(a0)) = concat["VNeg<", intToString a0, ">"]
497 :     | toString (VSum(a0)) = concat["VSum<", intToString a0, ">"]
498 : jhr 3832 | toString (VIndex(a0,a1)) = concat["VIndex<", intToString a0, ",", intToString a1, ">"]
499 : jhr 3830 | toString (VClamp(a0)) = concat["VClamp<", intToString a0, ">"]
500 :     | toString (VMapClamp(a0)) = concat["VMapClamp<", intToString a0, ">"]
501 :     | toString (VLerp(a0)) = concat["VLerp<", intToString a0, ">"]
502 : jhr 3766 | toString (TensorIndex(a0,a1)) = concat["TensorIndex<", tyToString a0, ",", shapeToString a1, ">"]
503 :     | toString (ProjectLast(a0,a1)) = concat["ProjectLast<", tyToString a0, ",", shapeToString a1, ">"]
504 : jhr 3480 | toString EigenVecs2x2 = "EigenVecs2x2"
505 :     | toString EigenVecs3x3 = "EigenVecs3x3"
506 :     | toString EigenVals2x2 = "EigenVals2x2"
507 :     | toString EigenVals3x3 = "EigenVals3x3"
508 : jhr 3629 | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
509 : jhr 3480 | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
510 :     | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
511 :     | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
512 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
513 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
514 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
515 : jhr 3508 | toString Range = "Range"
516 : jhr 3480 | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
517 : jhr 3629 | toString (SphereQuery(a0,a1)) = concat["SphereQuery<", tyToString a0, ",", tyToString a1, ">"]
518 : jhr 3480 | toString Sqrt = "Sqrt"
519 :     | toString Cos = "Cos"
520 :     | toString ArcCos = "ArcCos"
521 : jhr 3746 | toString Sin = "Sin"
522 : jhr 3480 | toString ArcSin = "ArcSin"
523 :     | toString Tan = "Tan"
524 :     | toString ArcTan = "ArcTan"
525 : jhr 3967 | toString Exp = "Exp"
526 : jhr 3480 | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
527 :     | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
528 :     | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
529 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
530 :     | toString IntToReal = "IntToReal"
531 :     | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
532 : jhr 3629 | toString (R_All(a0)) = concat["R_All<", tyToString a0, ">"]
533 :     | toString (R_Exists(a0)) = concat["R_Exists<", tyToString a0, ">"]
534 :     | toString (R_Max(a0)) = concat["R_Max<", tyToString a0, ">"]
535 :     | toString (R_Min(a0)) = concat["R_Min<", tyToString a0, ">"]
536 :     | toString (R_Sum(a0)) = concat["R_Sum<", tyToString a0, ">"]
537 :     | toString (R_Product(a0)) = concat["R_Product<", tyToString a0, ">"]
538 :     | toString (R_Mean(a0)) = concat["R_Mean<", tyToString a0, ">"]
539 :     | toString (R_Variance(a0)) = concat["R_Variance<", tyToString a0, ">"]
540 : jhr 3480 | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
541 :     | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
542 :     | toString (ControlIndex(a0,a1,a2)) = concat["ControlIndex<", ImageInfo.toString a0, ",", idxctlToString a1, ",", intToString a2, ">"]
543 : jhr 3804 | toString (LoadVoxel(a0)) = concat["LoadVoxel<", ImageInfo.toString a0, ">"]
544 : jhr 3480 | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
545 :     | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
546 :     | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
547 :     | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
548 :     | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
549 : jhr 3511 | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
550 : jhr 3480
551 :     end
552 :    
553 :     structure LowIR = SSAFn(
554 : jhr 3508 val irName = "low-ir"
555 : jhr 3480 structure Ty = LowTypes
556 :     structure Op = LowOps)
557 :    
558 :     structure LowCensus = CensusFn(LowIR)

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