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

SCM Repository

[diderot] Annotation of /branches/charisee/src/compiler/low-il/low-il.sml
ViewVC logotype

Annotation of /branches/charisee/src/compiler/low-il/low-il.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2615 - (view) (download)

1 : jhr 458 (* low-il.in
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * Lower-level version of the Diderot IL input file.
7 :     *
8 :     *)
9 :    
10 :     structure LowOps =
11 :     struct
12 :    
13 : jhr 1640 (* required helper functions for types *)
14 : jhr 458 type ty = LowILTypes.ty
15 :     val samety = LowILTypes.same
16 :     val hashty = LowILTypes.hash
17 :     val tyToString = LowILTypes.toString
18 :    
19 : jhr 1640 (* required helper functions for type lists *)
20 :     type tys = ty list
21 :     fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
22 :     fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
23 :     fun tysToString tys = String.concat["[", String.concatWith "," (List.map tyToString tys), "]" ]
24 :    
25 :     (* required helper functions for the int type *)
26 : jhr 458 fun sameint (i1 : int, i2) = (i1 = i2)
27 : cchiw 2615 fun samereal (i1, i2) = sameint(Real.floor i1,Real.floor i2)
28 : jhr 458 fun hashint i = Word.fromInt i
29 : cchiw 2615 fun hashreal i = Word.fromInt(Real.floor i)
30 : jhr 458 fun intToString i = Int.toString i
31 : cchiw 2615 fun realToString i = Int.toString(Real.floor (i))
32 :    
33 : jhr 1640 (* required helper functions for the string type *)
34 : jhr 458 fun samestring (s1 : string, s2) = (s1 = s2)
35 :     val hashstring = HashString.hashString
36 :     fun stringToString s = String.concat["\"", s, "\""]
37 :    
38 :     datatype rator
39 : cchiw 2523 = IAdd
40 :     | ISub
41 :     | IMul
42 :     | IDiv
43 :     | INeg
44 : jhr 1116 | Abs of ty
45 : jhr 458 | LT of ty
46 :     | LTE of ty
47 :     | EQ of ty
48 :     | NEQ of ty
49 :     | GT of ty
50 :     | GTE of ty
51 :     | Not
52 :     | Max
53 :     | Min
54 : cchiw 2553 | CR of real
55 : cchiw 2523 | C of int
56 : cchiw 2525 | V of int * int * ty * ty
57 :     | S of int * ty * ty
58 : cchiw 2523 | addSca
59 :     | subSca
60 :     | prodSca
61 :     | divSca
62 : cchiw 2533 | cons of ty * int
63 :     | imgAddr of ImageInfo.info * ty * int
64 :     | imgLoad of ImageInfo.info * int * int
65 : cchiw 2525 | addVec of int
66 :     | subVec of int
67 :     | prodVec of int
68 :     | prodScaV of int
69 :     | sumVec of int
70 : jhr 1295 | Clamp of ty
71 : jhr 1116 | Lerp of ty
72 :     | Norm of ty
73 :     | Normalize of int
74 : jhr 458 | PrincipleEvec of ty
75 : jhr 1640 | EigenVecs2x2
76 :     | EigenVecs3x3
77 :     | EigenVals2x2
78 :     | EigenVals3x3
79 : jhr 1116 | Zero of ty
80 : jhr 1640 | Select of ty * int
81 :     | Index of ty * int
82 : jhr 458 | Subscript of ty
83 : cchiw 2400 | MkDynamic of ty * int
84 :     | Append of ty
85 :     | Prepend of ty
86 :     | Concat of ty
87 :     | Length of ty
88 : jhr 1116 | Ceiling of int
89 : jhr 458 | Floor of int
90 : jhr 1116 | Round of int
91 :     | Trunc of int
92 : jhr 458 | IntToReal
93 : jhr 1116 | RealToInt of int
94 : cchiw 2523 | Transform of ImageInfo.info
95 :     | Translate of ImageInfo.info
96 : cchiw 2525 | Kernel of Kernel.kernel * int
97 : jhr 511 | ImageAddress of ImageInfo.info
98 : jhr 1116 | LoadVoxels of ImageInfo.info * int
99 :     | Inside of ImageInfo.info * int
100 : cchiw 2400 | LoadSeq of ty * string
101 : cchiw 2525 | LoadImage of ImageInfo.info
102 :     | Input of ty * string * string
103 :     | InputWithDefault of ty * string * string
104 : jhr 1640 | Print of tys
105 : jhr 458
106 : cchiw 2523 fun resultArity IAdd = 1
107 :     | resultArity ISub = 1
108 :     | resultArity IMul = 1
109 :     | resultArity IDiv = 1
110 :     | resultArity INeg = 1
111 : jhr 1640 | resultArity (Abs _) = 1
112 :     | resultArity (LT _) = 1
113 :     | resultArity (LTE _) = 1
114 :     | resultArity (EQ _) = 1
115 :     | resultArity (NEQ _) = 1
116 :     | resultArity (GT _) = 1
117 :     | resultArity (GTE _) = 1
118 :     | resultArity Not = 1
119 :     | resultArity Max = 1
120 :     | resultArity Min = 1
121 : cchiw 2615 | resultArity (CR _) = 1
122 : cchiw 2523 | resultArity (C _) = 1
123 :     | resultArity (V _) = 1
124 :     | resultArity (S _) = 1
125 :     | resultArity addSca = 1
126 :     | resultArity subSca = 1
127 :     | resultArity prodSca = 1
128 :     | resultArity divSca = 1
129 :     | resultArity (cons _) = 1
130 : cchiw 2529 | resultArity (imgAddr _) = 1
131 :     | resultArity (imgLoad _) = 1
132 : cchiw 2525 | resultArity (addVec _) = 1
133 :     | resultArity (subVec _) = 1
134 :     | resultArity (prodVec _) = 1
135 :     | resultArity (prodScaV _) = 1
136 :     | resultArity (sumVec _) = 1
137 : jhr 1640 | resultArity (Clamp _) = 1
138 :     | resultArity (Lerp _) = 1
139 :     | resultArity (Norm _) = 1
140 :     | resultArity (Normalize _) = 1
141 :     | resultArity (PrincipleEvec _) = 1
142 :     | resultArity EigenVecs2x2 = 1
143 :     | resultArity EigenVecs3x3 = 1
144 :     | resultArity EigenVals2x2 = 1
145 :     | resultArity EigenVals3x3 = 1
146 :     | resultArity (Zero _) = 1
147 :     | resultArity (Select _) = 1
148 :     | resultArity (Index _) = 1
149 :     | resultArity (Subscript _) = 1
150 : cchiw 2400 | resultArity (MkDynamic _) = 1
151 :     | resultArity (Append _) = 2
152 :     | resultArity (Prepend _) = 2
153 :     | resultArity (Concat _) = 2
154 :     | resultArity (Length _) = 1
155 : jhr 1640 | resultArity (Ceiling _) = 1
156 :     | resultArity (Floor _) = 1
157 :     | resultArity (Round _) = 1
158 :     | resultArity (Trunc _) = 1
159 :     | resultArity IntToReal = 1
160 :     | resultArity (RealToInt _) = 1
161 : cchiw 2523 | resultArity (Transform _) = 1
162 :     | resultArity (Translate _) = 1
163 : cchiw 2525 | resultArity (Kernel _) = 1
164 : jhr 1640 | resultArity (ImageAddress _) = 1
165 :     | resultArity (LoadVoxels _) = 1
166 : cchiw 2400 | resultArity (Inside _) = 1
167 :     | resultArity (LoadSeq _) = 1
168 : jhr 1640 | resultArity (LoadImage _) = 1
169 : cchiw 2525 | resultArity (Input _) = 1
170 :     | resultArity (InputWithDefault _) = 1
171 : jhr 1640 | resultArity (Print _) = 0
172 :    
173 : cchiw 2523 fun arity IAdd = 2
174 :     | arity ISub = 2
175 :     | arity IMul = 2
176 :     | arity IDiv = 2
177 :     | arity INeg = 1
178 : jhr 1116 | arity (Abs _) = 1
179 : jhr 458 | arity (LT _) = 2
180 :     | arity (LTE _) = 2
181 :     | arity (EQ _) = 2
182 :     | arity (NEQ _) = 2
183 :     | arity (GT _) = 2
184 :     | arity (GTE _) = 2
185 :     | arity Not = 1
186 :     | arity Max = 2
187 :     | arity Min = 2
188 : cchiw 2615 | arity (CR _) = 2
189 : cchiw 2523 | arity (C _) = 2
190 :     | arity (V _) = 2
191 :     | arity (S _) = 2
192 :     | arity addSca = 2
193 :     | arity subSca = 2
194 :     | arity prodSca = 2
195 :     | arity divSca = 2
196 :     | arity (cons _) = 2
197 : cchiw 2529 | arity (imgAddr _) = 2
198 :     | arity (imgLoad _) = 2
199 : cchiw 2525 | arity (addVec _) = 2
200 :     | arity (subVec _) = 2
201 :     | arity (prodVec _) = 2
202 :     | arity (prodScaV _) = 2
203 :     | arity (sumVec _) = 2
204 : jhr 1295 | arity (Clamp _) = 3
205 : jhr 1116 | arity (Lerp _) = 3
206 : jhr 458 | arity (Norm _) = 1
207 : jhr 1116 | arity (Normalize _) = 1
208 : jhr 458 | arity (PrincipleEvec _) = 2
209 : jhr 1640 | arity EigenVecs2x2 = 1
210 :     | arity EigenVecs3x3 = 1
211 :     | arity EigenVals2x2 = 1
212 :     | arity EigenVals3x3 = 1
213 : jhr 1116 | arity (Zero _) = 0
214 : jhr 1640 | arity (Select _) = 1
215 :     | arity (Index _) = 1
216 : jhr 458 | arity (Subscript _) = 2
217 : cchiw 2400 | arity (MkDynamic _) = 1
218 :     | arity (Append _) = 1
219 :     | arity (Prepend _) = 1
220 :     | arity (Concat _) = 1
221 :     | arity (Length _) = 1
222 : jhr 1116 | arity (Ceiling _) = 1
223 : jhr 458 | arity (Floor _) = 1
224 : jhr 1116 | arity (Round _) = 1
225 :     | arity (Trunc _) = 1
226 : jhr 458 | arity IntToReal = 1
227 : jhr 1116 | arity (RealToInt _) = 1
228 : cchiw 2523 | arity (Transform _) = 2
229 :     | arity (Translate _) = 2
230 : cchiw 2525 | arity (Kernel _) = 0
231 : jhr 1116 | arity (ImageAddress _) = 1
232 : jhr 458 | arity (LoadVoxels _) = 1
233 : jhr 1116 | arity (Inside _) = 2
234 : cchiw 2400 | arity (LoadSeq _) = 0
235 :     | arity (LoadImage _) = 0
236 : cchiw 2525 | arity (Input _) = 0
237 :     | arity (InputWithDefault _) = 1
238 : jhr 1640 | arity (Print _) = ~1
239 : jhr 458
240 : cchiw 2400 fun isPure (MkDynamic _) = false
241 :     | isPure (Append _) = false
242 :     | isPure (Prepend _) = false
243 :     | isPure (Concat _) = false
244 :     | isPure (Print _) = false
245 : jhr 2356 | isPure _ = true
246 :    
247 : cchiw 2522 fun same (IAdd, IAdd) = true
248 :     | same (ISub, ISub) = true
249 :     | same (IMul, IMul) = true
250 :     | same (IDiv, IDiv) = true
251 :     | same (INeg, INeg) = true
252 : jhr 1116 | same (Abs(a0), Abs(b0)) = samety(a0, b0)
253 : jhr 458 | same (LT(a0), LT(b0)) = samety(a0, b0)
254 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
255 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
256 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
257 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
258 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
259 :     | same (Not, Not) = true
260 :     | same (Max, Max) = true
261 :     | same (Min, Min) = true
262 : cchiw 2615 | same (CR(a0), CR(b0)) = samereal(a0, b0)
263 : cchiw 2523 | same (C(a0), C(b0)) = sameint(a0, b0)
264 : cchiw 2525 | same (V(a0,a1,a2,a3), V(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)
265 :     | same (S(a0,a1,a2), S(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)
266 : cchiw 2523 | same (addSca, addSca) = true
267 :     | same (subSca, subSca) = true
268 :     | same (prodSca, prodSca) = true
269 :     | same (divSca, divSca) = true
270 : cchiw 2533 | same (cons(a0,a1), cons(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
271 :     | same (imgAddr(a0,a1,a2), imgAddr(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso samety(a1, b1) andalso sameint(a2, b2)
272 :     | same (imgLoad(a0,a1,a2), imgLoad(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
273 : cchiw 2525 | same (addVec(a0), addVec(b0)) = sameint(a0, b0)
274 :     | same (subVec(a0), subVec(b0)) = sameint(a0, b0)
275 :     | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)
276 :     | same (prodScaV(a0), prodScaV(b0)) = sameint(a0, b0)
277 :     | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)
278 : jhr 1295 | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
279 : jhr 1116 | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
280 :     | same (Norm(a0), Norm(b0)) = samety(a0, b0)
281 :     | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)
282 : jhr 458 | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)
283 : jhr 1640 | same (EigenVecs2x2, EigenVecs2x2) = true
284 :     | same (EigenVecs3x3, EigenVecs3x3) = true
285 :     | same (EigenVals2x2, EigenVals2x2) = true
286 :     | same (EigenVals3x3, EigenVals3x3) = true
287 : jhr 1116 | same (Zero(a0), Zero(b0)) = samety(a0, b0)
288 : jhr 1640 | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
289 :     | same (Index(a0,a1), Index(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
290 : jhr 458 | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
291 : cchiw 2400 | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
292 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
293 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
294 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
295 :     | same (Length(a0), Length(b0)) = samety(a0, b0)
296 : jhr 1116 | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
297 : jhr 458 | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
298 : jhr 1116 | same (Round(a0), Round(b0)) = sameint(a0, b0)
299 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
300 : jhr 458 | same (IntToReal, IntToReal) = true
301 : jhr 1116 | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
302 : cchiw 2523 | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
303 :     | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
304 : cchiw 2525 | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)
305 : jhr 511 | same (ImageAddress(a0), ImageAddress(b0)) = ImageInfo.same(a0, b0)
306 : jhr 1116 | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
307 :     | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
308 : cchiw 2400 | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
309 : cchiw 2525 | same (LoadImage(a0), LoadImage(b0)) = ImageInfo.same(a0, b0)
310 :     | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
311 :     | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
312 : jhr 1640 | same (Print(a0), Print(b0)) = sametys(a0, b0)
313 : jhr 458 | same _ = false
314 :    
315 : cchiw 2523 fun hash IAdd = 0w3
316 :     | hash ISub = 0w5
317 :     | hash IMul = 0w7
318 :     | hash IDiv = 0w11
319 :     | hash INeg = 0w13
320 : jhr 1116 | hash (Abs(a0)) = 0w17 + hashty a0
321 :     | hash (LT(a0)) = 0w19 + hashty a0
322 :     | hash (LTE(a0)) = 0w23 + hashty a0
323 :     | hash (EQ(a0)) = 0w29 + hashty a0
324 :     | hash (NEQ(a0)) = 0w31 + hashty a0
325 :     | hash (GT(a0)) = 0w37 + hashty a0
326 :     | hash (GTE(a0)) = 0w41 + hashty a0
327 :     | hash Not = 0w43
328 :     | hash Max = 0w47
329 :     | hash Min = 0w53
330 : cchiw 2615 | hash (CR(a0)) = 0w59 + hashreal a0
331 :     | hash (C(a0)) = 0w61 + hashint a0
332 :     | hash (V(a0,a1,a2,a3)) = 0w67 + hashint a0 + hashint a1 + hashty a2 + hashty a3
333 :     | hash (S(a0,a1,a2)) = 0w71 + hashint a0 + hashty a1 + hashty a2
334 :     | hash addSca = 0w73
335 :     | hash subSca = 0w79
336 :     | hash prodSca = 0w83
337 :     | hash divSca = 0w89
338 :     | hash (cons(a0,a1)) = 0w97 + hashty a0 + hashint a1
339 :     | hash (imgAddr(a0,a1,a2)) = 0w101 + ImageInfo.hash a0 + hashty a1 + hashint a2
340 :     | hash (imgLoad(a0,a1,a2)) = 0w103 + ImageInfo.hash a0 + hashint a1 + hashint a2
341 :     | hash (addVec(a0)) = 0w107 + hashint a0
342 :     | hash (subVec(a0)) = 0w109 + hashint a0
343 :     | hash (prodVec(a0)) = 0w113 + hashint a0
344 :     | hash (prodScaV(a0)) = 0w127 + hashint a0
345 :     | hash (sumVec(a0)) = 0w131 + hashint a0
346 :     | hash (Clamp(a0)) = 0w137 + hashty a0
347 :     | hash (Lerp(a0)) = 0w139 + hashty a0
348 :     | hash (Norm(a0)) = 0w149 + hashty a0
349 :     | hash (Normalize(a0)) = 0w151 + hashint a0
350 :     | hash (PrincipleEvec(a0)) = 0w157 + hashty a0
351 :     | hash EigenVecs2x2 = 0w163
352 :     | hash EigenVecs3x3 = 0w167
353 :     | hash EigenVals2x2 = 0w173
354 :     | hash EigenVals3x3 = 0w179
355 :     | hash (Zero(a0)) = 0w181 + hashty a0
356 :     | hash (Select(a0,a1)) = 0w191 + hashty a0 + hashint a1
357 :     | hash (Index(a0,a1)) = 0w193 + hashty a0 + hashint a1
358 :     | hash (Subscript(a0)) = 0w197 + hashty a0
359 :     | hash (MkDynamic(a0,a1)) = 0w199 + hashty a0 + hashint a1
360 :     | hash (Append(a0)) = 0w211 + hashty a0
361 :     | hash (Prepend(a0)) = 0w223 + hashty a0
362 :     | hash (Concat(a0)) = 0w227 + hashty a0
363 :     | hash (Length(a0)) = 0w229 + hashty a0
364 :     | hash (Ceiling(a0)) = 0w233 + hashint a0
365 :     | hash (Floor(a0)) = 0w239 + hashint a0
366 :     | hash (Round(a0)) = 0w241 + hashint a0
367 :     | hash (Trunc(a0)) = 0w251 + hashint a0
368 :     | hash IntToReal = 0w257
369 :     | hash (RealToInt(a0)) = 0w263 + hashint a0
370 :     | hash (Transform(a0)) = 0w269 + ImageInfo.hash a0
371 :     | hash (Translate(a0)) = 0w271 + ImageInfo.hash a0
372 :     | hash (Kernel(a0,a1)) = 0w277 + Kernel.hash a0 + hashint a1
373 :     | hash (ImageAddress(a0)) = 0w281 + ImageInfo.hash a0
374 :     | hash (LoadVoxels(a0,a1)) = 0w283 + ImageInfo.hash a0 + hashint a1
375 :     | hash (Inside(a0,a1)) = 0w293 + ImageInfo.hash a0 + hashint a1
376 :     | hash (LoadSeq(a0,a1)) = 0w307 + hashty a0 + hashstring a1
377 :     | hash (LoadImage(a0)) = 0w311 + ImageInfo.hash a0
378 :     | hash (Input(a0,a1,a2)) = 0w313 + hashty a0 + hashstring a1 + hashstring a2
379 :     | hash (InputWithDefault(a0,a1,a2)) = 0w317 + hashty a0 + hashstring a1 + hashstring a2
380 :     | hash (Print(a0)) = 0w331 + hashtys a0
381 : jhr 458
382 : cchiw 2523 fun toString IAdd = "IAdd"
383 :     | toString ISub = "ISub"
384 :     | toString IMul = "IMul"
385 :     | toString IDiv = "IDiv"
386 :     | toString INeg = "INeg"
387 : jhr 1116 | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
388 : jhr 458 | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
389 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
390 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
391 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
392 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
393 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
394 :     | toString Not = "Not"
395 :     | toString Max = "Max"
396 :     | toString Min = "Min"
397 : cchiw 2615 | toString (CR(a0)) = concat["CR<", realToString a0, ">"]
398 : cchiw 2523 | toString (C(a0)) = concat["C<", intToString a0, ">"]
399 : cchiw 2525 | toString (V(a0,a1,a2,a3)) = concat["V<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
400 :     | toString (S(a0,a1,a2)) = concat["S<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]
401 : cchiw 2523 | toString addSca = "addSca"
402 :     | toString subSca = "subSca"
403 :     | toString prodSca = "prodSca"
404 :     | toString divSca = "divSca"
405 : cchiw 2533 | toString (cons(a0,a1)) = concat["cons<", tyToString a0, ",", intToString a1, ">"]
406 :     | toString (imgAddr(a0,a1,a2)) = concat["imgAddr<", ImageInfo.toString a0, ",", tyToString a1, ",", intToString a2, ">"]
407 :     | toString (imgLoad(a0,a1,a2)) = concat["imgLoad<", ImageInfo.toString a0, ",", intToString a1, ",", intToString a2, ">"]
408 : cchiw 2525 | toString (addVec(a0)) = concat["addVec<", intToString a0, ">"]
409 :     | toString (subVec(a0)) = concat["subVec<", intToString a0, ">"]
410 :     | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]
411 :     | toString (prodScaV(a0)) = concat["prodScaV<", intToString a0, ">"]
412 :     | toString (sumVec(a0)) = concat["sumVec<", intToString a0, ">"]
413 : jhr 1295 | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
414 : jhr 1116 | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
415 :     | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]
416 :     | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]
417 : jhr 458 | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]
418 : jhr 1640 | toString EigenVecs2x2 = "EigenVecs2x2"
419 :     | toString EigenVecs3x3 = "EigenVecs3x3"
420 :     | toString EigenVals2x2 = "EigenVals2x2"
421 :     | toString EigenVals3x3 = "EigenVals3x3"
422 : jhr 1116 | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
423 : jhr 1640 | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
424 :     | toString (Index(a0,a1)) = concat["Index<", tyToString a0, ",", intToString a1, ">"]
425 : jhr 458 | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
426 : cchiw 2400 | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
427 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
428 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
429 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
430 :     | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
431 : jhr 1116 | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
432 : jhr 458 | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
433 : jhr 1116 | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
434 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
435 : jhr 458 | toString IntToReal = "IntToReal"
436 : jhr 1116 | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
437 : cchiw 2523 | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
438 :     | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
439 : cchiw 2525 | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]
440 : jhr 511 | toString (ImageAddress(a0)) = concat["ImageAddress<", ImageInfo.toString a0, ">"]
441 : jhr 1116 | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
442 :     | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
443 : cchiw 2400 | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
444 : cchiw 2525 | toString (LoadImage(a0)) = concat["LoadImage<", ImageInfo.toString a0, ">"]
445 :     | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
446 :     | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
447 : cchiw 2523 | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
448 : jhr 458
449 :     end
450 :    
451 :     structure LowIL = SSAFn(
452 : jhr 1232 val ilName = "low-il"
453 : jhr 458 structure Ty = LowILTypes
454 :     structure Op = LowOps)
455 : jhr 1116
456 :     structure LowILCensus = CensusFn(LowIL)
457 :    

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