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

SCM Repository

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

Annotation of /branches/vis15/src/compiler/tree-ir/tree-ops.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4471 - (view) (download)

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

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