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 3830 - (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 :     type idxctl = IndexCtl.ctl
46 :     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 :     | VProj 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 :     | Ceiling of int
108 :     | Floor of int
109 :     | Round of int
110 :     | Trunc of int
111 :     | IntToReal
112 :     | RealToInt of int
113 : jhr 3629 | R_All of ty
114 :     | R_Exists of ty
115 :     | R_Max of ty
116 :     | R_Min of ty
117 :     | R_Sum of ty
118 :     | R_Product of ty
119 :     | R_Mean of ty
120 :     | R_Variance of ty
121 : jhr 3480 | Transform of ImageInfo.info
122 :     | Translate of ImageInfo.info
123 :     | ControlIndex of ImageInfo.info * idxctl * int
124 : jhr 3804 | LoadVoxel of ImageInfo.info
125 : jhr 3480 | Inside of ImageInfo.info * int
126 :     | ImageDim of ImageInfo.info * int
127 :     | LoadSeq of ty * string
128 :     | LoadImage of ty * string
129 :     | Print of tys
130 : jhr 3511 | MathFn of MathFns.t
131 : jhr 3480
132 :     fun resultArity IAdd = 1
133 :     | resultArity ISub = 1
134 :     | resultArity IMul = 1
135 :     | resultArity IDiv = 1
136 :     | resultArity IMod = 1
137 :     | resultArity INeg = 1
138 : jhr 3609 | resultArity RAdd = 1
139 :     | resultArity RSub = 1
140 :     | resultArity RMul = 1
141 :     | resultArity RDiv = 1
142 :     | resultArity RNeg = 1
143 : jhr 3480 | resultArity (LT _) = 1
144 :     | resultArity (LTE _) = 1
145 :     | resultArity (EQ _) = 1
146 :     | resultArity (NEQ _) = 1
147 :     | resultArity (GT _) = 1
148 :     | resultArity (GTE _) = 1
149 :     | resultArity Not = 1
150 : jhr 3483 | resultArity (Abs _) = 1
151 :     | resultArity (Max _) = 1
152 :     | resultArity (Min _) = 1
153 : jhr 3830 | resultArity RClamp = 1
154 :     | resultArity RLerp = 1
155 : jhr 3766 | resultArity (VAdd _) = 1
156 :     | resultArity (VSub _) = 1
157 :     | resultArity (VScale _) = 1
158 :     | resultArity (VMul _) = 1
159 :     | resultArity (VNeg _) = 1
160 :     | resultArity (VSum _) = 1
161 :     | resultArity (VProj _) = 1
162 : jhr 3830 | resultArity (VClamp _) = 1
163 :     | resultArity (VMapClamp _) = 1
164 :     | resultArity (VLerp _) = 1
165 : jhr 3766 | resultArity (TensorIndex _) = 1
166 :     | resultArity (ProjectLast _) = 1
167 : jhr 3480 | resultArity EigenVecs2x2 = 1
168 :     | resultArity EigenVecs3x3 = 1
169 :     | resultArity EigenVals2x2 = 1
170 :     | resultArity EigenVals3x3 = 1
171 : jhr 3629 | resultArity (Zero _) = 1
172 : jhr 3480 | resultArity (Select _) = 1
173 :     | resultArity (Subscript _) = 1
174 :     | resultArity (MkDynamic _) = 1
175 :     | resultArity (Append _) = 2
176 :     | resultArity (Prepend _) = 2
177 :     | resultArity (Concat _) = 2
178 : jhr 3508 | resultArity Range = 2
179 : jhr 3480 | resultArity (Length _) = 1
180 : jhr 3629 | resultArity (SphereQuery _) = 1
181 : jhr 3480 | resultArity Sqrt = 1
182 :     | resultArity Cos = 1
183 :     | resultArity ArcCos = 1
184 : jhr 3746 | resultArity Sin = 1
185 : jhr 3480 | resultArity ArcSin = 1
186 :     | resultArity Tan = 1
187 :     | resultArity ArcTan = 1
188 :     | resultArity (Ceiling _) = 1
189 :     | resultArity (Floor _) = 1
190 :     | resultArity (Round _) = 1
191 :     | resultArity (Trunc _) = 1
192 :     | resultArity IntToReal = 1
193 :     | resultArity (RealToInt _) = 1
194 : jhr 3629 | resultArity (R_All _) = 1
195 :     | resultArity (R_Exists _) = 1
196 :     | resultArity (R_Max _) = 1
197 :     | resultArity (R_Min _) = 1
198 :     | resultArity (R_Sum _) = 1
199 :     | resultArity (R_Product _) = 1
200 :     | resultArity (R_Mean _) = 1
201 :     | resultArity (R_Variance _) = 1
202 : jhr 3480 | resultArity (Transform _) = 1
203 :     | resultArity (Translate _) = 1
204 :     | resultArity (ControlIndex _) = 1
205 : jhr 3804 | resultArity (LoadVoxel _) = 1
206 : jhr 3480 | resultArity (Inside _) = 1
207 :     | resultArity (ImageDim _) = 1
208 :     | resultArity (LoadSeq _) = 1
209 :     | resultArity (LoadImage _) = 1
210 :     | resultArity (Print _) = 0
211 : jhr 3511 | resultArity (MathFn _) = 1
212 : jhr 3480
213 :     fun arity IAdd = 2
214 :     | arity ISub = 2
215 :     | arity IMul = 2
216 :     | arity IDiv = 2
217 :     | arity IMod = 2
218 :     | arity INeg = 1
219 : jhr 3609 | arity RAdd = 2
220 :     | arity RSub = 2
221 :     | arity RMul = 2
222 :     | arity RDiv = 2
223 :     | arity RNeg = 1
224 : jhr 3480 | arity (LT _) = 2
225 :     | arity (LTE _) = 2
226 :     | arity (EQ _) = 2
227 :     | arity (NEQ _) = 2
228 :     | arity (GT _) = 2
229 :     | arity (GTE _) = 2
230 :     | arity Not = 1
231 : jhr 3483 | arity (Abs _) = 1
232 :     | arity (Max _) = 2
233 :     | arity (Min _) = 2
234 : jhr 3830 | arity RClamp = 3
235 :     | arity RLerp = 3
236 : jhr 3766 | arity (VAdd _) = 2
237 :     | arity (VSub _) = 2
238 :     | arity (VScale _) = 2
239 :     | arity (VMul _) = 2
240 :     | arity (VNeg _) = 2
241 :     | arity (VSum _) = 1
242 :     | arity (VProj _) = 1
243 : jhr 3830 | arity (VClamp _) = 3
244 :     | arity (VMapClamp _) = 3
245 :     | arity (VLerp _) = 3
246 : jhr 3766 | arity (TensorIndex _) = 1
247 :     | arity (ProjectLast _) = 1
248 : jhr 3480 | arity EigenVecs2x2 = 1
249 :     | arity EigenVecs3x3 = 1
250 :     | arity EigenVals2x2 = 1
251 :     | arity EigenVals3x3 = 1
252 : jhr 3629 | arity (Zero _) = 0
253 : jhr 3480 | arity (Select _) = 1
254 :     | arity (Subscript _) = 2
255 :     | arity (MkDynamic _) = 1
256 :     | arity (Append _) = 1
257 :     | arity (Prepend _) = 1
258 :     | arity (Concat _) = 1
259 : jhr 3508 | arity Range = 1
260 : jhr 3480 | arity (Length _) = 1
261 : jhr 3629 | arity (SphereQuery _) = 2
262 : jhr 3480 | arity Sqrt = 1
263 :     | arity Cos = 1
264 :     | arity ArcCos = 1
265 : jhr 3746 | arity Sin = 1
266 : jhr 3480 | arity ArcSin = 1
267 :     | arity Tan = 1
268 :     | arity ArcTan = 1
269 :     | arity (Ceiling _) = 1
270 :     | arity (Floor _) = 1
271 :     | arity (Round _) = 1
272 :     | arity (Trunc _) = 1
273 :     | arity IntToReal = 1
274 :     | arity (RealToInt _) = 1
275 : jhr 3629 | arity (R_All _) = 3
276 :     | arity (R_Exists _) = 3
277 :     | arity (R_Max _) = 3
278 :     | arity (R_Min _) = 3
279 :     | arity (R_Sum _) = 3
280 :     | arity (R_Product _) = 3
281 :     | arity (R_Mean _) = 3
282 :     | arity (R_Variance _) = 4
283 : jhr 3480 | arity (Transform _) = 2
284 :     | arity (Translate _) = 2
285 :     | arity (ControlIndex _) = 2
286 : jhr 3804 | arity (LoadVoxel _) = 2
287 : jhr 3480 | arity (Inside _) = 2
288 :     | arity (ImageDim _) = 1
289 :     | arity (LoadSeq _) = 0
290 :     | arity (LoadImage _) = 0
291 :     | arity (Print _) = ~1
292 : jhr 3511 | arity (MathFn _) = ~1
293 : jhr 3480
294 :     fun isPure (MkDynamic _) = false
295 :     | isPure (Append _) = false
296 :     | isPure (Prepend _) = false
297 :     | isPure (Concat _) = false
298 :     | isPure (Print _) = false
299 :     | isPure _ = true
300 :    
301 :     fun same (IAdd, IAdd) = true
302 :     | same (ISub, ISub) = true
303 :     | same (IMul, IMul) = true
304 :     | same (IDiv, IDiv) = true
305 :     | same (IMod, IMod) = true
306 :     | same (INeg, INeg) = true
307 : jhr 3609 | same (RAdd, RAdd) = true
308 :     | same (RSub, RSub) = true
309 :     | same (RMul, RMul) = true
310 :     | same (RDiv, RDiv) = true
311 :     | same (RNeg, RNeg) = true
312 : jhr 3480 | same (LT(a0), LT(b0)) = samety(a0, b0)
313 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
314 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
315 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
316 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
317 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
318 :     | same (Not, Not) = true
319 : jhr 3483 | same (Abs(a0), Abs(b0)) = samety(a0, b0)
320 :     | same (Max(a0), Max(b0)) = samety(a0, b0)
321 :     | same (Min(a0), Min(b0)) = samety(a0, b0)
322 : jhr 3830 | same (RClamp, RClamp) = true
323 :     | same (RLerp, RLerp) = true
324 : jhr 3766 | same (VAdd(a0), VAdd(b0)) = sameint(a0, b0)
325 :     | same (VSub(a0), VSub(b0)) = sameint(a0, b0)
326 :     | same (VScale(a0), VScale(b0)) = sameint(a0, b0)
327 :     | same (VMul(a0), VMul(b0)) = sameint(a0, b0)
328 :     | same (VNeg(a0), VNeg(b0)) = sameint(a0, b0)
329 :     | same (VSum(a0), VSum(b0)) = sameint(a0, b0)
330 :     | same (VProj(a0,a1), VProj(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
331 : jhr 3830 | same (VClamp(a0), VClamp(b0)) = sameint(a0, b0)
332 :     | same (VMapClamp(a0), VMapClamp(b0)) = sameint(a0, b0)
333 :     | same (VLerp(a0), VLerp(b0)) = sameint(a0, b0)
334 : jhr 3766 | same (TensorIndex(a0,a1), TensorIndex(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
335 :     | same (ProjectLast(a0,a1), ProjectLast(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
336 : jhr 3480 | same (EigenVecs2x2, EigenVecs2x2) = true
337 :     | same (EigenVecs3x3, EigenVecs3x3) = true
338 :     | same (EigenVals2x2, EigenVals2x2) = true
339 :     | same (EigenVals3x3, EigenVals3x3) = true
340 : jhr 3629 | same (Zero(a0), Zero(b0)) = samety(a0, b0)
341 : jhr 3480 | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
342 :     | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
343 :     | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
344 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
345 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
346 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
347 : jhr 3508 | same (Range, Range) = true
348 : jhr 3480 | same (Length(a0), Length(b0)) = samety(a0, b0)
349 : jhr 3629 | same (SphereQuery(a0,a1), SphereQuery(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
350 : jhr 3480 | same (Sqrt, Sqrt) = true
351 :     | same (Cos, Cos) = true
352 :     | same (ArcCos, ArcCos) = true
353 : jhr 3746 | same (Sin, Sin) = true
354 : jhr 3480 | same (ArcSin, ArcSin) = true
355 :     | same (Tan, Tan) = true
356 :     | same (ArcTan, ArcTan) = true
357 :     | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
358 :     | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
359 :     | same (Round(a0), Round(b0)) = sameint(a0, b0)
360 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
361 :     | same (IntToReal, IntToReal) = true
362 :     | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
363 : jhr 3629 | same (R_All(a0), R_All(b0)) = samety(a0, b0)
364 :     | same (R_Exists(a0), R_Exists(b0)) = samety(a0, b0)
365 :     | same (R_Max(a0), R_Max(b0)) = samety(a0, b0)
366 :     | same (R_Min(a0), R_Min(b0)) = samety(a0, b0)
367 :     | same (R_Sum(a0), R_Sum(b0)) = samety(a0, b0)
368 :     | same (R_Product(a0), R_Product(b0)) = samety(a0, b0)
369 :     | same (R_Mean(a0), R_Mean(b0)) = samety(a0, b0)
370 :     | same (R_Variance(a0), R_Variance(b0)) = samety(a0, b0)
371 : jhr 3480 | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
372 :     | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
373 :     | same (ControlIndex(a0,a1,a2), ControlIndex(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameidxctl(a1, b1) andalso sameint(a2, b2)
374 : jhr 3804 | same (LoadVoxel(a0), LoadVoxel(b0)) = ImageInfo.same(a0, b0)
375 : jhr 3480 | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
376 :     | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
377 :     | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
378 :     | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
379 :     | same (Print(a0), Print(b0)) = sametys(a0, b0)
380 : jhr 3511 | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
381 : jhr 3480 | same _ = false
382 :    
383 :     fun hash IAdd = 0w3
384 :     | hash ISub = 0w5
385 :     | hash IMul = 0w7
386 :     | hash IDiv = 0w11
387 :     | hash IMod = 0w13
388 :     | hash INeg = 0w17
389 : jhr 3609 | hash RAdd = 0w19
390 :     | hash RSub = 0w23
391 :     | hash RMul = 0w29
392 :     | hash RDiv = 0w31
393 :     | hash RNeg = 0w37
394 : jhr 3766 | hash (LT(a0)) = 0w41 + hashty a0
395 :     | hash (LTE(a0)) = 0w43 + hashty a0
396 :     | hash (EQ(a0)) = 0w47 + hashty a0
397 :     | hash (NEQ(a0)) = 0w53 + hashty a0
398 :     | hash (GT(a0)) = 0w59 + hashty a0
399 :     | hash (GTE(a0)) = 0w61 + hashty a0
400 :     | hash Not = 0w67
401 :     | hash (Abs(a0)) = 0w71 + hashty a0
402 :     | hash (Max(a0)) = 0w73 + hashty a0
403 :     | hash (Min(a0)) = 0w79 + hashty a0
404 : jhr 3830 | hash RClamp = 0w83
405 :     | hash RLerp = 0w89
406 : jhr 3766 | hash (VAdd(a0)) = 0w97 + hashint a0
407 :     | hash (VSub(a0)) = 0w101 + hashint a0
408 :     | hash (VScale(a0)) = 0w103 + hashint a0
409 :     | hash (VMul(a0)) = 0w107 + hashint a0
410 :     | hash (VNeg(a0)) = 0w109 + hashint a0
411 :     | hash (VSum(a0)) = 0w113 + hashint a0
412 :     | hash (VProj(a0,a1)) = 0w127 + hashint a0 + hashint a1
413 : jhr 3830 | hash (VClamp(a0)) = 0w131 + hashint a0
414 :     | hash (VMapClamp(a0)) = 0w137 + hashint a0
415 :     | hash (VLerp(a0)) = 0w139 + hashint a0
416 :     | hash (TensorIndex(a0,a1)) = 0w149 + hashty a0 + hashshape a1
417 :     | hash (ProjectLast(a0,a1)) = 0w151 + hashty a0 + hashshape a1
418 :     | hash EigenVecs2x2 = 0w157
419 :     | hash EigenVecs3x3 = 0w163
420 :     | hash EigenVals2x2 = 0w167
421 :     | hash EigenVals3x3 = 0w173
422 :     | hash (Zero(a0)) = 0w179 + hashty a0
423 :     | hash (Select(a0,a1)) = 0w181 + hashty a0 + hashint a1
424 :     | hash (Subscript(a0)) = 0w191 + hashty a0
425 :     | hash (MkDynamic(a0,a1)) = 0w193 + hashty a0 + hashint a1
426 :     | hash (Append(a0)) = 0w197 + hashty a0
427 :     | hash (Prepend(a0)) = 0w199 + hashty a0
428 :     | hash (Concat(a0)) = 0w211 + hashty a0
429 :     | hash Range = 0w223
430 :     | hash (Length(a0)) = 0w227 + hashty a0
431 :     | hash (SphereQuery(a0,a1)) = 0w229 + hashty a0 + hashty a1
432 :     | hash Sqrt = 0w233
433 :     | hash Cos = 0w239
434 :     | hash ArcCos = 0w241
435 :     | hash Sin = 0w251
436 :     | hash ArcSin = 0w257
437 :     | hash Tan = 0w263
438 :     | hash ArcTan = 0w269
439 :     | hash (Ceiling(a0)) = 0w271 + hashint a0
440 :     | hash (Floor(a0)) = 0w277 + hashint a0
441 :     | hash (Round(a0)) = 0w281 + hashint a0
442 :     | hash (Trunc(a0)) = 0w283 + hashint a0
443 :     | hash IntToReal = 0w293
444 :     | hash (RealToInt(a0)) = 0w307 + hashint a0
445 :     | hash (R_All(a0)) = 0w311 + hashty a0
446 :     | hash (R_Exists(a0)) = 0w313 + hashty a0
447 :     | hash (R_Max(a0)) = 0w317 + hashty a0
448 :     | hash (R_Min(a0)) = 0w331 + hashty a0
449 :     | hash (R_Sum(a0)) = 0w337 + hashty a0
450 :     | hash (R_Product(a0)) = 0w347 + hashty a0
451 :     | hash (R_Mean(a0)) = 0w349 + hashty a0
452 :     | hash (R_Variance(a0)) = 0w353 + hashty a0
453 :     | hash (Transform(a0)) = 0w359 + ImageInfo.hash a0
454 :     | hash (Translate(a0)) = 0w367 + ImageInfo.hash a0
455 :     | hash (ControlIndex(a0,a1,a2)) = 0w373 + ImageInfo.hash a0 + hashidxctl a1 + hashint a2
456 :     | hash (LoadVoxel(a0)) = 0w379 + ImageInfo.hash a0
457 :     | hash (Inside(a0,a1)) = 0w383 + ImageInfo.hash a0 + hashint a1
458 :     | hash (ImageDim(a0,a1)) = 0w389 + ImageInfo.hash a0 + hashint a1
459 :     | hash (LoadSeq(a0,a1)) = 0w397 + hashty a0 + hashstring a1
460 :     | hash (LoadImage(a0,a1)) = 0w401 + hashty a0 + hashstring a1
461 :     | hash (Print(a0)) = 0w409 + hashtys a0
462 :     | hash (MathFn(a0)) = 0w419 + MathFns.hash a0
463 : jhr 3480
464 :     fun toString IAdd = "IAdd"
465 :     | toString ISub = "ISub"
466 :     | toString IMul = "IMul"
467 :     | toString IDiv = "IDiv"
468 :     | toString IMod = "IMod"
469 :     | toString INeg = "INeg"
470 : jhr 3609 | toString RAdd = "RAdd"
471 :     | toString RSub = "RSub"
472 :     | toString RMul = "RMul"
473 :     | toString RDiv = "RDiv"
474 :     | toString RNeg = "RNeg"
475 : jhr 3480 | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
476 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
477 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
478 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
479 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
480 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
481 :     | toString Not = "Not"
482 : jhr 3483 | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
483 :     | toString (Max(a0)) = concat["Max<", tyToString a0, ">"]
484 :     | toString (Min(a0)) = concat["Min<", tyToString a0, ">"]
485 : jhr 3830 | toString RClamp = "RClamp"
486 :     | toString RLerp = "RLerp"
487 : jhr 3766 | toString (VAdd(a0)) = concat["VAdd<", intToString a0, ">"]
488 :     | toString (VSub(a0)) = concat["VSub<", intToString a0, ">"]
489 :     | toString (VScale(a0)) = concat["VScale<", intToString a0, ">"]
490 :     | toString (VMul(a0)) = concat["VMul<", intToString a0, ">"]
491 :     | toString (VNeg(a0)) = concat["VNeg<", intToString a0, ">"]
492 :     | toString (VSum(a0)) = concat["VSum<", intToString a0, ">"]
493 :     | toString (VProj(a0,a1)) = concat["VProj<", intToString a0, ",", intToString a1, ">"]
494 : jhr 3830 | toString (VClamp(a0)) = concat["VClamp<", intToString a0, ">"]
495 :     | toString (VMapClamp(a0)) = concat["VMapClamp<", intToString a0, ">"]
496 :     | toString (VLerp(a0)) = concat["VLerp<", intToString a0, ">"]
497 : jhr 3766 | toString (TensorIndex(a0,a1)) = concat["TensorIndex<", tyToString a0, ",", shapeToString a1, ">"]
498 :     | toString (ProjectLast(a0,a1)) = concat["ProjectLast<", tyToString a0, ",", shapeToString a1, ">"]
499 : jhr 3480 | toString EigenVecs2x2 = "EigenVecs2x2"
500 :     | toString EigenVecs3x3 = "EigenVecs3x3"
501 :     | toString EigenVals2x2 = "EigenVals2x2"
502 :     | toString EigenVals3x3 = "EigenVals3x3"
503 : jhr 3629 | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
504 : jhr 3480 | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
505 :     | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
506 :     | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
507 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
508 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
509 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
510 : jhr 3508 | toString Range = "Range"
511 : jhr 3480 | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
512 : jhr 3629 | toString (SphereQuery(a0,a1)) = concat["SphereQuery<", tyToString a0, ",", tyToString a1, ">"]
513 : jhr 3480 | toString Sqrt = "Sqrt"
514 :     | toString Cos = "Cos"
515 :     | toString ArcCos = "ArcCos"
516 : jhr 3746 | toString Sin = "Sin"
517 : jhr 3480 | toString ArcSin = "ArcSin"
518 :     | toString Tan = "Tan"
519 :     | toString ArcTan = "ArcTan"
520 :     | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
521 :     | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
522 :     | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
523 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
524 :     | toString IntToReal = "IntToReal"
525 :     | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
526 : jhr 3629 | toString (R_All(a0)) = concat["R_All<", tyToString a0, ">"]
527 :     | toString (R_Exists(a0)) = concat["R_Exists<", tyToString a0, ">"]
528 :     | toString (R_Max(a0)) = concat["R_Max<", tyToString a0, ">"]
529 :     | toString (R_Min(a0)) = concat["R_Min<", tyToString a0, ">"]
530 :     | toString (R_Sum(a0)) = concat["R_Sum<", tyToString a0, ">"]
531 :     | toString (R_Product(a0)) = concat["R_Product<", tyToString a0, ">"]
532 :     | toString (R_Mean(a0)) = concat["R_Mean<", tyToString a0, ">"]
533 :     | toString (R_Variance(a0)) = concat["R_Variance<", tyToString a0, ">"]
534 : jhr 3480 | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
535 :     | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
536 :     | toString (ControlIndex(a0,a1,a2)) = concat["ControlIndex<", ImageInfo.toString a0, ",", idxctlToString a1, ",", intToString a2, ">"]
537 : jhr 3804 | toString (LoadVoxel(a0)) = concat["LoadVoxel<", ImageInfo.toString a0, ">"]
538 : jhr 3480 | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
539 :     | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
540 :     | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
541 :     | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
542 :     | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
543 : jhr 3511 | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
544 : jhr 3480
545 :     end
546 :    
547 :     structure LowIR = SSAFn(
548 : jhr 3508 val irName = "low-ir"
549 : jhr 3480 structure Ty = LowTypes
550 :     structure Op = LowOps)
551 :    
552 :     structure LowCensus = CensusFn(LowIR)

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