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

SCM Repository

[diderot] Diff of /branches/staging/src/compiler/mid-il/mid-il.sml
ViewVC logotype

Diff of /branches/staging/src/compiler/mid-il/mid-il.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/src/compiler/mid-il/mid-il.sml revision 287, Fri Aug 13 21:40:04 2010 UTC branches/staging/src/compiler/mid-il/mid-il.sml revision 1930, Tue Jun 26 13:13:39 2012 UTC
# Line 1  Line 1 
1  (* mid-il.sml  (* mid-il.sml
2   *   *
3   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)   * COPYRIGHT (c) 2010 The Diderot Project (http://diderot-language.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5   *   *
6   * Middle-level version of the Diderot IL.   * Middle-level version of the Diderot IL.
# Line 11  Line 11 
11  structure MidOps =  structure MidOps =
12    struct    struct
13    
14      datatype ty = BoolTy | StringTy | IntTy | VecTy of int    (* required helper functions for types *)
15        type ty = MidILTypes.ty
16      fun samety (ty1 : ty, ty2) = (ty1 = ty2)      val samety = MidILTypes.same
17      fun hashty BoolTy = 0w1      val hashty = MidILTypes.hash
18        | hashty StringTy = 0w2      val tyToString = MidILTypes.toString
19        | hashty IntTy = 0w3  
20        | hashty (VecTy d) = Word.fromInt d + 0w4    (* required helper functions for type lists *)
21      fun tyToString BoolTy = "bool"      type tys = ty list
22        | tyToString StringTy = "string"      fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
23        | tyToString IntTy = "int"      fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
24        | tyToString (VecTy 0) = "real"      fun tysToString tys = String.concat["[", String.concatWith "," (List.map tyToString tys), "]" ]
25        | tyToString (VecTy d) = "vec" ^ Int.toString d  
26      (* required helper functions for the int type *)
27        fun sameint (i1 : int, i2) = (i1 = i2)
28        fun hashint i = Word.fromInt i
29        fun intToString i = Int.toString i
30    
31      (* required helper functions for the string type *)
32      fun samestring (s1 : string, s2) = (s1 = s2)      fun samestring (s1 : string, s2) = (s1 = s2)
33      val hashstring = HashString.hashString      val hashstring = HashString.hashString
34      fun stringToString s = String.concat["\"", s, "\""]      fun stringToString s = String.concat["\"", s, "\""]
# Line 34  Line 39 
39        | Mul of ty        | Mul of ty
40        | Div of ty        | Div of ty
41        | Neg of ty        | Neg of ty
42          | Abs of ty
43        | LT of ty        | LT of ty
44        | LTE of ty        | LTE of ty
45        | EQ of ty        | EQ of ty
46        | NEQ of ty        | NEQ of ty
47        | GT of ty        | GT of ty
48        | GTE of ty        | GTE of ty
49        | Dot of ty        | Not
50          | Max
51          | Min
52          | Clamp of ty
53          | Lerp of ty
54          | Dot of int
55          | MulVecMat of int * int
56          | MulMatVec of int * int
57          | MulMatMat of int * int * int
58        | Cross        | Cross
       | Select of int  
59        | Norm of ty        | Norm of ty
60          | Normalize of int
61        | Scale of ty        | Scale of ty
       | InvScale of ty  
       | CL  
62        | PrincipleEvec of ty        | PrincipleEvec of ty
63          | EigenVecs2x2
64          | EigenVecs3x3
65          | EigenVals2x2
66          | EigenVals3x3
67          | Identity of int
68          | Zero of ty
69          | Trace of int
70          | Select of ty * int
71          | Index of ty * int
72        | Subscript of ty        | Subscript of ty
73        | Max        | Ceiling of int
74        | Min        | Floor of int
75        | Sin        | Round of int
76        | Cos        | Trunc of int
       | Pow  
       | Not  
77        | IntToReal        | IntToReal
78        | TruncToInt        | RealToInt of int
79        | RoundToInt        | VoxelAddress of ImageInfo.info * int
80        | CeilToInt        | LoadVoxels of ImageInfo.info * int
81        | FloorToInt        | PosToImgSpace of ImageInfo.info
82        | VoxelAddress of ImageInfo.info        | TensorToWorldSpace of ImageInfo.info * ty
83        | LoadVoxels of RawTypes.ty * int        | EvalKernel of int * Kernel.kernel * int
       | Transform of ImageInfo.info  
       | Kernel of Kernel.kernel  
       | DiffKernel of int  
       | EvalKernel  
84        | LoadImage of ImageInfo.info        | LoadImage of ImageInfo.info
85        | Inside        | Inside of ImageInfo.info * int
86        | Input of string        | Input of ty * string * string
87        | InputWithDefault of string        | InputWithDefault of ty * string * string
88          | Print of tys
89    
90        fun resultArity (Add _) = 1
91          | resultArity (Sub _) = 1
92          | resultArity (Mul _) = 1
93          | resultArity (Div _) = 1
94          | resultArity (Neg _) = 1
95          | resultArity (Abs _) = 1
96          | resultArity (LT _) = 1
97          | resultArity (LTE _) = 1
98          | resultArity (EQ _) = 1
99          | resultArity (NEQ _) = 1
100          | resultArity (GT _) = 1
101          | resultArity (GTE _) = 1
102          | resultArity Not = 1
103          | resultArity Max = 1
104          | resultArity Min = 1
105          | resultArity (Clamp _) = 1
106          | resultArity (Lerp _) = 1
107          | resultArity (Dot _) = 1
108          | resultArity (MulVecMat _) = 1
109          | resultArity (MulMatVec _) = 1
110          | resultArity (MulMatMat _) = 1
111          | resultArity Cross = 1
112          | resultArity (Norm _) = 1
113          | resultArity (Normalize _) = 1
114          | resultArity (Scale _) = 1
115          | resultArity (PrincipleEvec _) = 1
116          | resultArity EigenVecs2x2 = 1
117          | resultArity EigenVecs3x3 = 1
118          | resultArity EigenVals2x2 = 1
119          | resultArity EigenVals3x3 = 1
120          | resultArity (Identity _) = 1
121          | resultArity (Zero _) = 1
122          | resultArity (Trace _) = 1
123          | resultArity (Select _) = 1
124          | resultArity (Index _) = 1
125          | resultArity (Subscript _) = 1
126          | resultArity (Ceiling _) = 1
127          | resultArity (Floor _) = 1
128          | resultArity (Round _) = 1
129          | resultArity (Trunc _) = 1
130          | resultArity IntToReal = 1
131          | resultArity (RealToInt _) = 1
132          | resultArity (VoxelAddress _) = 1
133          | resultArity (LoadVoxels _) = 1
134          | resultArity (PosToImgSpace _) = 1
135          | resultArity (TensorToWorldSpace _) = 1
136          | resultArity (EvalKernel _) = 1
137          | resultArity (LoadImage _) = 1
138          | resultArity (Inside _) = 1
139          | resultArity (Input _) = 1
140          | resultArity (InputWithDefault _) = 1
141          | resultArity (Print _) = 0
142    
143      fun arity (Add _) = 2      fun arity (Add _) = 2
144        | arity (Sub _) = 2        | arity (Sub _) = 2
145        | arity (Mul _) = 2        | arity (Mul _) = 2
146        | arity (Div _) = 2        | arity (Div _) = 2
147        | arity (Neg _) = 1        | arity (Neg _) = 1
148          | arity (Abs _) = 1
149        | arity (LT _) = 2        | arity (LT _) = 2
150        | arity (LTE _) = 2        | arity (LTE _) = 2
151        | arity (EQ _) = 2        | arity (EQ _) = 2
152        | arity (NEQ _) = 2        | arity (NEQ _) = 2
153        | arity (GT _) = 2        | arity (GT _) = 2
154        | arity (GTE _) = 2        | arity (GTE _) = 2
155          | arity Not = 1
156          | arity Max = 2
157          | arity Min = 2
158          | arity (Clamp _) = 3
159          | arity (Lerp _) = 3
160        | arity (Dot _) = 2        | arity (Dot _) = 2
161          | arity (MulVecMat _) = 2
162          | arity (MulMatVec _) = 2
163          | arity (MulMatMat _) = 2
164        | arity Cross = 2        | arity Cross = 2
       | arity (Select _) = 1  
165        | arity (Norm _) = 1        | arity (Norm _) = 1
166          | arity (Normalize _) = 1
167        | arity (Scale _) = 2        | arity (Scale _) = 2
       | arity (InvScale _) = 2  
       | arity CL = 1  
168        | arity (PrincipleEvec _) = 2        | arity (PrincipleEvec _) = 2
169          | arity EigenVecs2x2 = 1
170          | arity EigenVecs3x3 = 1
171          | arity EigenVals2x2 = 1
172          | arity EigenVals3x3 = 1
173          | arity (Identity _) = 0
174          | arity (Zero _) = 0
175          | arity (Trace _) = 1
176          | arity (Select _) = 1
177          | arity (Index _) = 1
178        | arity (Subscript _) = 2        | arity (Subscript _) = 2
179        | arity Max = 2        | arity (Ceiling _) = 1
180        | arity Min = 2        | arity (Floor _) = 1
181        | arity Sin = 1        | arity (Round _) = 1
182        | arity Cos = 1        | arity (Trunc _) = 1
       | arity Pow = 2  
       | arity Not = 1  
183        | arity IntToReal = 1        | arity IntToReal = 1
184        | arity TruncToInt = 1        | arity (RealToInt _) = 1
       | arity RoundToInt = 1  
       | arity CeilToInt = 1  
       | arity FloorToInt = 1  
185        | arity (VoxelAddress _) = ~1        | arity (VoxelAddress _) = ~1
186        | arity (LoadVoxels _) = 1        | arity (LoadVoxels _) = 1
187        | arity (Transform _) = 1        | arity (PosToImgSpace _) = 2
188        | arity (Kernel _) = 0        | arity (TensorToWorldSpace _) = 2
189        | arity (DiffKernel _) = 1        | arity (EvalKernel _) = 1
190        | arity EvalKernel = 2        | arity (LoadImage _) = 1
191        | arity (LoadImage _) = 0        | arity (Inside _) = 2
       | arity Inside = 2  
192        | arity (Input _) = 0        | arity (Input _) = 0
193        | arity (InputWithDefault _) = 1        | arity (InputWithDefault _) = 1
194          | arity (Print _) = ~1
195    
196      fun same (Add(a0), Add(b0)) = samety(a0, b0)      fun same (Add(a0), Add(b0)) = samety(a0, b0)
197        | same (Sub(a0), Sub(b0)) = samety(a0, b0)        | same (Sub(a0), Sub(b0)) = samety(a0, b0)
198        | same (Mul(a0), Mul(b0)) = samety(a0, b0)        | same (Mul(a0), Mul(b0)) = samety(a0, b0)
199        | same (Div(a0), Div(b0)) = samety(a0, b0)        | same (Div(a0), Div(b0)) = samety(a0, b0)
200        | same (Neg(a0), Neg(b0)) = samety(a0, b0)        | same (Neg(a0), Neg(b0)) = samety(a0, b0)
201          | same (Abs(a0), Abs(b0)) = samety(a0, b0)
202        | same (LT(a0), LT(b0)) = samety(a0, b0)        | same (LT(a0), LT(b0)) = samety(a0, b0)
203        | same (LTE(a0), LTE(b0)) = samety(a0, b0)        | same (LTE(a0), LTE(b0)) = samety(a0, b0)
204        | same (EQ(a0), EQ(b0)) = samety(a0, b0)        | same (EQ(a0), EQ(b0)) = samety(a0, b0)
205        | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)        | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
206        | same (GT(a0), GT(b0)) = samety(a0, b0)        | same (GT(a0), GT(b0)) = samety(a0, b0)
207        | same (GTE(a0), GTE(b0)) = samety(a0, b0)        | same (GTE(a0), GTE(b0)) = samety(a0, b0)
208        | same (Dot(a0), Dot(b0)) = samety(a0, b0)        | same (Not, Not) = true
209          | same (Max, Max) = true
210          | same (Min, Min) = true
211          | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
212          | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
213          | same (Dot(a0), Dot(b0)) = sameint(a0, b0)
214          | same (MulVecMat(a0,a1), MulVecMat(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
215          | same (MulMatVec(a0,a1), MulMatVec(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
216          | same (MulMatMat(a0,a1,a2), MulMatMat(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
217        | same (Cross, Cross) = true        | same (Cross, Cross) = true
       | same (Select(a0), Select(b0)) = sameint(a0, b0)  
218        | same (Norm(a0), Norm(b0)) = samety(a0, b0)        | same (Norm(a0), Norm(b0)) = samety(a0, b0)
219          | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)
220        | same (Scale(a0), Scale(b0)) = samety(a0, b0)        | same (Scale(a0), Scale(b0)) = samety(a0, b0)
       | same (InvScale(a0), InvScale(b0)) = samety(a0, b0)  
       | same (CL, CL) = true  
221        | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)        | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)
222          | same (EigenVecs2x2, EigenVecs2x2) = true
223          | same (EigenVecs3x3, EigenVecs3x3) = true
224          | same (EigenVals2x2, EigenVals2x2) = true
225          | same (EigenVals3x3, EigenVals3x3) = true
226          | same (Identity(a0), Identity(b0)) = sameint(a0, b0)
227          | same (Zero(a0), Zero(b0)) = samety(a0, b0)
228          | same (Trace(a0), Trace(b0)) = sameint(a0, b0)
229          | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
230          | same (Index(a0,a1), Index(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
231        | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)        | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
232        | same (Max, Max) = true        | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
233        | same (Min, Min) = true        | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
234        | same (Sin, Sin) = true        | same (Round(a0), Round(b0)) = sameint(a0, b0)
235        | same (Cos, Cos) = true        | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
       | same (Pow, Pow) = true  
       | same (Not, Not) = true  
236        | same (IntToReal, IntToReal) = true        | same (IntToReal, IntToReal) = true
237        | same (TruncToInt, TruncToInt) = true        | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
238        | same (RoundToInt, RoundToInt) = true        | same (VoxelAddress(a0,a1), VoxelAddress(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
239        | same (CeilToInt, CeilToInt) = true        | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
240        | same (FloorToInt, FloorToInt) = true        | same (PosToImgSpace(a0), PosToImgSpace(b0)) = ImageInfo.same(a0, b0)
241        | same (VoxelAddress(a0), VoxelAddress(b0)) = ImageInfo.same(a0, b0)        | same (TensorToWorldSpace(a0,a1), TensorToWorldSpace(b0,b1)) = ImageInfo.same(a0, b0) andalso samety(a1, b1)
242        | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = RawTypes.same(a0, b0) andalso sameint(a1, b1)        | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)
       | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)  
       | same (Kernel(a0), Kernel(b0)) = Kernel.same(a0, b0)  
       | same (DiffKernel(a0), DiffKernel(b0)) = sameint(a0, b0)  
       | same (EvalKernel, EvalKernel) = true  
243        | same (LoadImage(a0), LoadImage(b0)) = ImageInfo.same(a0, b0)        | same (LoadImage(a0), LoadImage(b0)) = ImageInfo.same(a0, b0)
244        | same (Inside, Inside) = true        | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
245        | same (Input(a0), Input(b0)) = samestring(a0, b0)        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
246        | same (InputWithDefault(a0), InputWithDefault(b0)) = samestring(a0, b0)        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
247          | same (Print(a0), Print(b0)) = sametys(a0, b0)
248        | same _ = false        | same _ = false
249    
250      fun hash (Add(a0)) = 0w3 + hashty a0      fun hash (Add(a0)) = 0w3 + hashty a0
# Line 161  Line 252 
252        | hash (Mul(a0)) = 0w7 + hashty a0        | hash (Mul(a0)) = 0w7 + hashty a0
253        | hash (Div(a0)) = 0w11 + hashty a0        | hash (Div(a0)) = 0w11 + hashty a0
254        | hash (Neg(a0)) = 0w13 + hashty a0        | hash (Neg(a0)) = 0w13 + hashty a0
255        | hash (LT(a0)) = 0w17 + hashty a0        | hash (Abs(a0)) = 0w17 + hashty a0
256        | hash (LTE(a0)) = 0w19 + hashty a0        | hash (LT(a0)) = 0w19 + hashty a0
257        | hash (EQ(a0)) = 0w23 + hashty a0        | hash (LTE(a0)) = 0w23 + hashty a0
258        | hash (NEQ(a0)) = 0w29 + hashty a0        | hash (EQ(a0)) = 0w29 + hashty a0
259        | hash (GT(a0)) = 0w31 + hashty a0        | hash (NEQ(a0)) = 0w31 + hashty a0
260        | hash (GTE(a0)) = 0w37 + hashty a0        | hash (GT(a0)) = 0w37 + hashty a0
261        | hash (Dot(a0)) = 0w41 + hashty a0        | hash (GTE(a0)) = 0w41 + hashty a0
262        | hash Cross = 0w43        | hash Not = 0w43
263        | hash (Select(a0)) = 0w47 + hashint a0        | hash Max = 0w47
264        | hash (Norm(a0)) = 0w53 + hashty a0        | hash Min = 0w53
265        | hash (Scale(a0)) = 0w59 + hashty a0        | hash (Clamp(a0)) = 0w59 + hashty a0
266        | hash (InvScale(a0)) = 0w61 + hashty a0        | hash (Lerp(a0)) = 0w61 + hashty a0
267        | hash CL = 0w67        | hash (Dot(a0)) = 0w67 + hashint a0
268        | hash (PrincipleEvec(a0)) = 0w71 + hashty a0        | hash (MulVecMat(a0,a1)) = 0w71 + hashint a0 + hashint a1
269        | hash (Subscript(a0)) = 0w73 + hashty a0        | hash (MulMatVec(a0,a1)) = 0w73 + hashint a0 + hashint a1
270        | hash Max = 0w79        | hash (MulMatMat(a0,a1,a2)) = 0w79 + hashint a0 + hashint a1 + hashint a2
271        | hash Min = 0w83        | hash Cross = 0w83
272        | hash Sin = 0w89        | hash (Norm(a0)) = 0w89 + hashty a0
273        | hash Cos = 0w97        | hash (Normalize(a0)) = 0w97 + hashint a0
274        | hash Pow = 0w101        | hash (Scale(a0)) = 0w101 + hashty a0
275        | hash Not = 0w103        | hash (PrincipleEvec(a0)) = 0w103 + hashty a0
276        | hash IntToReal = 0w107        | hash EigenVecs2x2 = 0w107
277        | hash TruncToInt = 0w109        | hash EigenVecs3x3 = 0w109
278        | hash RoundToInt = 0w113        | hash EigenVals2x2 = 0w113
279        | hash CeilToInt = 0w127        | hash EigenVals3x3 = 0w127
280        | hash FloorToInt = 0w131        | hash (Identity(a0)) = 0w131 + hashint a0
281        | hash (VoxelAddress(a0)) = 0w137 + ImageInfo.hash a0        | hash (Zero(a0)) = 0w137 + hashty a0
282        | hash (LoadVoxels(a0,a1)) = 0w139 + RawTypes.hash a0 + hashint a1        | hash (Trace(a0)) = 0w139 + hashint a0
283        | hash (Transform(a0)) = 0w149 + ImageInfo.hash a0        | hash (Select(a0,a1)) = 0w149 + hashty a0 + hashint a1
284        | hash (Kernel(a0)) = 0w151 + Kernel.hash a0        | hash (Index(a0,a1)) = 0w151 + hashty a0 + hashint a1
285        | hash (DiffKernel(a0)) = 0w157 + hashint a0        | hash (Subscript(a0)) = 0w157 + hashty a0
286        | hash EvalKernel = 0w163        | hash (Ceiling(a0)) = 0w163 + hashint a0
287        | hash (LoadImage(a0)) = 0w167 + ImageInfo.hash a0        | hash (Floor(a0)) = 0w167 + hashint a0
288        | hash Inside = 0w173        | hash (Round(a0)) = 0w173 + hashint a0
289        | hash (Input(a0)) = 0w179 + hashstring a0        | hash (Trunc(a0)) = 0w179 + hashint a0
290        | hash (InputWithDefault(a0)) = 0w181 + hashstring a0        | hash IntToReal = 0w181
291          | hash (RealToInt(a0)) = 0w191 + hashint a0
292          | hash (VoxelAddress(a0,a1)) = 0w193 + ImageInfo.hash a0 + hashint a1
293          | hash (LoadVoxels(a0,a1)) = 0w197 + ImageInfo.hash a0 + hashint a1
294          | hash (PosToImgSpace(a0)) = 0w199 + ImageInfo.hash a0
295          | hash (TensorToWorldSpace(a0,a1)) = 0w211 + ImageInfo.hash a0 + hashty a1
296          | hash (EvalKernel(a0,a1,a2)) = 0w223 + hashint a0 + Kernel.hash a1 + hashint a2
297          | hash (LoadImage(a0)) = 0w227 + ImageInfo.hash a0
298          | hash (Inside(a0,a1)) = 0w229 + ImageInfo.hash a0 + hashint a1
299          | hash (Input(a0,a1,a2)) = 0w233 + hashty a0 + hashstring a1 + hashstring a2
300          | hash (InputWithDefault(a0,a1,a2)) = 0w239 + hashty a0 + hashstring a1 + hashstring a2
301          | hash (Print(a0)) = 0w241 + hashtys a0
302    
303      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]
304        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]
305        | toString (Mul(a0)) = concat["Mul<", tyToString a0, ">"]        | toString (Mul(a0)) = concat["Mul<", tyToString a0, ">"]
306        | toString (Div(a0)) = concat["Div<", tyToString a0, ">"]        | toString (Div(a0)) = concat["Div<", tyToString a0, ">"]
307        | toString (Neg(a0)) = concat["Neg<", tyToString a0, ">"]        | toString (Neg(a0)) = concat["Neg<", tyToString a0, ">"]
308          | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
309        | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]        | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
310        | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]        | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
311        | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]        | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
312        | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]        | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
313        | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]        | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
314        | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]        | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
315        | toString (Dot(a0)) = concat["Dot<", tyToString a0, ">"]        | toString Not = "Not"
316          | toString Max = "Max"
317          | toString Min = "Min"
318          | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
319          | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
320          | toString (Dot(a0)) = concat["Dot<", intToString a0, ">"]
321          | toString (MulVecMat(a0,a1)) = concat["MulVecMat<", intToString a0, ",", intToString a1, ">"]
322          | toString (MulMatVec(a0,a1)) = concat["MulMatVec<", intToString a0, ",", intToString a1, ">"]
323          | toString (MulMatMat(a0,a1,a2)) = concat["MulMatMat<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
324        | toString Cross = "Cross"        | toString Cross = "Cross"
       | toString (Select(a0)) = concat["Select<", intToString a0, ">"]  
325        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]
326          | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]
327        | toString (Scale(a0)) = concat["Scale<", tyToString a0, ">"]        | toString (Scale(a0)) = concat["Scale<", tyToString a0, ">"]
       | toString (InvScale(a0)) = concat["InvScale<", tyToString a0, ">"]  
       | toString CL = "CL"  
328        | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]        | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]
329          | toString EigenVecs2x2 = "EigenVecs2x2"
330          | toString EigenVecs3x3 = "EigenVecs3x3"
331          | toString EigenVals2x2 = "EigenVals2x2"
332          | toString EigenVals3x3 = "EigenVals3x3"
333          | toString (Identity(a0)) = concat["Identity<", intToString a0, ">"]
334          | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
335          | toString (Trace(a0)) = concat["Trace<", intToString a0, ">"]
336          | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
337          | toString (Index(a0,a1)) = concat["Index<", tyToString a0, ",", intToString a1, ">"]
338        | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]        | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
339        | toString Max = "Max"        | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
340        | toString Min = "Min"        | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
341        | toString Sin = "Sin"        | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
342        | toString Cos = "Cos"        | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
       | toString Pow = "Pow"  
       | toString Not = "Not"  
343        | toString IntToReal = "IntToReal"        | toString IntToReal = "IntToReal"
344        | toString TruncToInt = "TruncToInt"        | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
345        | toString RoundToInt = "RoundToInt"        | toString (VoxelAddress(a0,a1)) = concat["VoxelAddress<", ImageInfo.toString a0, ",", intToString a1, ">"]
346        | toString CeilToInt = "CeilToInt"        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
347        | toString FloorToInt = "FloorToInt"        | toString (PosToImgSpace(a0)) = concat["PosToImgSpace<", ImageInfo.toString a0, ">"]
348        | toString (VoxelAddress(a0)) = concat["VoxelAddress<", ImageInfo.toString a0, ">"]        | toString (TensorToWorldSpace(a0,a1)) = concat["TensorToWorldSpace<", ImageInfo.toString a0, ",", tyToString a1, ">"]
349        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", RawTypes.toString a0",", intToString a0, ">"]        | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]
       | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]  
       | toString (Kernel(a0)) = concat["Kernel<", Kernel.toString a0, ">"]  
       | toString (DiffKernel(a0)) = concat["DiffKernel<", intToString a0, ">"]  
       | toString EvalKernel = "EvalKernel"  
350        | toString (LoadImage(a0)) = concat["LoadImage<", ImageInfo.toString a0, ">"]        | toString (LoadImage(a0)) = concat["LoadImage<", ImageInfo.toString a0, ">"]
351        | toString Inside = "Inside"        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
352        | toString (Input(a0)) = concat["Input<", stringToString a0, ">"]        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
353        | toString (InputWithDefault(a0)) = concat["InputWithDefault<", stringToString a0, ">"]        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
354          | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
355    
356    end    end
357    
358  structure MidIL = SSAFn(MidOps)  structure MidIL = SSAFn(
359      val ilName = "mid-il"
360      structure Ty = MidILTypes
361      structure Op = MidOps)
362    
363    structure MidILCensus = CensusFn(MidIL)
364    

Legend:
Removed from v.287  
changed lines
  Added in v.1930

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