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

SCM Repository

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

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

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

revision 3483, Sat Dec 5 15:02:33 2015 UTC revision 3774, Tue Apr 26 20:03:28 2016 UTC
# Line 23  Line 23 
23      type tys = ty list      type tys = ty list
24      fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)      fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
25      fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys      fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
26      fun tysToString tys = String.concat["[", String.concatWith "," (List.map tyToString tys), "]" ]      fun tysToString tys = String.concat["[", String.concatWithMap "," tyToString tys, "]" ]
27    
28    (* required helper functions for the int type *)    (* required helper functions for the int type *)
29      fun sameint (i1 : int, i2) = (i1 = i2)      fun sameint (i1 : int, i2) = (i1 = i2)
# Line 44  Line 44 
44      fun maskToString m =      fun maskToString m =
45            String.concat(List.map (fn true => "_" | false => ":") m)            String.concat(List.map (fn true => "_" | false => ":") m)
46    
   (* required helper functions for the input type *)  
     type input = ty Inputs.input  
     val sameinput = Inputs.same  
     val hashinput = Inputs.hash  
     val inputToString = Inputs.toString  
   
47    (* required helper functions for the index control type type *)    (* required helper functions for the index control type type *)
48      type idxctl = IndexCtl.ctl      type idxctl = IndexCtl.ctl
49      val sameidxctl = IndexCtl.same      val sameidxctl = IndexCtl.same
# Line 75  Line 69 
69        | Min of ty        | Min of ty
70        | Clamp of ty        | Clamp of ty
71        | Lerp of ty        | Lerp of ty
       | Normalize of int  
       | PrincipleEvec of ty  
72        | EigenVecs2x2        | EigenVecs2x2
73        | EigenVecs3x3        | EigenVecs3x3
74        | EigenVals2x2        | EigenVals2x2
# Line 89  Line 81 
81        | Append of ty        | Append of ty
82        | Prepend of ty        | Prepend of ty
83        | Concat of ty        | Concat of ty
84          | Range
85        | Length of ty        | Length of ty
86          | SphereQuery of ty * ty
87        | Ceiling of int        | Ceiling of int
88        | Floor of int        | Floor of int
89        | Round of int        | Round of int
90        | Trunc of int        | Trunc of int
91        | IntToReal        | IntToReal
92        | RealToInt of int        | RealToInt of int
93          | R_All of ty
94          | R_Exists of ty
95          | R_Max of ty
96          | R_Min of ty
97          | R_Sum of ty
98          | R_Product of ty
99          | R_Mean of ty
100          | R_Variance of ty
101          | BuildPos of int
102          | EvalKernel of int * Kernel.kernel * int
103        | Kernel of Kernel.kernel * int        | Kernel of Kernel.kernel * int
104        | Transform of ImageInfo.info        | Transform of ImageInfo.info
105        | Translate of ImageInfo.info        | Translate of ImageInfo.info
       | EvalKernel of int * Kernel.kernel * int  
       | VoxelAddress of ImageInfo.info * int  
       | VoxelAddressWithCtl of ImageInfo.info * int * idxctl  
106        | LoadVoxels of ImageInfo.info * int        | LoadVoxels of ImageInfo.info * int
107          | LoadVoxelsWithCtl of ImageInfo.info * int * idxctl
108        | Inside of ImageInfo.info * int        | Inside of ImageInfo.info * int
109        | ImageDim of ImageInfo.info * int        | ImageDim of ImageInfo.info * int
110          | BorderCtlDefault of ImageInfo.info
111          | BorderCtlClamp of ImageInfo.info
112          | BorderCtlMirror of ImageInfo.info
113          | BorderCtlWrap of ImageInfo.info
114        | LoadSeq of ty * string        | LoadSeq of ty * string
115        | LoadImage of ty * string        | LoadImage of ty * string
       | Input of input  
       | InputWithDefault of input  
116        | Print of tys        | Print of tys
117          | MathFn of MathFns.t
118    
119      fun resultArity IAdd = 1      fun resultArity IAdd = 1
120        | resultArity ISub = 1        | resultArity ISub = 1
# Line 129  Line 134 
134        | resultArity (Min _) = 1        | resultArity (Min _) = 1
135        | resultArity (Clamp _) = 1        | resultArity (Clamp _) = 1
136        | resultArity (Lerp _) = 1        | resultArity (Lerp _) = 1
       | resultArity (Normalize _) = 1  
       | resultArity (PrincipleEvec _) = 1  
137        | resultArity EigenVecs2x2 = 1        | resultArity EigenVecs2x2 = 1
138        | resultArity EigenVecs3x3 = 1        | resultArity EigenVecs3x3 = 1
139        | resultArity EigenVals2x2 = 1        | resultArity EigenVals2x2 = 1
# Line 143  Line 146 
146        | resultArity (Append _) = 2        | resultArity (Append _) = 2
147        | resultArity (Prepend _) = 2        | resultArity (Prepend _) = 2
148        | resultArity (Concat _) = 2        | resultArity (Concat _) = 2
149          | resultArity Range = 2
150        | resultArity (Length _) = 1        | resultArity (Length _) = 1
151          | resultArity (SphereQuery _) = 1
152        | resultArity (Ceiling _) = 1        | resultArity (Ceiling _) = 1
153        | resultArity (Floor _) = 1        | resultArity (Floor _) = 1
154        | resultArity (Round _) = 1        | resultArity (Round _) = 1
155        | resultArity (Trunc _) = 1        | resultArity (Trunc _) = 1
156        | resultArity IntToReal = 1        | resultArity IntToReal = 1
157        | resultArity (RealToInt _) = 1        | resultArity (RealToInt _) = 1
158          | resultArity (R_All _) = 1
159          | resultArity (R_Exists _) = 1
160          | resultArity (R_Max _) = 1
161          | resultArity (R_Min _) = 1
162          | resultArity (R_Sum _) = 1
163          | resultArity (R_Product _) = 1
164          | resultArity (R_Mean _) = 1
165          | resultArity (R_Variance _) = 1
166          | resultArity (BuildPos _) = 1
167          | resultArity (EvalKernel _) = 1
168        | resultArity (Kernel _) = 1        | resultArity (Kernel _) = 1
169        | resultArity (Transform _) = 1        | resultArity (Transform _) = 1
170        | resultArity (Translate _) = 1        | resultArity (Translate _) = 1
       | resultArity (EvalKernel _) = 1  
       | resultArity (VoxelAddress _) = 1  
       | resultArity (VoxelAddressWithCtl _) = 1  
171        | resultArity (LoadVoxels _) = 1        | resultArity (LoadVoxels _) = 1
172          | resultArity (LoadVoxelsWithCtl _) = 1
173        | resultArity (Inside _) = 1        | resultArity (Inside _) = 1
174        | resultArity (ImageDim _) = 1        | resultArity (ImageDim _) = 1
175          | resultArity (BorderCtlDefault _) = 1
176          | resultArity (BorderCtlClamp _) = 1
177          | resultArity (BorderCtlMirror _) = 1
178          | resultArity (BorderCtlWrap _) = 1
179        | resultArity (LoadSeq _) = 1        | resultArity (LoadSeq _) = 1
180        | resultArity (LoadImage _) = 1        | resultArity (LoadImage _) = 1
       | resultArity (Input _) = 0  
       | resultArity (InputWithDefault _) = 0  
181        | resultArity (Print _) = 0        | resultArity (Print _) = 0
182          | resultArity (MathFn _) = 1
183    
184      fun arity IAdd = 2      fun arity IAdd = 2
185        | arity ISub = 2        | arity ISub = 2
# Line 183  Line 199 
199        | arity (Min _) = 2        | arity (Min _) = 2
200        | arity (Clamp _) = 3        | arity (Clamp _) = 3
201        | arity (Lerp _) = 3        | arity (Lerp _) = 3
       | arity (Normalize _) = 1  
       | arity (PrincipleEvec _) = 2  
202        | arity EigenVecs2x2 = 1        | arity EigenVecs2x2 = 1
203        | arity EigenVecs3x3 = 1        | arity EigenVecs3x3 = 1
204        | arity EigenVals2x2 = 1        | arity EigenVals2x2 = 1
# Line 197  Line 211 
211        | arity (Append _) = 1        | arity (Append _) = 1
212        | arity (Prepend _) = 1        | arity (Prepend _) = 1
213        | arity (Concat _) = 1        | arity (Concat _) = 1
214          | arity Range = 1
215        | arity (Length _) = 1        | arity (Length _) = 1
216          | arity (SphereQuery _) = 2
217        | arity (Ceiling _) = 1        | arity (Ceiling _) = 1
218        | arity (Floor _) = 1        | arity (Floor _) = 1
219        | arity (Round _) = 1        | arity (Round _) = 1
220        | arity (Trunc _) = 1        | arity (Trunc _) = 1
221        | arity IntToReal = 1        | arity IntToReal = 1
222        | arity (RealToInt _) = 1        | arity (RealToInt _) = 1
223          | 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          | arity (BuildPos _) = 1
232          | arity (EvalKernel _) = 1
233        | arity (Kernel _) = 0        | arity (Kernel _) = 0
234        | arity (Transform _) = 1        | arity (Transform _) = 1
235        | arity (Translate _) = 1        | arity (Translate _) = 1
236        | arity (EvalKernel _) = 1        | arity (LoadVoxels _) = 2
237        | arity (VoxelAddress _) = ~1        | arity (LoadVoxelsWithCtl _) = 2
       | arity (VoxelAddressWithCtl _) = ~1  
       | arity (LoadVoxels _) = 1  
238        | arity (Inside _) = 2        | arity (Inside _) = 2
239        | arity (ImageDim _) = 1        | arity (ImageDim _) = 1
240          | arity (BorderCtlDefault _) = 2
241          | arity (BorderCtlClamp _) = 1
242          | arity (BorderCtlMirror _) = 1
243          | arity (BorderCtlWrap _) = 1
244        | arity (LoadSeq _) = 0        | arity (LoadSeq _) = 0
245        | arity (LoadImage _) = 0        | arity (LoadImage _) = 0
       | arity (Input _) = 0  
       | arity (InputWithDefault _) = 1  
246        | arity (Print _) = ~1        | arity (Print _) = ~1
247          | arity (MathFn _) = ~1
248    
249      fun isPure (MkDynamic _) = false      fun isPure (MkDynamic _) = false
250        | isPure (Append _) = false        | isPure (Append _) = false
251        | isPure (Prepend _) = false        | isPure (Prepend _) = false
252        | isPure (Concat _) = false        | isPure (Concat _) = false
       | isPure (Input _) = false  
       | isPure (InputWithDefault _) = false  
253        | isPure (Print _) = false        | isPure (Print _) = false
254        | isPure _ = true        | isPure _ = true
255    
# Line 246  Line 271 
271        | same (Min(a0), Min(b0)) = samety(a0, b0)        | same (Min(a0), Min(b0)) = samety(a0, b0)
272        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
273        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
       | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)  
       | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)  
274        | same (EigenVecs2x2, EigenVecs2x2) = true        | same (EigenVecs2x2, EigenVecs2x2) = true
275        | same (EigenVecs3x3, EigenVecs3x3) = true        | same (EigenVecs3x3, EigenVecs3x3) = true
276        | same (EigenVals2x2, EigenVals2x2) = true        | same (EigenVals2x2, EigenVals2x2) = true
# Line 260  Line 283 
283        | same (Append(a0), Append(b0)) = samety(a0, b0)        | same (Append(a0), Append(b0)) = samety(a0, b0)
284        | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)        | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
285        | same (Concat(a0), Concat(b0)) = samety(a0, b0)        | same (Concat(a0), Concat(b0)) = samety(a0, b0)
286          | same (Range, Range) = true
287        | same (Length(a0), Length(b0)) = samety(a0, b0)        | same (Length(a0), Length(b0)) = samety(a0, b0)
288          | same (SphereQuery(a0,a1), SphereQuery(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
289        | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)        | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
290        | same (Floor(a0), Floor(b0)) = sameint(a0, b0)        | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
291        | same (Round(a0), Round(b0)) = sameint(a0, b0)        | same (Round(a0), Round(b0)) = sameint(a0, b0)
292        | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)        | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
293        | same (IntToReal, IntToReal) = true        | same (IntToReal, IntToReal) = true
294        | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)        | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
295          | same (R_All(a0), R_All(b0)) = samety(a0, b0)
296          | same (R_Exists(a0), R_Exists(b0)) = samety(a0, b0)
297          | same (R_Max(a0), R_Max(b0)) = samety(a0, b0)
298          | same (R_Min(a0), R_Min(b0)) = samety(a0, b0)
299          | same (R_Sum(a0), R_Sum(b0)) = samety(a0, b0)
300          | same (R_Product(a0), R_Product(b0)) = samety(a0, b0)
301          | same (R_Mean(a0), R_Mean(b0)) = samety(a0, b0)
302          | same (R_Variance(a0), R_Variance(b0)) = samety(a0, b0)
303          | same (BuildPos(a0), BuildPos(b0)) = sameint(a0, b0)
304          | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)
305        | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)        | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)
306        | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)        | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
307        | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)        | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
       | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)  
       | same (VoxelAddress(a0,a1), VoxelAddress(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)  
       | same (VoxelAddressWithCtl(a0,a1,a2), VoxelAddressWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)  
308        | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)        | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
309          | same (LoadVoxelsWithCtl(a0,a1,a2), LoadVoxelsWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)
310        | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)        | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
311        | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)        | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
312          | same (BorderCtlDefault(a0), BorderCtlDefault(b0)) = ImageInfo.same(a0, b0)
313          | same (BorderCtlClamp(a0), BorderCtlClamp(b0)) = ImageInfo.same(a0, b0)
314          | same (BorderCtlMirror(a0), BorderCtlMirror(b0)) = ImageInfo.same(a0, b0)
315          | same (BorderCtlWrap(a0), BorderCtlWrap(b0)) = ImageInfo.same(a0, b0)
316        | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)        | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
317        | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)        | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
       | same (Input(a0), Input(b0)) = sameinput(a0, b0)  
       | same (InputWithDefault(a0), InputWithDefault(b0)) = sameinput(a0, b0)  
318        | same (Print(a0), Print(b0)) = sametys(a0, b0)        | same (Print(a0), Print(b0)) = sametys(a0, b0)
319          | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
320        | same _ = false        | same _ = false
321    
322      fun hash IAdd = 0w3      fun hash IAdd = 0w3
# Line 301  Line 337 
337        | hash (Min(a0)) = 0w59 + hashty a0        | hash (Min(a0)) = 0w59 + hashty a0
338        | hash (Clamp(a0)) = 0w61 + hashty a0        | hash (Clamp(a0)) = 0w61 + hashty a0
339        | hash (Lerp(a0)) = 0w67 + hashty a0        | hash (Lerp(a0)) = 0w67 + hashty a0
340        | hash (Normalize(a0)) = 0w71 + hashint a0        | hash EigenVecs2x2 = 0w71
341        | hash (PrincipleEvec(a0)) = 0w73 + hashty a0        | hash EigenVecs3x3 = 0w73
342        | hash EigenVecs2x2 = 0w79        | hash EigenVals2x2 = 0w79
343        | hash EigenVecs3x3 = 0w83        | hash EigenVals3x3 = 0w83
344        | hash EigenVals2x2 = 0w89        | hash (Zero(a0)) = 0w89 + hashty a0
345        | hash EigenVals3x3 = 0w97        | hash (Select(a0,a1)) = 0w97 + hashty a0 + hashint a1
346        | hash (Zero(a0)) = 0w101 + hashty a0        | hash (Index(a0,a1)) = 0w101 + hashty a0 + hashint a1
347        | hash (Select(a0,a1)) = 0w103 + hashty a0 + hashint a1        | hash (Subscript(a0)) = 0w103 + hashty a0
348        | hash (Index(a0,a1)) = 0w107 + hashty a0 + hashint a1        | hash (MkDynamic(a0,a1)) = 0w107 + hashty a0 + hashint a1
349        | hash (Subscript(a0)) = 0w109 + hashty a0        | hash (Append(a0)) = 0w109 + hashty a0
350        | hash (MkDynamic(a0,a1)) = 0w113 + hashty a0 + hashint a1        | hash (Prepend(a0)) = 0w113 + hashty a0
351        | hash (Append(a0)) = 0w127 + hashty a0        | hash (Concat(a0)) = 0w127 + hashty a0
352        | hash (Prepend(a0)) = 0w131 + hashty a0        | hash Range = 0w131
353        | hash (Concat(a0)) = 0w137 + hashty a0        | hash (Length(a0)) = 0w137 + hashty a0
354        | hash (Length(a0)) = 0w139 + hashty a0        | hash (SphereQuery(a0,a1)) = 0w139 + hashty a0 + hashty a1
355        | hash (Ceiling(a0)) = 0w149 + hashint a0        | hash (Ceiling(a0)) = 0w149 + hashint a0
356        | hash (Floor(a0)) = 0w151 + hashint a0        | hash (Floor(a0)) = 0w151 + hashint a0
357        | hash (Round(a0)) = 0w157 + hashint a0        | hash (Round(a0)) = 0w157 + hashint a0
358        | hash (Trunc(a0)) = 0w163 + hashint a0        | hash (Trunc(a0)) = 0w163 + hashint a0
359        | hash IntToReal = 0w167        | hash IntToReal = 0w167
360        | hash (RealToInt(a0)) = 0w173 + hashint a0        | hash (RealToInt(a0)) = 0w173 + hashint a0
361        | hash (Kernel(a0,a1)) = 0w179 + Kernel.hash a0 + hashint a1        | hash (R_All(a0)) = 0w179 + hashty a0
362        | hash (Transform(a0)) = 0w181 + ImageInfo.hash a0        | hash (R_Exists(a0)) = 0w181 + hashty a0
363        | hash (Translate(a0)) = 0w191 + ImageInfo.hash a0        | hash (R_Max(a0)) = 0w191 + hashty a0
364        | hash (EvalKernel(a0,a1,a2)) = 0w193 + hashint a0 + Kernel.hash a1 + hashint a2        | hash (R_Min(a0)) = 0w193 + hashty a0
365        | hash (VoxelAddress(a0,a1)) = 0w197 + ImageInfo.hash a0 + hashint a1        | hash (R_Sum(a0)) = 0w197 + hashty a0
366        | hash (VoxelAddressWithCtl(a0,a1,a2)) = 0w199 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2        | hash (R_Product(a0)) = 0w199 + hashty a0
367        | hash (LoadVoxels(a0,a1)) = 0w211 + ImageInfo.hash a0 + hashint a1        | hash (R_Mean(a0)) = 0w211 + hashty a0
368        | hash (Inside(a0,a1)) = 0w223 + ImageInfo.hash a0 + hashint a1        | hash (R_Variance(a0)) = 0w223 + hashty a0
369        | hash (ImageDim(a0,a1)) = 0w227 + ImageInfo.hash a0 + hashint a1        | hash (BuildPos(a0)) = 0w227 + hashint a0
370        | hash (LoadSeq(a0,a1)) = 0w229 + hashty a0 + hashstring a1        | hash (EvalKernel(a0,a1,a2)) = 0w229 + hashint a0 + Kernel.hash a1 + hashint a2
371        | hash (LoadImage(a0,a1)) = 0w233 + hashty a0 + hashstring a1        | hash (Kernel(a0,a1)) = 0w233 + Kernel.hash a0 + hashint a1
372        | hash (Input(a0)) = 0w239 + hashinput a0        | hash (Transform(a0)) = 0w239 + ImageInfo.hash a0
373        | hash (InputWithDefault(a0)) = 0w241 + hashinput a0        | hash (Translate(a0)) = 0w241 + ImageInfo.hash a0
374        | hash (Print(a0)) = 0w251 + hashtys a0        | hash (LoadVoxels(a0,a1)) = 0w251 + ImageInfo.hash a0 + hashint a1
375          | hash (LoadVoxelsWithCtl(a0,a1,a2)) = 0w257 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2
376          | hash (Inside(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1
377          | hash (ImageDim(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1
378          | hash (BorderCtlDefault(a0)) = 0w271 + ImageInfo.hash a0
379          | hash (BorderCtlClamp(a0)) = 0w277 + ImageInfo.hash a0
380          | hash (BorderCtlMirror(a0)) = 0w281 + ImageInfo.hash a0
381          | hash (BorderCtlWrap(a0)) = 0w283 + ImageInfo.hash a0
382          | hash (LoadSeq(a0,a1)) = 0w293 + hashty a0 + hashstring a1
383          | hash (LoadImage(a0,a1)) = 0w307 + hashty a0 + hashstring a1
384          | hash (Print(a0)) = 0w311 + hashtys a0
385          | hash (MathFn(a0)) = 0w313 + MathFns.hash a0
386    
387      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
388        | toString ISub = "ISub"        | toString ISub = "ISub"
# Line 355  Line 402 
402        | toString (Min(a0)) = concat["Min<", tyToString a0, ">"]        | toString (Min(a0)) = concat["Min<", tyToString a0, ">"]
403        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
404        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
       | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]  
       | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]  
405        | toString EigenVecs2x2 = "EigenVecs2x2"        | toString EigenVecs2x2 = "EigenVecs2x2"
406        | toString EigenVecs3x3 = "EigenVecs3x3"        | toString EigenVecs3x3 = "EigenVecs3x3"
407        | toString EigenVals2x2 = "EigenVals2x2"        | toString EigenVals2x2 = "EigenVals2x2"
# Line 369  Line 414 
414        | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]        | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
415        | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]        | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
416        | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]        | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
417          | toString Range = "Range"
418        | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]        | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
419          | toString (SphereQuery(a0,a1)) = concat["SphereQuery<", tyToString a0, ",", tyToString a1, ">"]
420        | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]        | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
421        | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]        | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
422        | toString (Round(a0)) = concat["Round<", intToString a0, ">"]        | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
423        | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]        | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
424        | toString IntToReal = "IntToReal"        | toString IntToReal = "IntToReal"
425        | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]        | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
426          | toString (R_All(a0)) = concat["R_All<", tyToString a0, ">"]
427          | toString (R_Exists(a0)) = concat["R_Exists<", tyToString a0, ">"]
428          | toString (R_Max(a0)) = concat["R_Max<", tyToString a0, ">"]
429          | toString (R_Min(a0)) = concat["R_Min<", tyToString a0, ">"]
430          | toString (R_Sum(a0)) = concat["R_Sum<", tyToString a0, ">"]
431          | toString (R_Product(a0)) = concat["R_Product<", tyToString a0, ">"]
432          | toString (R_Mean(a0)) = concat["R_Mean<", tyToString a0, ">"]
433          | toString (R_Variance(a0)) = concat["R_Variance<", tyToString a0, ">"]
434          | toString (BuildPos(a0)) = concat["BuildPos<", intToString a0, ">"]
435          | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]
436        | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]        | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]
437        | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]        | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
438        | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]        | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
       | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]  
       | toString (VoxelAddress(a0,a1)) = concat["VoxelAddress<", ImageInfo.toString a0, ",", intToString a1, ">"]  
       | toString (VoxelAddressWithCtl(a0,a1,a2)) = concat["VoxelAddressWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]  
439        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
440          | toString (LoadVoxelsWithCtl(a0,a1,a2)) = concat["LoadVoxelsWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]
441        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
442        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
443          | toString (BorderCtlDefault(a0)) = concat["BorderCtlDefault<", ImageInfo.toString a0, ">"]
444          | toString (BorderCtlClamp(a0)) = concat["BorderCtlClamp<", ImageInfo.toString a0, ">"]
445          | toString (BorderCtlMirror(a0)) = concat["BorderCtlMirror<", ImageInfo.toString a0, ">"]
446          | toString (BorderCtlWrap(a0)) = concat["BorderCtlWrap<", ImageInfo.toString a0, ">"]
447        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
448        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
       | toString (Input(a0)) = concat["Input<", inputToString a0, ">"]  
       | toString (InputWithDefault(a0)) = concat["InputWithDefault<", inputToString a0, ">"]  
449        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
450          | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
451    
452    end    end
453    
454  structure MidIR = SSAFn(  structure MidIR = SSAFn(
455    val ilName = "mid-ir"    val irName = "mid-ir"
456    structure Ty = MidTypes    structure Ty = MidTypes
457    structure Op = MidOps)    structure Op = MidOps)
458    

Legend:
Removed from v.3483  
changed lines
  Added in v.3774

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