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

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