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

SCM Repository

[diderot] Annotation of /branches/vis12/src/compiler/mid-il/mid-il.sml
ViewVC logotype

Annotation of /branches/vis12/src/compiler/mid-il/mid-il.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3291 - (view) (download)

1 : jhr 287 (* mid-il.sml
2 :     *
3 : jhr 3291 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     *
5 :     * COPYRIGHT (c) 2015 The University of Chicago
6 : jhr 287 * All rights reserved.
7 :     *
8 :     * Middle-level version of the Diderot IL.
9 :     *
10 :     * Note: this file is generated from gen/mid-il.spec and gen/mid-il.in.
11 :     *)
12 :    
13 :     structure MidOps =
14 :     struct
15 :    
16 : jhr 1640 (* required helper functions for types *)
17 : jhr 391 type ty = MidILTypes.ty
18 :     val samety = MidILTypes.same
19 :     val hashty = MidILTypes.hash
20 :     val tyToString = MidILTypes.toString
21 : jhr 328
22 : jhr 1640 (* 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.concatWith "," (List.map tyToString tys), "]" ]
27 :    
28 : jhr 1116 (* required helper functions for the int type *)
29 : jhr 332 fun sameint (i1 : int, i2) = (i1 = i2)
30 :     fun hashint i = Word.fromInt i
31 :     fun intToString i = Int.toString i
32 :    
33 : jhr 1116 (* required helper functions for the string type *)
34 : jhr 287 fun samestring (s1 : string, s2) = (s1 = s2)
35 :     val hashstring = HashString.hashString
36 :     fun stringToString s = String.concat["\"", s, "\""]
37 :    
38 : jhr 2822 (* required helper functions for the mask type *)
39 :     type mask = bool list
40 :     val samemask : (mask * mask -> bool) = (op =)
41 :     fun hashmask m =
42 : jhr 2826 List.foldl (fn (false, w) => w+w | (true, w) => w+w+0w1)
43 :     (Word.fromInt(List.length m)) m
44 : jhr 2822 fun maskToString m =
45 : jhr 2826 String.concat(List.map (fn true => "_" | false => ":") m)
46 : jhr 2822
47 : jhr 2011 (* required helper functions for the input type *)
48 :     type input = ty Inputs.input
49 :     val sameinput = Inputs.same
50 :     val hashinput = Inputs.hash
51 :     val inputToString = Inputs.toString
52 :    
53 : jhr 3072 (* required helper functions for the index control type type *)
54 :     type idxctl = IndexCtl.ctl
55 :     val sameidxctl = IndexCtl.same
56 :     val hashidxctl = IndexCtl.hash
57 :     val idxctlToString = IndexCtl.toString
58 :    
59 : jhr 287 datatype rator
60 :     = Add of ty
61 :     | Sub of ty
62 :     | Mul of ty
63 :     | Div of ty
64 : jhr 3280 | Mod
65 : jhr 287 | Neg of ty
66 : jhr 1116 | Abs of ty
67 : jhr 287 | LT of ty
68 :     | LTE of ty
69 :     | EQ of ty
70 :     | NEQ of ty
71 :     | GT of ty
72 :     | GTE of ty
73 : jhr 333 | Not
74 :     | Max
75 :     | Min
76 : jhr 1295 | Clamp of ty
77 : jhr 1116 | Lerp of ty
78 : jhr 349 | Dot of int
79 : jhr 1116 | MulVecMat of int * int
80 :     | MulMatVec of int * int
81 :     | MulMatMat of int * int * int
82 : jhr 1939 | MulVecTen3 of int * int * int
83 :     | MulTen3Vec of int * int * int
84 : jhr 1945 | ColonMul of ty * ty
85 : jhr 287 | Cross
86 : jhr 1116 | Norm of ty
87 :     | Normalize of int
88 :     | Scale of ty
89 : jhr 287 | PrincipleEvec of ty
90 : jhr 1640 | EigenVecs2x2
91 :     | EigenVecs3x3
92 :     | EigenVals2x2
93 :     | EigenVals3x3
94 : jhr 1116 | Identity of int
95 :     | Zero of ty
96 :     | Trace of int
97 : jhr 2331 | Transpose of int * int
98 : jhr 2822 | Slice of ty * mask
99 : jhr 1640 | Select of ty * int
100 :     | Index of ty * int
101 : jhr 287 | Subscript of ty
102 : jhr 1689 | MkDynamic of ty * int
103 :     | Append of ty
104 :     | Prepend of ty
105 :     | Concat of ty
106 : jhr 1925 | Length of ty
107 : jhr 1116 | Ceiling of int
108 : jhr 333 | Floor of int
109 : jhr 1116 | Round of int
110 :     | Trunc of int
111 : jhr 287 | IntToReal
112 : jhr 1116 | RealToInt of int
113 :     | VoxelAddress of ImageInfo.info * int
114 : jhr 3080 | VoxelAddressWithCtl of ImageInfo.info * int * idxctl
115 : jhr 1116 | LoadVoxels of ImageInfo.info * int
116 : jhr 450 | PosToImgSpace of ImageInfo.info
117 : jhr 1116 | TensorToWorldSpace of ImageInfo.info * ty
118 : jhr 328 | EvalKernel of int * Kernel.kernel * int
119 : jhr 1116 | Inside of ImageInfo.info * int
120 : jhr 2962 | ImageDim of ImageInfo.info * int
121 : jhr 2027 | LoadSeq of ty * string
122 : jhr 2796 | LoadImage of ty * string
123 : jhr 2011 | Input of input
124 : jhr 2813 | InputWithDefault of input
125 : jhr 1640 | Print of tys
126 : jhr 287
127 : jhr 1640 fun resultArity (Add _) = 1
128 :     | resultArity (Sub _) = 1
129 :     | resultArity (Mul _) = 1
130 :     | resultArity (Div _) = 1
131 : jhr 3280 | resultArity Mod = 1
132 : jhr 1640 | resultArity (Neg _) = 1
133 :     | resultArity (Abs _) = 1
134 :     | resultArity (LT _) = 1
135 :     | resultArity (LTE _) = 1
136 :     | resultArity (EQ _) = 1
137 :     | resultArity (NEQ _) = 1
138 :     | resultArity (GT _) = 1
139 :     | resultArity (GTE _) = 1
140 :     | resultArity Not = 1
141 :     | resultArity Max = 1
142 :     | resultArity Min = 1
143 :     | resultArity (Clamp _) = 1
144 :     | resultArity (Lerp _) = 1
145 :     | resultArity (Dot _) = 1
146 :     | resultArity (MulVecMat _) = 1
147 :     | resultArity (MulMatVec _) = 1
148 :     | resultArity (MulMatMat _) = 1
149 : jhr 1939 | resultArity (MulVecTen3 _) = 1
150 :     | resultArity (MulTen3Vec _) = 1
151 : jhr 1945 | resultArity (ColonMul _) = 1
152 : jhr 1640 | resultArity Cross = 1
153 :     | resultArity (Norm _) = 1
154 :     | resultArity (Normalize _) = 1
155 :     | resultArity (Scale _) = 1
156 :     | resultArity (PrincipleEvec _) = 1
157 :     | resultArity EigenVecs2x2 = 1
158 :     | resultArity EigenVecs3x3 = 1
159 :     | resultArity EigenVals2x2 = 1
160 :     | resultArity EigenVals3x3 = 1
161 :     | resultArity (Identity _) = 1
162 :     | resultArity (Zero _) = 1
163 :     | resultArity (Trace _) = 1
164 : jhr 2331 | resultArity (Transpose _) = 1
165 : jhr 2822 | resultArity (Slice _) = 1
166 : jhr 1640 | resultArity (Select _) = 1
167 :     | resultArity (Index _) = 1
168 :     | resultArity (Subscript _) = 1
169 : jhr 1689 | resultArity (MkDynamic _) = 1
170 :     | resultArity (Append _) = 2
171 :     | resultArity (Prepend _) = 2
172 :     | resultArity (Concat _) = 2
173 : jhr 1925 | resultArity (Length _) = 1
174 : jhr 1640 | resultArity (Ceiling _) = 1
175 :     | resultArity (Floor _) = 1
176 :     | resultArity (Round _) = 1
177 :     | resultArity (Trunc _) = 1
178 :     | resultArity IntToReal = 1
179 :     | resultArity (RealToInt _) = 1
180 :     | resultArity (VoxelAddress _) = 1
181 : jhr 3080 | resultArity (VoxelAddressWithCtl _) = 1
182 : jhr 1640 | resultArity (LoadVoxels _) = 1
183 :     | resultArity (PosToImgSpace _) = 1
184 :     | resultArity (TensorToWorldSpace _) = 1
185 :     | resultArity (EvalKernel _) = 1
186 :     | resultArity (Inside _) = 1
187 : jhr 2962 | resultArity (ImageDim _) = 1
188 : jhr 2027 | resultArity (LoadSeq _) = 1
189 :     | resultArity (LoadImage _) = 1
190 : jhr 2011 | resultArity (Input _) = 0
191 : jhr 2813 | resultArity (InputWithDefault _) = 0
192 : jhr 1640 | resultArity (Print _) = 0
193 :    
194 : jhr 287 fun arity (Add _) = 2
195 :     | arity (Sub _) = 2
196 :     | arity (Mul _) = 2
197 :     | arity (Div _) = 2
198 : jhr 3280 | arity Mod = 2
199 : jhr 287 | arity (Neg _) = 1
200 : jhr 1116 | arity (Abs _) = 1
201 : jhr 287 | arity (LT _) = 2
202 :     | arity (LTE _) = 2
203 :     | arity (EQ _) = 2
204 :     | arity (NEQ _) = 2
205 :     | arity (GT _) = 2
206 :     | arity (GTE _) = 2
207 : jhr 333 | arity Not = 1
208 :     | arity Max = 2
209 :     | arity Min = 2
210 : jhr 1295 | arity (Clamp _) = 3
211 : jhr 1116 | arity (Lerp _) = 3
212 : jhr 287 | arity (Dot _) = 2
213 : jhr 1116 | arity (MulVecMat _) = 2
214 :     | arity (MulMatVec _) = 2
215 :     | arity (MulMatMat _) = 2
216 : jhr 1939 | arity (MulVecTen3 _) = 2
217 :     | arity (MulTen3Vec _) = 2
218 : jhr 1945 | arity (ColonMul _) = 2
219 : jhr 287 | arity Cross = 2
220 :     | arity (Norm _) = 1
221 : jhr 1116 | arity (Normalize _) = 1
222 : jhr 287 | arity (Scale _) = 2
223 :     | arity (PrincipleEvec _) = 2
224 : jhr 1640 | arity EigenVecs2x2 = 1
225 :     | arity EigenVecs3x3 = 1
226 :     | arity EigenVals2x2 = 1
227 :     | arity EigenVals3x3 = 1
228 : jhr 1116 | arity (Identity _) = 0
229 :     | arity (Zero _) = 0
230 :     | arity (Trace _) = 1
231 : jhr 2331 | arity (Transpose _) = 1
232 : jhr 2822 | arity (Slice _) = 1
233 : jhr 1640 | arity (Select _) = 1
234 :     | arity (Index _) = 1
235 : jhr 287 | arity (Subscript _) = 2
236 : jhr 1689 | arity (MkDynamic _) = 1
237 :     | arity (Append _) = 1
238 :     | arity (Prepend _) = 1
239 :     | arity (Concat _) = 1
240 : jhr 1925 | arity (Length _) = 1
241 : jhr 1116 | arity (Ceiling _) = 1
242 : jhr 333 | arity (Floor _) = 1
243 : jhr 1116 | arity (Round _) = 1
244 :     | arity (Trunc _) = 1
245 : jhr 287 | arity IntToReal = 1
246 : jhr 1116 | arity (RealToInt _) = 1
247 : jhr 287 | arity (VoxelAddress _) = ~1
248 : jhr 3080 | arity (VoxelAddressWithCtl _) = ~1
249 : jhr 287 | arity (LoadVoxels _) = 1
250 : jhr 1116 | arity (PosToImgSpace _) = 2
251 :     | arity (TensorToWorldSpace _) = 2
252 : jhr 328 | arity (EvalKernel _) = 1
253 : jhr 1116 | arity (Inside _) = 2
254 : jhr 2962 | arity (ImageDim _) = 1
255 : jhr 2027 | arity (LoadSeq _) = 0
256 :     | arity (LoadImage _) = 0
257 : jhr 287 | arity (Input _) = 0
258 : jhr 2813 | arity (InputWithDefault _) = 1
259 : jhr 1640 | arity (Print _) = ~1
260 : jhr 287
261 : jhr 2280 fun isPure (MkDynamic _) = false
262 :     | isPure (Append _) = false
263 :     | isPure (Prepend _) = false
264 :     | isPure (Concat _) = false
265 : jhr 2638 | isPure (Input _) = false
266 : jhr 2813 | isPure (InputWithDefault _) = false
267 : jhr 2280 | isPure (Print _) = false
268 :     | isPure _ = true
269 :    
270 : jhr 287 fun same (Add(a0), Add(b0)) = samety(a0, b0)
271 :     | same (Sub(a0), Sub(b0)) = samety(a0, b0)
272 :     | same (Mul(a0), Mul(b0)) = samety(a0, b0)
273 :     | same (Div(a0), Div(b0)) = samety(a0, b0)
274 : jhr 3280 | same (Mod, Mod) = true
275 : jhr 287 | same (Neg(a0), Neg(b0)) = samety(a0, b0)
276 : jhr 1116 | same (Abs(a0), Abs(b0)) = samety(a0, b0)
277 : jhr 287 | same (LT(a0), LT(b0)) = samety(a0, b0)
278 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
279 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
280 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
281 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
282 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
283 : jhr 333 | same (Not, Not) = true
284 :     | same (Max, Max) = true
285 :     | same (Min, Min) = true
286 : jhr 1295 | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
287 : jhr 1116 | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
288 : jhr 349 | same (Dot(a0), Dot(b0)) = sameint(a0, b0)
289 : jhr 1116 | same (MulVecMat(a0,a1), MulVecMat(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
290 :     | same (MulMatVec(a0,a1), MulMatVec(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
291 :     | same (MulMatMat(a0,a1,a2), MulMatMat(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
292 : jhr 1939 | same (MulVecTen3(a0,a1,a2), MulVecTen3(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
293 :     | same (MulTen3Vec(a0,a1,a2), MulTen3Vec(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
294 : jhr 1945 | same (ColonMul(a0,a1), ColonMul(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
295 : jhr 287 | same (Cross, Cross) = true
296 : jhr 1116 | same (Norm(a0), Norm(b0)) = samety(a0, b0)
297 :     | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)
298 :     | same (Scale(a0), Scale(b0)) = samety(a0, b0)
299 : jhr 287 | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)
300 : jhr 1640 | same (EigenVecs2x2, EigenVecs2x2) = true
301 :     | same (EigenVecs3x3, EigenVecs3x3) = true
302 :     | same (EigenVals2x2, EigenVals2x2) = true
303 :     | same (EigenVals3x3, EigenVals3x3) = true
304 : jhr 1116 | same (Identity(a0), Identity(b0)) = sameint(a0, b0)
305 :     | same (Zero(a0), Zero(b0)) = samety(a0, b0)
306 :     | same (Trace(a0), Trace(b0)) = sameint(a0, b0)
307 : jhr 2331 | same (Transpose(a0,a1), Transpose(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
308 : jhr 2822 | same (Slice(a0,a1), Slice(b0,b1)) = samety(a0, b0) andalso samemask(a1, b1)
309 : jhr 1640 | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
310 :     | same (Index(a0,a1), Index(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
311 : jhr 287 | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
312 : jhr 1689 | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
313 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
314 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
315 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
316 : jhr 1925 | same (Length(a0), Length(b0)) = samety(a0, b0)
317 : jhr 1116 | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
318 : jhr 333 | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
319 : jhr 1116 | same (Round(a0), Round(b0)) = sameint(a0, b0)
320 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
321 : jhr 287 | same (IntToReal, IntToReal) = true
322 : jhr 1116 | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
323 :     | same (VoxelAddress(a0,a1), VoxelAddress(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
324 : jhr 3080 | same (VoxelAddressWithCtl(a0,a1,a2), VoxelAddressWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)
325 : jhr 1116 | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
326 : jhr 450 | same (PosToImgSpace(a0), PosToImgSpace(b0)) = ImageInfo.same(a0, b0)
327 : jhr 1116 | same (TensorToWorldSpace(a0,a1), TensorToWorldSpace(b0,b1)) = ImageInfo.same(a0, b0) andalso samety(a1, b1)
328 : jhr 328 | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)
329 : jhr 1116 | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
330 : jhr 2962 | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
331 : jhr 2027 | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
332 : jhr 2796 | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
333 : jhr 2011 | same (Input(a0), Input(b0)) = sameinput(a0, b0)
334 : jhr 2813 | same (InputWithDefault(a0), InputWithDefault(b0)) = sameinput(a0, b0)
335 : jhr 1640 | same (Print(a0), Print(b0)) = sametys(a0, b0)
336 : jhr 287 | same _ = false
337 :    
338 :     fun hash (Add(a0)) = 0w3 + hashty a0
339 :     | hash (Sub(a0)) = 0w5 + hashty a0
340 :     | hash (Mul(a0)) = 0w7 + hashty a0
341 :     | hash (Div(a0)) = 0w11 + hashty a0
342 : jhr 3280 | hash Mod = 0w13
343 :     | hash (Neg(a0)) = 0w17 + hashty a0
344 :     | hash (Abs(a0)) = 0w19 + hashty a0
345 :     | hash (LT(a0)) = 0w23 + hashty a0
346 :     | hash (LTE(a0)) = 0w29 + hashty a0
347 :     | hash (EQ(a0)) = 0w31 + hashty a0
348 :     | hash (NEQ(a0)) = 0w37 + hashty a0
349 :     | hash (GT(a0)) = 0w41 + hashty a0
350 :     | hash (GTE(a0)) = 0w43 + hashty a0
351 :     | hash Not = 0w47
352 :     | hash Max = 0w53
353 :     | hash Min = 0w59
354 :     | hash (Clamp(a0)) = 0w61 + hashty a0
355 :     | hash (Lerp(a0)) = 0w67 + hashty a0
356 :     | hash (Dot(a0)) = 0w71 + hashint a0
357 :     | hash (MulVecMat(a0,a1)) = 0w73 + hashint a0 + hashint a1
358 :     | hash (MulMatVec(a0,a1)) = 0w79 + hashint a0 + hashint a1
359 :     | hash (MulMatMat(a0,a1,a2)) = 0w83 + hashint a0 + hashint a1 + hashint a2
360 :     | hash (MulVecTen3(a0,a1,a2)) = 0w89 + hashint a0 + hashint a1 + hashint a2
361 :     | hash (MulTen3Vec(a0,a1,a2)) = 0w97 + hashint a0 + hashint a1 + hashint a2
362 :     | hash (ColonMul(a0,a1)) = 0w101 + hashty a0 + hashty a1
363 :     | hash Cross = 0w103
364 :     | hash (Norm(a0)) = 0w107 + hashty a0
365 :     | hash (Normalize(a0)) = 0w109 + hashint a0
366 :     | hash (Scale(a0)) = 0w113 + hashty a0
367 :     | hash (PrincipleEvec(a0)) = 0w127 + hashty a0
368 :     | hash EigenVecs2x2 = 0w131
369 :     | hash EigenVecs3x3 = 0w137
370 :     | hash EigenVals2x2 = 0w139
371 :     | hash EigenVals3x3 = 0w149
372 :     | hash (Identity(a0)) = 0w151 + hashint a0
373 :     | hash (Zero(a0)) = 0w157 + hashty a0
374 :     | hash (Trace(a0)) = 0w163 + hashint a0
375 :     | hash (Transpose(a0,a1)) = 0w167 + hashint a0 + hashint a1
376 :     | hash (Slice(a0,a1)) = 0w173 + hashty a0 + hashmask a1
377 :     | hash (Select(a0,a1)) = 0w179 + hashty a0 + hashint a1
378 :     | hash (Index(a0,a1)) = 0w181 + hashty a0 + hashint a1
379 :     | hash (Subscript(a0)) = 0w191 + hashty a0
380 :     | hash (MkDynamic(a0,a1)) = 0w193 + hashty a0 + hashint a1
381 :     | hash (Append(a0)) = 0w197 + hashty a0
382 :     | hash (Prepend(a0)) = 0w199 + hashty a0
383 :     | hash (Concat(a0)) = 0w211 + hashty a0
384 :     | hash (Length(a0)) = 0w223 + hashty a0
385 :     | hash (Ceiling(a0)) = 0w227 + hashint a0
386 :     | hash (Floor(a0)) = 0w229 + hashint a0
387 :     | hash (Round(a0)) = 0w233 + hashint a0
388 :     | hash (Trunc(a0)) = 0w239 + hashint a0
389 :     | hash IntToReal = 0w241
390 :     | hash (RealToInt(a0)) = 0w251 + hashint a0
391 :     | hash (VoxelAddress(a0,a1)) = 0w257 + ImageInfo.hash a0 + hashint a1
392 :     | hash (VoxelAddressWithCtl(a0,a1,a2)) = 0w263 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2
393 :     | hash (LoadVoxels(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1
394 :     | hash (PosToImgSpace(a0)) = 0w271 + ImageInfo.hash a0
395 :     | hash (TensorToWorldSpace(a0,a1)) = 0w277 + ImageInfo.hash a0 + hashty a1
396 :     | hash (EvalKernel(a0,a1,a2)) = 0w281 + hashint a0 + Kernel.hash a1 + hashint a2
397 :     | hash (Inside(a0,a1)) = 0w283 + ImageInfo.hash a0 + hashint a1
398 :     | hash (ImageDim(a0,a1)) = 0w293 + ImageInfo.hash a0 + hashint a1
399 :     | hash (LoadSeq(a0,a1)) = 0w307 + hashty a0 + hashstring a1
400 :     | hash (LoadImage(a0,a1)) = 0w311 + hashty a0 + hashstring a1
401 :     | hash (Input(a0)) = 0w313 + hashinput a0
402 :     | hash (InputWithDefault(a0)) = 0w317 + hashinput a0
403 :     | hash (Print(a0)) = 0w331 + hashtys a0
404 : jhr 287
405 :     fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]
406 :     | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]
407 :     | toString (Mul(a0)) = concat["Mul<", tyToString a0, ">"]
408 :     | toString (Div(a0)) = concat["Div<", tyToString a0, ">"]
409 : jhr 3280 | toString Mod = "Mod"
410 : jhr 287 | toString (Neg(a0)) = concat["Neg<", tyToString a0, ">"]
411 : jhr 1116 | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
412 : jhr 287 | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
413 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
414 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
415 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
416 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
417 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
418 : jhr 333 | toString Not = "Not"
419 :     | toString Max = "Max"
420 :     | toString Min = "Min"
421 : jhr 1295 | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
422 : jhr 1116 | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
423 : jhr 349 | toString (Dot(a0)) = concat["Dot<", intToString a0, ">"]
424 : jhr 1116 | toString (MulVecMat(a0,a1)) = concat["MulVecMat<", intToString a0, ",", intToString a1, ">"]
425 :     | toString (MulMatVec(a0,a1)) = concat["MulMatVec<", intToString a0, ",", intToString a1, ">"]
426 :     | toString (MulMatMat(a0,a1,a2)) = concat["MulMatMat<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
427 : jhr 1939 | toString (MulVecTen3(a0,a1,a2)) = concat["MulVecTen3<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
428 :     | toString (MulTen3Vec(a0,a1,a2)) = concat["MulTen3Vec<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
429 : jhr 1945 | toString (ColonMul(a0,a1)) = concat["ColonMul<", tyToString a0, ",", tyToString a1, ">"]
430 : jhr 287 | toString Cross = "Cross"
431 : jhr 1116 | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]
432 :     | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]
433 :     | toString (Scale(a0)) = concat["Scale<", tyToString a0, ">"]
434 : jhr 287 | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]
435 : jhr 1640 | toString EigenVecs2x2 = "EigenVecs2x2"
436 :     | toString EigenVecs3x3 = "EigenVecs3x3"
437 :     | toString EigenVals2x2 = "EigenVals2x2"
438 :     | toString EigenVals3x3 = "EigenVals3x3"
439 : jhr 1116 | toString (Identity(a0)) = concat["Identity<", intToString a0, ">"]
440 :     | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
441 :     | toString (Trace(a0)) = concat["Trace<", intToString a0, ">"]
442 : jhr 2331 | toString (Transpose(a0,a1)) = concat["Transpose<", intToString a0, ",", intToString a1, ">"]
443 : jhr 2822 | toString (Slice(a0,a1)) = concat["Slice<", tyToString a0, ",", maskToString a1, ">"]
444 : jhr 1640 | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
445 :     | toString (Index(a0,a1)) = concat["Index<", tyToString a0, ",", intToString a1, ">"]
446 : jhr 287 | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
447 : jhr 1689 | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
448 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
449 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
450 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
451 : jhr 1925 | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
452 : jhr 1116 | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
453 : jhr 333 | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
454 : jhr 1116 | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
455 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
456 : jhr 287 | toString IntToReal = "IntToReal"
457 : jhr 1116 | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
458 :     | toString (VoxelAddress(a0,a1)) = concat["VoxelAddress<", ImageInfo.toString a0, ",", intToString a1, ">"]
459 : jhr 3080 | toString (VoxelAddressWithCtl(a0,a1,a2)) = concat["VoxelAddressWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]
460 : jhr 1116 | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
461 : jhr 450 | toString (PosToImgSpace(a0)) = concat["PosToImgSpace<", ImageInfo.toString a0, ">"]
462 : jhr 1116 | toString (TensorToWorldSpace(a0,a1)) = concat["TensorToWorldSpace<", ImageInfo.toString a0, ",", tyToString a1, ">"]
463 : jhr 332 | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]
464 : jhr 1116 | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
465 : jhr 2962 | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
466 : jhr 2027 | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
467 : jhr 2796 | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
468 : jhr 2011 | toString (Input(a0)) = concat["Input<", inputToString a0, ">"]
469 : jhr 2813 | toString (InputWithDefault(a0)) = concat["InputWithDefault<", inputToString a0, ">"]
470 : jhr 1640 | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
471 : jhr 287
472 :     end
473 :    
474 : jhr 392 structure MidIL = SSAFn(
475 : jhr 1232 val ilName = "mid-il"
476 : jhr 392 structure Ty = MidILTypes
477 :     structure Op = MidOps)
478 : jhr 1116
479 :     structure MidILCensus = CensusFn(MidIL)
480 :    

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