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

SCM Repository

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

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

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

revision 2668, Thu Jun 12 03:29:04 2014 UTC revision 3195, Wed May 20 21:02:12 2015 UTC
# Line 32  Line 32 
32      val hashstring = HashString.hashString      val hashstring = HashString.hashString
33      fun stringToString s = String.concat["\"", s, "\""]      fun stringToString s = String.concat["\"", s, "\""]
34    
35      (* required helper functions for the input type *)
36        type input = ty Inputs.input
37        val sameinput = Inputs.same
38        val hashinput = Inputs.hash
39        val inputToString = Inputs.toString
40    
41      datatype rator      datatype rator
42        = IAdd        = IAdd
43        | ISub        | ISub
44        | IMul        | IMul
45        | IDiv        | IDiv
46        | INeg        | INeg
47        | IndexTensor of int * ty * ty * ty        | R of ty
48          | IndexTensor of int * ty * ty
49          | ProjectLast of int * int * ty * ty
50          | ProjectFirst of int * int * ty * ty
51        | addSca        | addSca
52        | subSca        | subSca
53        | prodSca        | prodSca
54        | divSca        | divSca
55          | powRat of ty
56          | powInt
57        | addVec of int        | addVec of int
58        | subVec of int        | subVec of int
59        | prodVec of int        | prodVec of int
60        | prodScaV of int        | prodScaV of int
61        | sumVec of int        | sumVec of int
62          | dotVec of int
63        | Abs of ty        | Abs of ty
64        | LT of ty        | LT of ty
65        | LTE of ty        | LTE of ty
# Line 60  Line 72 
72        | Min        | Min
73        | Clamp of ty        | Clamp of ty
74        | Lerp of ty        | Lerp of ty
75          | Normalize of int
76        | PrincipleEvec of ty        | PrincipleEvec of ty
77        | EigenVecs2x2        | EigenVecs2x2
78        | EigenVecs3x3        | EigenVecs3x3
# Line 74  Line 87 
87        | Prepend of ty        | Prepend of ty
88        | Concat of ty        | Concat of ty
89        | Sqrt        | Sqrt
90          | Cosine
91          | ArcCosine
92          | Sine
93          | ArcSine
94        | Ceiling of int        | Ceiling of int
95        | Floor of int        | Floor of int
96        | Round of int        | Round of int
# Line 86  Line 103 
103        | ImageAddress of ImageInfo.info        | ImageAddress of ImageInfo.info
104        | LoadVoxels of ImageInfo.info * int        | LoadVoxels of ImageInfo.info * int
105        | Inside of ImageInfo.info * int        | Inside of ImageInfo.info * int
       | LoadSeq of ty * string  
       | LoadImage of ImageInfo.info  
106        | imgAddr of ImageInfo.info * ty * int        | imgAddr of ImageInfo.info * ty * int
107        | imgLoad of ImageInfo.info * int * int        | imgLoad of ImageInfo.info * int * int
108        | Input of ty * string * string        | baseAddr of ImageInfo.info
109        | InputWithDefault of ty * string * string        | LoadSeq of ty * string
110          | LoadImage of ty * string * ImageInfo.info
111          | Input of input
112        | Print of tys        | Print of tys
113    
114      fun resultArity IAdd = 1      fun resultArity IAdd = 1
# Line 99  Line 116 
116        | resultArity IMul = 1        | resultArity IMul = 1
117        | resultArity IDiv = 1        | resultArity IDiv = 1
118        | resultArity INeg = 1        | resultArity INeg = 1
119          | resultArity (R _) = 1
120        | resultArity (IndexTensor _) = 1        | resultArity (IndexTensor _) = 1
121          | resultArity (ProjectLast _) = 1
122          | resultArity (ProjectFirst _) = 1
123        | resultArity addSca = 1        | resultArity addSca = 1
124        | resultArity subSca = 1        | resultArity subSca = 1
125        | resultArity prodSca = 1        | resultArity prodSca = 1
126        | resultArity divSca = 1        | resultArity divSca = 1
127          | resultArity (powRat _) = 1
128          | resultArity powInt = 1
129        | resultArity (addVec _) = 1        | resultArity (addVec _) = 1
130        | resultArity (subVec _) = 1        | resultArity (subVec _) = 1
131        | resultArity (prodVec _) = 1        | resultArity (prodVec _) = 1
132        | resultArity (prodScaV _) = 1        | resultArity (prodScaV _) = 1
133        | resultArity (sumVec _) = 1        | resultArity (sumVec _) = 1
134          | resultArity (dotVec _) = 1
135        | resultArity (Abs _) = 1        | resultArity (Abs _) = 1
136        | resultArity (LT _) = 1        | resultArity (LT _) = 1
137        | resultArity (LTE _) = 1        | resultArity (LTE _) = 1
# Line 121  Line 144 
144        | resultArity Min = 1        | resultArity Min = 1
145        | resultArity (Clamp _) = 1        | resultArity (Clamp _) = 1
146        | resultArity (Lerp _) = 1        | resultArity (Lerp _) = 1
147          | resultArity (Normalize _) = 1
148        | resultArity (PrincipleEvec _) = 1        | resultArity (PrincipleEvec _) = 1
149        | resultArity EigenVecs2x2 = 1        | resultArity EigenVecs2x2 = 1
150        | resultArity EigenVecs3x3 = 1        | resultArity EigenVecs3x3 = 1
# Line 135  Line 159 
159        | resultArity (Prepend _) = 2        | resultArity (Prepend _) = 2
160        | resultArity (Concat _) = 2        | resultArity (Concat _) = 2
161        | resultArity Sqrt = 1        | resultArity Sqrt = 1
162          | resultArity Cosine = 1
163          | resultArity ArcCosine = 1
164          | resultArity Sine = 1
165          | resultArity ArcSine = 1
166        | resultArity (Ceiling _) = 1        | resultArity (Ceiling _) = 1
167        | resultArity (Floor _) = 1        | resultArity (Floor _) = 1
168        | resultArity (Round _) = 1        | resultArity (Round _) = 1
# Line 147  Line 175 
175        | resultArity (ImageAddress _) = 1        | resultArity (ImageAddress _) = 1
176        | resultArity (LoadVoxels _) = 1        | resultArity (LoadVoxels _) = 1
177        | resultArity (Inside _) = 1        | resultArity (Inside _) = 1
       | resultArity (LoadSeq _) = 1  
       | resultArity (LoadImage _) = 1  
178        | resultArity (imgAddr _) = 1        | resultArity (imgAddr _) = 1
179        | resultArity (imgLoad _) = 1        | resultArity (imgLoad _) = 1
180        | resultArity (Input _) = 1        | resultArity (baseAddr _) = 1
181        | resultArity (InputWithDefault _) = 1        | resultArity (LoadSeq _) = 1
182          | resultArity (LoadImage _) = 1
183          | resultArity (Input _) = 0
184        | resultArity (Print _) = 0        | resultArity (Print _) = 0
185    
186      fun arity IAdd = 2      fun arity IAdd = 2
# Line 160  Line 188 
188        | arity IMul = 2        | arity IMul = 2
189        | arity IDiv = 2        | arity IDiv = 2
190        | arity INeg = 1        | arity INeg = 1
191          | arity (R _) = 1
192        | arity (IndexTensor _) = 2        | arity (IndexTensor _) = 2
193          | arity (ProjectLast _) = 2
194          | arity (ProjectFirst _) = 2
195        | arity addSca = 2        | arity addSca = 2
196        | arity subSca = 2        | arity subSca = 2
197        | arity prodSca = 2        | arity prodSca = 2
198        | arity divSca = 2        | arity divSca = 2
199          | arity (powRat _) = 2
200          | arity powInt = 2
201        | arity (addVec _) = 2        | arity (addVec _) = 2
202        | arity (subVec _) = 2        | arity (subVec _) = 2
203        | arity (prodVec _) = 2        | arity (prodVec _) = 2
204        | arity (prodScaV _) = 2        | arity (prodScaV _) = 2
205        | arity (sumVec _) = 2        | arity (sumVec _) = 2
206          | arity (dotVec _) = 2
207        | arity (Abs _) = 1        | arity (Abs _) = 1
208        | arity (LT _) = 2        | arity (LT _) = 2
209        | arity (LTE _) = 2        | arity (LTE _) = 2
# Line 182  Line 216 
216        | arity Min = 2        | arity Min = 2
217        | arity (Clamp _) = 3        | arity (Clamp _) = 3
218        | arity (Lerp _) = 3        | arity (Lerp _) = 3
219          | arity (Normalize _) = 1
220        | arity (PrincipleEvec _) = 2        | arity (PrincipleEvec _) = 2
221        | arity EigenVecs2x2 = 1        | arity EigenVecs2x2 = 1
222        | arity EigenVecs3x3 = 1        | arity EigenVecs3x3 = 1
# Line 196  Line 231 
231        | arity (Prepend _) = 1        | arity (Prepend _) = 1
232        | arity (Concat _) = 1        | arity (Concat _) = 1
233        | arity Sqrt = 1        | arity Sqrt = 1
234          | arity Cosine = 1
235          | arity ArcCosine = 1
236          | arity Sine = 1
237          | arity ArcSine = 1
238        | arity (Ceiling _) = 1        | arity (Ceiling _) = 1
239        | arity (Floor _) = 1        | arity (Floor _) = 1
240        | arity (Round _) = 1        | arity (Round _) = 1
# Line 208  Line 247 
247        | arity (ImageAddress _) = 1        | arity (ImageAddress _) = 1
248        | arity (LoadVoxels _) = 1        | arity (LoadVoxels _) = 1
249        | arity (Inside _) = 2        | arity (Inside _) = 2
       | arity (LoadSeq _) = 0  
       | arity (LoadImage _) = 0  
250        | arity (imgAddr _) = 2        | arity (imgAddr _) = 2
251        | arity (imgLoad _) = 2        | arity (imgLoad _) = 2
252          | arity (baseAddr _) = 2
253          | arity (LoadSeq _) = 0
254          | arity (LoadImage _) = 0
255        | arity (Input _) = 0        | arity (Input _) = 0
       | arity (InputWithDefault _) = 1  
256        | arity (Print _) = ~1        | arity (Print _) = ~1
257    
258      fun isPure (MkDynamic _) = false      fun isPure (MkDynamic _) = false
259        | isPure (Append _) = false        | isPure (Append _) = false
260        | isPure (Prepend _) = false        | isPure (Prepend _) = false
261        | isPure (Concat _) = false        | isPure (Concat _) = false
262          | isPure (Input _) = false
263        | isPure (Print _) = false        | isPure (Print _) = false
264        | isPure _ = true        | isPure _ = true
265    
# Line 228  Line 268 
268        | same (IMul, IMul) = true        | same (IMul, IMul) = true
269        | same (IDiv, IDiv) = true        | same (IDiv, IDiv) = true
270        | same (INeg, INeg) = true        | same (INeg, INeg) = true
271        | same (IndexTensor(a0,a1,a2,a3), IndexTensor(b0,b1,b2,b3)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)        | same (R(a0), R(b0)) = samety(a0, b0)
272          | same (IndexTensor(a0,a1,a2), IndexTensor(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)
273          | same (ProjectLast(a0,a1,a2,a3), ProjectLast(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)
274          | same (ProjectFirst(a0,a1,a2,a3), ProjectFirst(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)
275        | same (addSca, addSca) = true        | same (addSca, addSca) = true
276        | same (subSca, subSca) = true        | same (subSca, subSca) = true
277        | same (prodSca, prodSca) = true        | same (prodSca, prodSca) = true
278        | same (divSca, divSca) = true        | same (divSca, divSca) = true
279          | same (powRat(a0), powRat(b0)) = samety(a0, b0)
280          | same (powInt, powInt) = true
281        | same (addVec(a0), addVec(b0)) = sameint(a0, b0)        | same (addVec(a0), addVec(b0)) = sameint(a0, b0)
282        | same (subVec(a0), subVec(b0)) = sameint(a0, b0)        | same (subVec(a0), subVec(b0)) = sameint(a0, b0)
283        | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)        | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)
284        | same (prodScaV(a0), prodScaV(b0)) = sameint(a0, b0)        | same (prodScaV(a0), prodScaV(b0)) = sameint(a0, b0)
285        | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)        | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)
286          | same (dotVec(a0), dotVec(b0)) = sameint(a0, b0)
287        | same (Abs(a0), Abs(b0)) = samety(a0, b0)        | same (Abs(a0), Abs(b0)) = samety(a0, b0)
288        | same (LT(a0), LT(b0)) = samety(a0, b0)        | same (LT(a0), LT(b0)) = samety(a0, b0)
289        | same (LTE(a0), LTE(b0)) = samety(a0, b0)        | same (LTE(a0), LTE(b0)) = samety(a0, b0)
# Line 250  Line 296 
296        | same (Min, Min) = true        | same (Min, Min) = true
297        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
298        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
299          | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)
300        | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)        | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)
301        | same (EigenVecs2x2, EigenVecs2x2) = true        | same (EigenVecs2x2, EigenVecs2x2) = true
302        | same (EigenVecs3x3, EigenVecs3x3) = true        | same (EigenVecs3x3, EigenVecs3x3) = true
# Line 264  Line 311 
311        | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)        | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
312        | same (Concat(a0), Concat(b0)) = samety(a0, b0)        | same (Concat(a0), Concat(b0)) = samety(a0, b0)
313        | same (Sqrt, Sqrt) = true        | same (Sqrt, Sqrt) = true
314          | same (Cosine, Cosine) = true
315          | same (ArcCosine, ArcCosine) = true
316          | same (Sine, Sine) = true
317          | same (ArcSine, ArcSine) = true
318        | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)        | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
319        | same (Floor(a0), Floor(b0)) = sameint(a0, b0)        | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
320        | same (Round(a0), Round(b0)) = sameint(a0, b0)        | same (Round(a0), Round(b0)) = sameint(a0, b0)
# Line 276  Line 327 
327        | same (ImageAddress(a0), ImageAddress(b0)) = ImageInfo.same(a0, b0)        | same (ImageAddress(a0), ImageAddress(b0)) = ImageInfo.same(a0, b0)
328        | 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)
329        | 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)
       | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)  
       | same (LoadImage(a0), LoadImage(b0)) = ImageInfo.same(a0, b0)  
330        | same (imgAddr(a0,a1,a2), imgAddr(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso samety(a1, b1) andalso sameint(a2, b2)        | same (imgAddr(a0,a1,a2), imgAddr(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso samety(a1, b1) andalso sameint(a2, b2)
331        | same (imgLoad(a0,a1,a2), imgLoad(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)        | same (imgLoad(a0,a1,a2), imgLoad(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
332        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (baseAddr(a0), baseAddr(b0)) = ImageInfo.same(a0, b0)
333        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
334          | same (LoadImage(a0,a1,a2), LoadImage(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso ImageInfo.same(a2, b2)
335          | same (Input(a0), Input(b0)) = sameinput(a0, b0)
336        | same (Print(a0), Print(b0)) = sametys(a0, b0)        | same (Print(a0), Print(b0)) = sametys(a0, b0)
337        | same _ = false        | same _ = false
338    
# Line 290  Line 341 
341        | hash IMul = 0w7        | hash IMul = 0w7
342        | hash IDiv = 0w11        | hash IDiv = 0w11
343        | hash INeg = 0w13        | hash INeg = 0w13
344        | hash (IndexTensor(a0,a1,a2,a3)) = 0w17 + hashint a0 + hashty a1 + hashty a2 + hashty a3        | hash (R(a0)) = 0w17 + hashty a0
345        | hash addSca = 0w19        | hash (IndexTensor(a0,a1,a2)) = 0w19 + hashint a0 + hashty a1 + hashty a2
346        | hash subSca = 0w23        | hash (ProjectLast(a0,a1,a2,a3)) = 0w23 + hashint a0 + hashint a1 + hashty a2 + hashty a3
347        | hash prodSca = 0w29        | hash (ProjectFirst(a0,a1,a2,a3)) = 0w29 + hashint a0 + hashint a1 + hashty a2 + hashty a3
348        | hash divSca = 0w31        | hash addSca = 0w31
349        | hash (addVec(a0)) = 0w37 + hashint a0        | hash subSca = 0w37
350        | hash (subVec(a0)) = 0w41 + hashint a0        | hash prodSca = 0w41
351        | hash (prodVec(a0)) = 0w43 + hashint a0        | hash divSca = 0w43
352        | hash (prodScaV(a0)) = 0w47 + hashint a0        | hash (powRat(a0)) = 0w47 + hashty a0
353        | hash (sumVec(a0)) = 0w53 + hashint a0        | hash powInt = 0w53
354        | hash (Abs(a0)) = 0w59 + hashty a0        | hash (addVec(a0)) = 0w59 + hashint a0
355        | hash (LT(a0)) = 0w61 + hashty a0        | hash (subVec(a0)) = 0w61 + hashint a0
356        | hash (LTE(a0)) = 0w67 + hashty a0        | hash (prodVec(a0)) = 0w67 + hashint a0
357        | hash (EQ(a0)) = 0w71 + hashty a0        | hash (prodScaV(a0)) = 0w71 + hashint a0
358        | hash (NEQ(a0)) = 0w73 + hashty a0        | hash (sumVec(a0)) = 0w73 + hashint a0
359        | hash (GT(a0)) = 0w79 + hashty a0        | hash (dotVec(a0)) = 0w79 + hashint a0
360        | hash (GTE(a0)) = 0w83 + hashty a0        | hash (Abs(a0)) = 0w83 + hashty a0
361        | hash Not = 0w89        | hash (LT(a0)) = 0w89 + hashty a0
362        | hash Max = 0w97        | hash (LTE(a0)) = 0w97 + hashty a0
363        | hash Min = 0w101        | hash (EQ(a0)) = 0w101 + hashty a0
364        | hash (Clamp(a0)) = 0w103 + hashty a0        | hash (NEQ(a0)) = 0w103 + hashty a0
365        | hash (Lerp(a0)) = 0w107 + hashty a0        | hash (GT(a0)) = 0w107 + hashty a0
366        | hash (PrincipleEvec(a0)) = 0w109 + hashty a0        | hash (GTE(a0)) = 0w109 + hashty a0
367        | hash EigenVecs2x2 = 0w113        | hash Not = 0w113
368        | hash EigenVecs3x3 = 0w127        | hash Max = 0w127
369        | hash EigenVals2x2 = 0w131        | hash Min = 0w131
370        | hash EigenVals3x3 = 0w137        | hash (Clamp(a0)) = 0w137 + hashty a0
371        | hash (Zero(a0)) = 0w139 + hashty a0        | hash (Lerp(a0)) = 0w139 + hashty a0
372        | hash (Select(a0,a1)) = 0w149 + hashty a0 + hashint a1        | hash (Normalize(a0)) = 0w149 + hashint a0
373        | hash (Index(a0,a1)) = 0w151 + hashty a0 + hashint a1        | hash (PrincipleEvec(a0)) = 0w151 + hashty a0
374        | hash (Subscript(a0)) = 0w157 + hashty a0        | hash EigenVecs2x2 = 0w157
375        | hash (MkDynamic(a0,a1)) = 0w163 + hashty a0 + hashint a1        | hash EigenVecs3x3 = 0w163
376        | hash (Append(a0)) = 0w167 + hashty a0        | hash EigenVals2x2 = 0w167
377        | hash (Prepend(a0)) = 0w173 + hashty a0        | hash EigenVals3x3 = 0w173
378        | hash (Concat(a0)) = 0w179 + hashty a0        | hash (Zero(a0)) = 0w179 + hashty a0
379        | hash Sqrt = 0w181        | hash (Select(a0,a1)) = 0w181 + hashty a0 + hashint a1
380        | hash (Ceiling(a0)) = 0w191 + hashint a0        | hash (Index(a0,a1)) = 0w191 + hashty a0 + hashint a1
381        | hash (Floor(a0)) = 0w193 + hashint a0        | hash (Subscript(a0)) = 0w193 + hashty a0
382        | hash (Round(a0)) = 0w197 + hashint a0        | hash (MkDynamic(a0,a1)) = 0w197 + hashty a0 + hashint a1
383        | hash (Trunc(a0)) = 0w199 + hashint a0        | hash (Append(a0)) = 0w199 + hashty a0
384        | hash IntToReal = 0w211        | hash (Prepend(a0)) = 0w211 + hashty a0
385        | hash (RealToInt(a0)) = 0w223 + hashint a0        | hash (Concat(a0)) = 0w223 + hashty a0
386        | hash (Transform(a0)) = 0w227 + ImageInfo.hash a0        | hash Sqrt = 0w227
387        | hash (Translate(a0)) = 0w229 + ImageInfo.hash a0        | hash Cosine = 0w229
388        | hash (Kernel(a0,a1)) = 0w233 + Kernel.hash a0 + hashint a1        | hash ArcCosine = 0w233
389        | hash (ImageAddress(a0)) = 0w239 + ImageInfo.hash a0        | hash Sine = 0w239
390        | hash (LoadVoxels(a0,a1)) = 0w241 + ImageInfo.hash a0 + hashint a1        | hash ArcSine = 0w241
391        | hash (Inside(a0,a1)) = 0w251 + ImageInfo.hash a0 + hashint a1        | hash (Ceiling(a0)) = 0w251 + hashint a0
392        | hash (LoadSeq(a0,a1)) = 0w257 + hashty a0 + hashstring a1        | hash (Floor(a0)) = 0w257 + hashint a0
393        | hash (LoadImage(a0)) = 0w263 + ImageInfo.hash a0        | hash (Round(a0)) = 0w263 + hashint a0
394        | hash (imgAddr(a0,a1,a2)) = 0w269 + ImageInfo.hash a0 + hashty a1 + hashint a2        | hash (Trunc(a0)) = 0w269 + hashint a0
395        | hash (imgLoad(a0,a1,a2)) = 0w271 + ImageInfo.hash a0 + hashint a1 + hashint a2        | hash IntToReal = 0w271
396        | hash (Input(a0,a1,a2)) = 0w277 + hashty a0 + hashstring a1 + hashstring a2        | hash (RealToInt(a0)) = 0w277 + hashint a0
397        | hash (InputWithDefault(a0,a1,a2)) = 0w281 + hashty a0 + hashstring a1 + hashstring a2        | hash (Transform(a0)) = 0w281 + ImageInfo.hash a0
398        | hash (Print(a0)) = 0w283 + hashtys a0        | hash (Translate(a0)) = 0w283 + ImageInfo.hash a0
399          | hash (Kernel(a0,a1)) = 0w293 + Kernel.hash a0 + hashint a1
400          | hash (ImageAddress(a0)) = 0w307 + ImageInfo.hash a0
401          | hash (LoadVoxels(a0,a1)) = 0w311 + ImageInfo.hash a0 + hashint a1
402          | hash (Inside(a0,a1)) = 0w313 + ImageInfo.hash a0 + hashint a1
403          | hash (imgAddr(a0,a1,a2)) = 0w317 + ImageInfo.hash a0 + hashty a1 + hashint a2
404          | hash (imgLoad(a0,a1,a2)) = 0w331 + ImageInfo.hash a0 + hashint a1 + hashint a2
405          | hash (baseAddr(a0)) = 0w337 + ImageInfo.hash a0
406          | hash (LoadSeq(a0,a1)) = 0w347 + hashty a0 + hashstring a1
407          | hash (LoadImage(a0,a1,a2)) = 0w349 + hashty a0 + hashstring a1 + ImageInfo.hash a2
408          | hash (Input(a0)) = 0w353 + hashinput a0
409          | hash (Print(a0)) = 0w359 + hashtys a0
410    
411      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
412        | toString ISub = "ISub"        | toString ISub = "ISub"
413        | toString IMul = "IMul"        | toString IMul = "IMul"
414        | toString IDiv = "IDiv"        | toString IDiv = "IDiv"
415        | toString INeg = "INeg"        | toString INeg = "INeg"
416        | toString (IndexTensor(a0,a1,a2,a3)) = concat["IndexTensor<", intToString a0, ",", tyToString a1, ",", tyToString a2, ",", tyToString a3, ">"]        | toString (R(a0)) = concat["R<", tyToString a0, ">"]
417          | toString (IndexTensor(a0,a1,a2)) = concat["IndexTensor<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]
418          | toString (ProjectLast(a0,a1,a2,a3)) = concat["ProjectLast<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
419          | toString (ProjectFirst(a0,a1,a2,a3)) = concat["ProjectFirst<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
420        | toString addSca = "addSca"        | toString addSca = "addSca"
421        | toString subSca = "subSca"        | toString subSca = "subSca"
422        | toString prodSca = "prodSca"        | toString prodSca = "prodSca"
423        | toString divSca = "divSca"        | toString divSca = "divSca"
424          | toString (powRat(a0)) = concat["powRat<", tyToString a0, ">"]
425          | toString powInt = "powInt"
426        | toString (addVec(a0)) = concat["addVec<", intToString a0, ">"]        | toString (addVec(a0)) = concat["addVec<", intToString a0, ">"]
427        | toString (subVec(a0)) = concat["subVec<", intToString a0, ">"]        | toString (subVec(a0)) = concat["subVec<", intToString a0, ">"]
428        | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]        | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]
429        | toString (prodScaV(a0)) = concat["prodScaV<", intToString a0, ">"]        | toString (prodScaV(a0)) = concat["prodScaV<", intToString a0, ">"]
430        | toString (sumVec(a0)) = concat["sumVec<", intToString a0, ">"]        | toString (sumVec(a0)) = concat["sumVec<", intToString a0, ">"]
431          | toString (dotVec(a0)) = concat["dotVec<", intToString a0, ">"]
432        | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]        | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
433        | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]        | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
434        | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]        | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
# Line 373  Line 441 
441        | toString Min = "Min"        | toString Min = "Min"
442        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
443        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
444          | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]
445        | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]        | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]
446        | toString EigenVecs2x2 = "EigenVecs2x2"        | toString EigenVecs2x2 = "EigenVecs2x2"
447        | toString EigenVecs3x3 = "EigenVecs3x3"        | toString EigenVecs3x3 = "EigenVecs3x3"
# Line 387  Line 456 
456        | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]        | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
457        | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]        | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
458        | toString Sqrt = "Sqrt"        | toString Sqrt = "Sqrt"
459          | toString Cosine = "Cosine"
460          | toString ArcCosine = "ArcCosine"
461          | toString Sine = "Sine"
462          | toString ArcSine = "ArcSine"
463        | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]        | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
464        | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]        | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
465        | toString (Round(a0)) = concat["Round<", intToString a0, ">"]        | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
# Line 399  Line 472 
472        | toString (ImageAddress(a0)) = concat["ImageAddress<", ImageInfo.toString a0, ">"]        | toString (ImageAddress(a0)) = concat["ImageAddress<", ImageInfo.toString a0, ">"]
473        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
474        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
       | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]  
       | toString (LoadImage(a0)) = concat["LoadImage<", ImageInfo.toString a0, ">"]  
475        | toString (imgAddr(a0,a1,a2)) = concat["imgAddr<", ImageInfo.toString a0, ",", tyToString a1, ",", intToString a2, ">"]        | toString (imgAddr(a0,a1,a2)) = concat["imgAddr<", ImageInfo.toString a0, ",", tyToString a1, ",", intToString a2, ">"]
476        | toString (imgLoad(a0,a1,a2)) = concat["imgLoad<", ImageInfo.toString a0, ",", intToString a1, ",", intToString a2, ">"]        | toString (imgLoad(a0,a1,a2)) = concat["imgLoad<", ImageInfo.toString a0, ",", intToString a1, ",", intToString a2, ">"]
477        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (baseAddr(a0)) = concat["baseAddr<", ImageInfo.toString a0, ">"]
478        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
479          | toString (LoadImage(a0,a1,a2)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ",", ImageInfo.toString a2, ">"]
480          | toString (Input(a0)) = concat["Input<", inputToString a0, ">"]
481        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
482    
483    end    end

Legend:
Removed from v.2668  
changed lines
  Added in v.3195

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