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

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