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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3797 - (view) (download)

1 : jhr 3480 (* mid-ir.sml
2 :     *
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 :     * Middle-level version of the Diderot CFG IR
9 :     *
10 :     * Note: this file is generated from gen/ir/mid-ir.spec and gen/ir/mid-ir.in.
11 :     *)
12 :    
13 :     structure MidOps =
14 :     struct
15 :    
16 :     (* required helper functions for types *)
17 :     type ty = MidTypes.ty
18 :     val samety = MidTypes.same
19 :     val hashty = MidTypes.hash
20 :     val tyToString = MidTypes.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 3797 (* required helper functions for the shape type *)
39 :     type shape = TensorShape.t
40 :     val sameshape = TensorShape.same
41 :     val hashshape = TensorShape.hash
42 :     val shapeToString = TensorShape.toString
43 : jhr 3480
44 :     (* 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 :     | LT of ty
58 :     | LTE of ty
59 :     | EQ of ty
60 :     | NEQ of ty
61 :     | GT of ty
62 :     | GTE of ty
63 :     | Not
64 : jhr 3483 | Abs of ty
65 :     | Max of ty
66 :     | Min of ty
67 : jhr 3480 | Clamp of ty
68 :     | Lerp of ty
69 : jhr 3797 | TensorIndex of ty * shape
70 : jhr 3480 | EigenVecs2x2
71 :     | EigenVecs3x3
72 :     | EigenVals2x2
73 :     | EigenVals3x3
74 :     | Zero of ty
75 :     | Select of ty * int
76 :     | Subscript of ty
77 :     | MkDynamic of ty * int
78 :     | Append of ty
79 :     | Prepend of ty
80 :     | Concat of ty
81 : jhr 3508 | Range
82 : jhr 3480 | Length of ty
83 : jhr 3529 | SphereQuery of ty * ty
84 : jhr 3480 | Ceiling of int
85 :     | Floor of int
86 :     | Round of int
87 :     | Trunc of int
88 :     | IntToReal
89 :     | RealToInt of int
90 : jhr 3529 | R_All of ty
91 :     | R_Exists of ty
92 :     | R_Max of ty
93 :     | R_Min of ty
94 :     | R_Sum of ty
95 :     | R_Product of ty
96 :     | R_Mean of ty
97 :     | R_Variance of ty
98 : jhr 3732 | BuildPos of int
99 :     | EvalKernel of int * Kernel.kernel * int
100 : jhr 3480 | Kernel of Kernel.kernel * int
101 :     | Transform of ImageInfo.info
102 :     | Translate of ImageInfo.info
103 :     | LoadVoxels of ImageInfo.info * int
104 : jhr 3774 | LoadVoxelsWithCtl of ImageInfo.info * int * idxctl
105 : jhr 3480 | Inside of ImageInfo.info * int
106 :     | ImageDim of ImageInfo.info * int
107 : jhr 3725 | BorderCtlDefault of ImageInfo.info
108 :     | BorderCtlClamp of ImageInfo.info
109 :     | BorderCtlMirror of ImageInfo.info
110 :     | BorderCtlWrap of ImageInfo.info
111 : jhr 3480 | LoadSeq of ty * string
112 :     | LoadImage of ty * string
113 :     | Print of tys
114 : jhr 3582 | MathFn of MathFns.t
115 : jhr 3480
116 :     fun resultArity IAdd = 1
117 :     | resultArity ISub = 1
118 :     | resultArity IMul = 1
119 :     | resultArity IDiv = 1
120 :     | resultArity IMod = 1
121 :     | resultArity INeg = 1
122 :     | resultArity (LT _) = 1
123 :     | resultArity (LTE _) = 1
124 :     | resultArity (EQ _) = 1
125 :     | resultArity (NEQ _) = 1
126 :     | resultArity (GT _) = 1
127 :     | resultArity (GTE _) = 1
128 :     | resultArity Not = 1
129 : jhr 3483 | resultArity (Abs _) = 1
130 :     | resultArity (Max _) = 1
131 :     | resultArity (Min _) = 1
132 : jhr 3480 | resultArity (Clamp _) = 1
133 :     | resultArity (Lerp _) = 1
134 : jhr 3797 | resultArity (TensorIndex _) = 1
135 : jhr 3480 | resultArity EigenVecs2x2 = 1
136 :     | resultArity EigenVecs3x3 = 1
137 :     | resultArity EigenVals2x2 = 1
138 :     | resultArity EigenVals3x3 = 1
139 :     | resultArity (Zero _) = 1
140 :     | resultArity (Select _) = 1
141 :     | resultArity (Subscript _) = 1
142 :     | resultArity (MkDynamic _) = 1
143 :     | resultArity (Append _) = 2
144 :     | resultArity (Prepend _) = 2
145 :     | resultArity (Concat _) = 2
146 : jhr 3508 | resultArity Range = 2
147 : jhr 3480 | resultArity (Length _) = 1
148 : jhr 3529 | resultArity (SphereQuery _) = 1
149 : jhr 3480 | resultArity (Ceiling _) = 1
150 :     | resultArity (Floor _) = 1
151 :     | resultArity (Round _) = 1
152 :     | resultArity (Trunc _) = 1
153 :     | resultArity IntToReal = 1
154 :     | resultArity (RealToInt _) = 1
155 : jhr 3529 | resultArity (R_All _) = 1
156 :     | resultArity (R_Exists _) = 1
157 :     | resultArity (R_Max _) = 1
158 :     | resultArity (R_Min _) = 1
159 :     | resultArity (R_Sum _) = 1
160 :     | resultArity (R_Product _) = 1
161 :     | resultArity (R_Mean _) = 1
162 :     | resultArity (R_Variance _) = 1
163 : jhr 3732 | resultArity (BuildPos _) = 1
164 :     | resultArity (EvalKernel _) = 1
165 : jhr 3480 | resultArity (Kernel _) = 1
166 :     | resultArity (Transform _) = 1
167 :     | resultArity (Translate _) = 1
168 :     | resultArity (LoadVoxels _) = 1
169 : jhr 3774 | resultArity (LoadVoxelsWithCtl _) = 1
170 : jhr 3480 | resultArity (Inside _) = 1
171 :     | resultArity (ImageDim _) = 1
172 : jhr 3725 | resultArity (BorderCtlDefault _) = 1
173 :     | resultArity (BorderCtlClamp _) = 1
174 :     | resultArity (BorderCtlMirror _) = 1
175 :     | resultArity (BorderCtlWrap _) = 1
176 : jhr 3480 | resultArity (LoadSeq _) = 1
177 :     | resultArity (LoadImage _) = 1
178 :     | resultArity (Print _) = 0
179 : jhr 3582 | resultArity (MathFn _) = 1
180 : jhr 3480
181 :     fun arity IAdd = 2
182 :     | arity ISub = 2
183 :     | arity IMul = 2
184 :     | arity IDiv = 2
185 :     | arity IMod = 2
186 :     | arity INeg = 1
187 :     | arity (LT _) = 2
188 :     | arity (LTE _) = 2
189 :     | arity (EQ _) = 2
190 :     | arity (NEQ _) = 2
191 :     | arity (GT _) = 2
192 :     | arity (GTE _) = 2
193 :     | arity Not = 1
194 : jhr 3483 | arity (Abs _) = 1
195 :     | arity (Max _) = 2
196 :     | arity (Min _) = 2
197 : jhr 3480 | arity (Clamp _) = 3
198 :     | arity (Lerp _) = 3
199 : jhr 3797 | arity (TensorIndex _) = 1
200 : jhr 3480 | arity EigenVecs2x2 = 1
201 :     | arity EigenVecs3x3 = 1
202 :     | arity EigenVals2x2 = 1
203 :     | arity EigenVals3x3 = 1
204 :     | arity (Zero _) = 0
205 :     | arity (Select _) = 1
206 :     | arity (Subscript _) = 2
207 :     | arity (MkDynamic _) = 1
208 :     | arity (Append _) = 1
209 :     | arity (Prepend _) = 1
210 :     | arity (Concat _) = 1
211 : jhr 3508 | arity Range = 1
212 : jhr 3480 | arity (Length _) = 1
213 : jhr 3529 | arity (SphereQuery _) = 2
214 : jhr 3480 | arity (Ceiling _) = 1
215 :     | arity (Floor _) = 1
216 :     | arity (Round _) = 1
217 :     | arity (Trunc _) = 1
218 :     | arity IntToReal = 1
219 :     | arity (RealToInt _) = 1
220 : jhr 3529 | arity (R_All _) = 3
221 :     | arity (R_Exists _) = 3
222 :     | arity (R_Max _) = 3
223 :     | arity (R_Min _) = 3
224 :     | arity (R_Sum _) = 3
225 :     | arity (R_Product _) = 3
226 :     | arity (R_Mean _) = 3
227 :     | arity (R_Variance _) = 4
228 : jhr 3732 | arity (BuildPos _) = 1
229 :     | arity (EvalKernel _) = 1
230 : jhr 3480 | arity (Kernel _) = 0
231 :     | arity (Transform _) = 1
232 :     | arity (Translate _) = 1
233 : jhr 3774 | arity (LoadVoxels _) = 2
234 :     | arity (LoadVoxelsWithCtl _) = 2
235 : jhr 3480 | arity (Inside _) = 2
236 :     | arity (ImageDim _) = 1
237 : jhr 3725 | arity (BorderCtlDefault _) = 2
238 :     | arity (BorderCtlClamp _) = 1
239 :     | arity (BorderCtlMirror _) = 1
240 :     | arity (BorderCtlWrap _) = 1
241 : jhr 3480 | arity (LoadSeq _) = 0
242 :     | arity (LoadImage _) = 0
243 :     | arity (Print _) = ~1
244 : jhr 3582 | arity (MathFn _) = ~1
245 : jhr 3480
246 :     fun isPure (MkDynamic _) = false
247 :     | isPure (Append _) = false
248 :     | isPure (Prepend _) = false
249 :     | isPure (Concat _) = false
250 :     | isPure (Print _) = false
251 :     | isPure _ = true
252 :    
253 :     fun same (IAdd, IAdd) = true
254 :     | same (ISub, ISub) = true
255 :     | same (IMul, IMul) = true
256 :     | same (IDiv, IDiv) = true
257 :     | same (IMod, IMod) = true
258 :     | same (INeg, INeg) = true
259 :     | same (LT(a0), LT(b0)) = samety(a0, b0)
260 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
261 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
262 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
263 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
264 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
265 :     | same (Not, Not) = true
266 : jhr 3483 | same (Abs(a0), Abs(b0)) = samety(a0, b0)
267 :     | same (Max(a0), Max(b0)) = samety(a0, b0)
268 :     | same (Min(a0), Min(b0)) = samety(a0, b0)
269 : jhr 3480 | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
270 :     | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
271 : jhr 3797 | same (TensorIndex(a0,a1), TensorIndex(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
272 : jhr 3480 | same (EigenVecs2x2, EigenVecs2x2) = true
273 :     | same (EigenVecs3x3, EigenVecs3x3) = true
274 :     | same (EigenVals2x2, EigenVals2x2) = true
275 :     | same (EigenVals3x3, EigenVals3x3) = true
276 :     | same (Zero(a0), Zero(b0)) = samety(a0, b0)
277 :     | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
278 :     | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
279 :     | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
280 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
281 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
282 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
283 : jhr 3508 | same (Range, Range) = true
284 : jhr 3480 | same (Length(a0), Length(b0)) = samety(a0, b0)
285 : jhr 3529 | same (SphereQuery(a0,a1), SphereQuery(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
286 : jhr 3480 | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
287 :     | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
288 :     | same (Round(a0), Round(b0)) = sameint(a0, b0)
289 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
290 :     | same (IntToReal, IntToReal) = true
291 :     | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
292 : jhr 3529 | same (R_All(a0), R_All(b0)) = samety(a0, b0)
293 :     | same (R_Exists(a0), R_Exists(b0)) = samety(a0, b0)
294 :     | same (R_Max(a0), R_Max(b0)) = samety(a0, b0)
295 :     | same (R_Min(a0), R_Min(b0)) = samety(a0, b0)
296 :     | same (R_Sum(a0), R_Sum(b0)) = samety(a0, b0)
297 :     | same (R_Product(a0), R_Product(b0)) = samety(a0, b0)
298 :     | same (R_Mean(a0), R_Mean(b0)) = samety(a0, b0)
299 :     | same (R_Variance(a0), R_Variance(b0)) = samety(a0, b0)
300 : jhr 3732 | same (BuildPos(a0), BuildPos(b0)) = sameint(a0, b0)
301 :     | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)
302 : jhr 3480 | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)
303 :     | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
304 :     | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
305 :     | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
306 : jhr 3774 | same (LoadVoxelsWithCtl(a0,a1,a2), LoadVoxelsWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)
307 : jhr 3480 | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
308 :     | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
309 : jhr 3725 | same (BorderCtlDefault(a0), BorderCtlDefault(b0)) = ImageInfo.same(a0, b0)
310 :     | same (BorderCtlClamp(a0), BorderCtlClamp(b0)) = ImageInfo.same(a0, b0)
311 :     | same (BorderCtlMirror(a0), BorderCtlMirror(b0)) = ImageInfo.same(a0, b0)
312 :     | same (BorderCtlWrap(a0), BorderCtlWrap(b0)) = ImageInfo.same(a0, b0)
313 : jhr 3480 | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
314 :     | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
315 :     | same (Print(a0), Print(b0)) = sametys(a0, b0)
316 : jhr 3582 | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
317 : jhr 3480 | same _ = false
318 :    
319 :     fun hash IAdd = 0w3
320 :     | hash ISub = 0w5
321 :     | hash IMul = 0w7
322 :     | hash IDiv = 0w11
323 :     | hash IMod = 0w13
324 :     | hash INeg = 0w17
325 : jhr 3483 | hash (LT(a0)) = 0w19 + hashty a0
326 :     | hash (LTE(a0)) = 0w23 + hashty a0
327 :     | hash (EQ(a0)) = 0w29 + hashty a0
328 :     | hash (NEQ(a0)) = 0w31 + hashty a0
329 :     | hash (GT(a0)) = 0w37 + hashty a0
330 :     | hash (GTE(a0)) = 0w41 + hashty a0
331 :     | hash Not = 0w43
332 :     | hash (Abs(a0)) = 0w47 + hashty a0
333 :     | hash (Max(a0)) = 0w53 + hashty a0
334 :     | hash (Min(a0)) = 0w59 + hashty a0
335 : jhr 3480 | hash (Clamp(a0)) = 0w61 + hashty a0
336 :     | hash (Lerp(a0)) = 0w67 + hashty a0
337 : jhr 3797 | hash (TensorIndex(a0,a1)) = 0w71 + hashty a0 + hashshape a1
338 :     | hash EigenVecs2x2 = 0w73
339 :     | hash EigenVecs3x3 = 0w79
340 :     | hash EigenVals2x2 = 0w83
341 :     | hash EigenVals3x3 = 0w89
342 :     | hash (Zero(a0)) = 0w97 + hashty a0
343 :     | hash (Select(a0,a1)) = 0w101 + hashty a0 + hashint a1
344 : jhr 3628 | hash (Subscript(a0)) = 0w103 + hashty a0
345 :     | hash (MkDynamic(a0,a1)) = 0w107 + hashty a0 + hashint a1
346 :     | hash (Append(a0)) = 0w109 + hashty a0
347 :     | hash (Prepend(a0)) = 0w113 + hashty a0
348 :     | hash (Concat(a0)) = 0w127 + hashty a0
349 :     | hash Range = 0w131
350 :     | hash (Length(a0)) = 0w137 + hashty a0
351 :     | hash (SphereQuery(a0,a1)) = 0w139 + hashty a0 + hashty a1
352 :     | hash (Ceiling(a0)) = 0w149 + hashint a0
353 :     | hash (Floor(a0)) = 0w151 + hashint a0
354 :     | hash (Round(a0)) = 0w157 + hashint a0
355 :     | hash (Trunc(a0)) = 0w163 + hashint a0
356 :     | hash IntToReal = 0w167
357 :     | hash (RealToInt(a0)) = 0w173 + hashint a0
358 :     | hash (R_All(a0)) = 0w179 + hashty a0
359 :     | hash (R_Exists(a0)) = 0w181 + hashty a0
360 :     | hash (R_Max(a0)) = 0w191 + hashty a0
361 :     | hash (R_Min(a0)) = 0w193 + hashty a0
362 :     | hash (R_Sum(a0)) = 0w197 + hashty a0
363 :     | hash (R_Product(a0)) = 0w199 + hashty a0
364 :     | hash (R_Mean(a0)) = 0w211 + hashty a0
365 :     | hash (R_Variance(a0)) = 0w223 + hashty a0
366 : jhr 3732 | hash (BuildPos(a0)) = 0w227 + hashint a0
367 :     | hash (EvalKernel(a0,a1,a2)) = 0w229 + hashint a0 + Kernel.hash a1 + hashint a2
368 :     | hash (Kernel(a0,a1)) = 0w233 + Kernel.hash a0 + hashint a1
369 :     | hash (Transform(a0)) = 0w239 + ImageInfo.hash a0
370 :     | hash (Translate(a0)) = 0w241 + ImageInfo.hash a0
371 : jhr 3774 | hash (LoadVoxels(a0,a1)) = 0w251 + ImageInfo.hash a0 + hashint a1
372 :     | hash (LoadVoxelsWithCtl(a0,a1,a2)) = 0w257 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2
373 :     | hash (Inside(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1
374 :     | hash (ImageDim(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1
375 :     | hash (BorderCtlDefault(a0)) = 0w271 + ImageInfo.hash a0
376 :     | hash (BorderCtlClamp(a0)) = 0w277 + ImageInfo.hash a0
377 :     | hash (BorderCtlMirror(a0)) = 0w281 + ImageInfo.hash a0
378 :     | hash (BorderCtlWrap(a0)) = 0w283 + ImageInfo.hash a0
379 :     | hash (LoadSeq(a0,a1)) = 0w293 + hashty a0 + hashstring a1
380 :     | hash (LoadImage(a0,a1)) = 0w307 + hashty a0 + hashstring a1
381 :     | hash (Print(a0)) = 0w311 + hashtys a0
382 :     | hash (MathFn(a0)) = 0w313 + MathFns.hash a0
383 : jhr 3480
384 :     fun toString IAdd = "IAdd"
385 :     | toString ISub = "ISub"
386 :     | toString IMul = "IMul"
387 :     | toString IDiv = "IDiv"
388 :     | toString IMod = "IMod"
389 :     | toString INeg = "INeg"
390 :     | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
391 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
392 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
393 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
394 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
395 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
396 :     | toString Not = "Not"
397 : jhr 3483 | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
398 :     | toString (Max(a0)) = concat["Max<", tyToString a0, ">"]
399 :     | toString (Min(a0)) = concat["Min<", tyToString a0, ">"]
400 : jhr 3480 | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
401 :     | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
402 : jhr 3797 | toString (TensorIndex(a0,a1)) = concat["TensorIndex<", tyToString a0, ",", shapeToString a1, ">"]
403 : jhr 3480 | toString EigenVecs2x2 = "EigenVecs2x2"
404 :     | toString EigenVecs3x3 = "EigenVecs3x3"
405 :     | toString EigenVals2x2 = "EigenVals2x2"
406 :     | toString EigenVals3x3 = "EigenVals3x3"
407 :     | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
408 :     | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
409 :     | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
410 :     | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
411 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
412 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
413 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
414 : jhr 3508 | toString Range = "Range"
415 : jhr 3480 | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
416 : jhr 3529 | toString (SphereQuery(a0,a1)) = concat["SphereQuery<", tyToString a0, ",", tyToString a1, ">"]
417 : jhr 3480 | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
418 :     | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
419 :     | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
420 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
421 :     | toString IntToReal = "IntToReal"
422 :     | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
423 : jhr 3529 | toString (R_All(a0)) = concat["R_All<", tyToString a0, ">"]
424 :     | toString (R_Exists(a0)) = concat["R_Exists<", tyToString a0, ">"]
425 :     | toString (R_Max(a0)) = concat["R_Max<", tyToString a0, ">"]
426 :     | toString (R_Min(a0)) = concat["R_Min<", tyToString a0, ">"]
427 :     | toString (R_Sum(a0)) = concat["R_Sum<", tyToString a0, ">"]
428 :     | toString (R_Product(a0)) = concat["R_Product<", tyToString a0, ">"]
429 :     | toString (R_Mean(a0)) = concat["R_Mean<", tyToString a0, ">"]
430 :     | toString (R_Variance(a0)) = concat["R_Variance<", tyToString a0, ">"]
431 : jhr 3732 | toString (BuildPos(a0)) = concat["BuildPos<", intToString a0, ">"]
432 :     | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]
433 : jhr 3480 | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]
434 :     | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
435 :     | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
436 :     | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
437 : jhr 3774 | toString (LoadVoxelsWithCtl(a0,a1,a2)) = concat["LoadVoxelsWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]
438 : jhr 3480 | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
439 :     | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
440 : jhr 3725 | toString (BorderCtlDefault(a0)) = concat["BorderCtlDefault<", ImageInfo.toString a0, ">"]
441 :     | toString (BorderCtlClamp(a0)) = concat["BorderCtlClamp<", ImageInfo.toString a0, ">"]
442 :     | toString (BorderCtlMirror(a0)) = concat["BorderCtlMirror<", ImageInfo.toString a0, ">"]
443 :     | toString (BorderCtlWrap(a0)) = concat["BorderCtlWrap<", ImageInfo.toString a0, ">"]
444 : jhr 3480 | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
445 :     | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
446 :     | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
447 : jhr 3582 | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
448 : jhr 3480
449 :     end
450 :    
451 :     structure MidIR = SSAFn(
452 : jhr 3508 val irName = "mid-ir"
453 : jhr 3480 structure Ty = MidTypes
454 :     structure Op = MidOps)
455 :    
456 :     structure MidCensus = CensusFn(MidIR)

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