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 2628, Wed May 21 04:02:06 2014 UTC revision 2668, Thu Jun 12 03:29:04 2014 UTC
# Line 38  Line 38 
38        | IMul        | IMul
39        | IDiv        | IDiv
40        | INeg        | INeg
41        | C of int        | IndexTensor of int * ty * ty * ty
       | V of int * int * ty * ty  
       | S of int * ty * ty  
42        | addSca        | addSca
43        | subSca        | subSca
44        | prodSca        | prodSca
# Line 62  Line 60 
60        | Min        | Min
61        | Clamp of ty        | Clamp of ty
62        | Lerp of ty        | Lerp of ty
       | Norm of ty  
       | Normalize of int  
63        | PrincipleEvec of ty        | PrincipleEvec of ty
64        | EigenVecs2x2        | EigenVecs2x2
65        | EigenVecs3x3        | EigenVecs3x3
# Line 77  Line 73 
73        | Append of ty        | Append of ty
74        | Prepend of ty        | Prepend of ty
75        | Concat of ty        | Concat of ty
76        | Length of ty        | Sqrt
77        | Ceiling of int        | Ceiling of int
78        | Floor of int        | Floor of int
79        | Round of int        | Round of int
# Line 103  Line 99 
99        | resultArity IMul = 1        | resultArity IMul = 1
100        | resultArity IDiv = 1        | resultArity IDiv = 1
101        | resultArity INeg = 1        | resultArity INeg = 1
102        | resultArity (C _) = 1        | resultArity (IndexTensor _) = 1
       | resultArity (V _) = 1  
       | resultArity (S _) = 1  
103        | resultArity addSca = 1        | resultArity addSca = 1
104        | resultArity subSca = 1        | resultArity subSca = 1
105        | resultArity prodSca = 1        | resultArity prodSca = 1
# Line 127  Line 121 
121        | resultArity Min = 1        | resultArity Min = 1
122        | resultArity (Clamp _) = 1        | resultArity (Clamp _) = 1
123        | resultArity (Lerp _) = 1        | resultArity (Lerp _) = 1
       | resultArity (Norm _) = 1  
       | resultArity (Normalize _) = 1  
124        | resultArity (PrincipleEvec _) = 1        | resultArity (PrincipleEvec _) = 1
125        | resultArity EigenVecs2x2 = 1        | resultArity EigenVecs2x2 = 1
126        | resultArity EigenVecs3x3 = 1        | resultArity EigenVecs3x3 = 1
# Line 142  Line 134 
134        | resultArity (Append _) = 2        | resultArity (Append _) = 2
135        | resultArity (Prepend _) = 2        | resultArity (Prepend _) = 2
136        | resultArity (Concat _) = 2        | resultArity (Concat _) = 2
137        | resultArity (Length _) = 1        | resultArity Sqrt = 1
138        | resultArity (Ceiling _) = 1        | resultArity (Ceiling _) = 1
139        | resultArity (Floor _) = 1        | resultArity (Floor _) = 1
140        | resultArity (Round _) = 1        | resultArity (Round _) = 1
# Line 168  Line 160 
160        | arity IMul = 2        | arity IMul = 2
161        | arity IDiv = 2        | arity IDiv = 2
162        | arity INeg = 1        | arity INeg = 1
163        | arity (C _) = 2        | arity (IndexTensor _) = 2
       | arity (V _) = 2  
       | arity (S _) = 2  
164        | arity addSca = 2        | arity addSca = 2
165        | arity subSca = 2        | arity subSca = 2
166        | arity prodSca = 2        | arity prodSca = 2
# Line 192  Line 182 
182        | arity Min = 2        | arity Min = 2
183        | arity (Clamp _) = 3        | arity (Clamp _) = 3
184        | arity (Lerp _) = 3        | arity (Lerp _) = 3
       | arity (Norm _) = 1  
       | arity (Normalize _) = 1  
185        | arity (PrincipleEvec _) = 2        | arity (PrincipleEvec _) = 2
186        | arity EigenVecs2x2 = 1        | arity EigenVecs2x2 = 1
187        | arity EigenVecs3x3 = 1        | arity EigenVecs3x3 = 1
# Line 207  Line 195 
195        | arity (Append _) = 1        | arity (Append _) = 1
196        | arity (Prepend _) = 1        | arity (Prepend _) = 1
197        | arity (Concat _) = 1        | arity (Concat _) = 1
198        | arity (Length _) = 1        | arity Sqrt = 1
199        | arity (Ceiling _) = 1        | arity (Ceiling _) = 1
200        | arity (Floor _) = 1        | arity (Floor _) = 1
201        | arity (Round _) = 1        | arity (Round _) = 1
# Line 240  Line 228 
228        | same (IMul, IMul) = true        | same (IMul, IMul) = true
229        | same (IDiv, IDiv) = true        | same (IDiv, IDiv) = true
230        | same (INeg, INeg) = true        | same (INeg, INeg) = true
231        | same (C(a0), C(b0)) = sameint(a0, b0)        | 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 (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)  
       | same (S(a0,a1,a2), S(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)  
232        | same (addSca, addSca) = true        | same (addSca, addSca) = true
233        | same (subSca, subSca) = true        | same (subSca, subSca) = true
234        | same (prodSca, prodSca) = true        | same (prodSca, prodSca) = true
# Line 264  Line 250 
250        | same (Min, Min) = true        | same (Min, Min) = true
251        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
252        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
       | same (Norm(a0), Norm(b0)) = samety(a0, b0)  
       | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)  
253        | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)        | same (PrincipleEvec(a0), PrincipleEvec(b0)) = samety(a0, b0)
254        | same (EigenVecs2x2, EigenVecs2x2) = true        | same (EigenVecs2x2, EigenVecs2x2) = true
255        | same (EigenVecs3x3, EigenVecs3x3) = true        | same (EigenVecs3x3, EigenVecs3x3) = true
# Line 279  Line 263 
263        | same (Append(a0), Append(b0)) = samety(a0, b0)        | same (Append(a0), Append(b0)) = samety(a0, b0)
264        | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)        | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
265        | same (Concat(a0), Concat(b0)) = samety(a0, b0)        | same (Concat(a0), Concat(b0)) = samety(a0, b0)
266        | same (Length(a0), Length(b0)) = samety(a0, b0)        | same (Sqrt, Sqrt) = true
267        | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)        | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
268        | same (Floor(a0), Floor(b0)) = sameint(a0, b0)        | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
269        | same (Round(a0), Round(b0)) = sameint(a0, b0)        | same (Round(a0), Round(b0)) = sameint(a0, b0)
# Line 306  Line 290 
290        | hash IMul = 0w7        | hash IMul = 0w7
291        | hash IDiv = 0w11        | hash IDiv = 0w11
292        | hash INeg = 0w13        | hash INeg = 0w13
293        | hash (C(a0)) = 0w17 + hashint a0        | hash (IndexTensor(a0,a1,a2,a3)) = 0w17 + hashint a0 + hashty a1 + hashty a2 + hashty a3
294        | hash (V(a0,a1,a2,a3)) = 0w19 + hashint a0 + hashint a1 + hashty a2 + hashty a3        | hash addSca = 0w19
295        | hash (S(a0,a1,a2)) = 0w23 + hashint a0 + hashty a1 + hashty a2        | hash subSca = 0w23
296        | hash addSca = 0w29        | hash prodSca = 0w29
297        | hash subSca = 0w31        | hash divSca = 0w31
298        | hash prodSca = 0w37        | hash (addVec(a0)) = 0w37 + hashint a0
299        | hash divSca = 0w41        | hash (subVec(a0)) = 0w41 + hashint a0
300        | hash (addVec(a0)) = 0w43 + hashint a0        | hash (prodVec(a0)) = 0w43 + hashint a0
301        | hash (subVec(a0)) = 0w47 + hashint a0        | hash (prodScaV(a0)) = 0w47 + hashint a0
302        | hash (prodVec(a0)) = 0w53 + hashint a0        | hash (sumVec(a0)) = 0w53 + hashint a0
303        | hash (prodScaV(a0)) = 0w59 + hashint a0        | hash (Abs(a0)) = 0w59 + hashty a0
304        | hash (sumVec(a0)) = 0w61 + hashint a0        | hash (LT(a0)) = 0w61 + hashty a0
305        | hash (Abs(a0)) = 0w67 + hashty a0        | hash (LTE(a0)) = 0w67 + hashty a0
306        | hash (LT(a0)) = 0w71 + hashty a0        | hash (EQ(a0)) = 0w71 + hashty a0
307        | hash (LTE(a0)) = 0w73 + hashty a0        | hash (NEQ(a0)) = 0w73 + hashty a0
308        | hash (EQ(a0)) = 0w79 + hashty a0        | hash (GT(a0)) = 0w79 + hashty a0
309        | hash (NEQ(a0)) = 0w83 + hashty a0        | hash (GTE(a0)) = 0w83 + hashty a0
310        | hash (GT(a0)) = 0w89 + hashty a0        | hash Not = 0w89
311        | hash (GTE(a0)) = 0w97 + hashty a0        | hash Max = 0w97
312        | hash Not = 0w101        | hash Min = 0w101
313        | hash Max = 0w103        | hash (Clamp(a0)) = 0w103 + hashty a0
314        | hash Min = 0w107        | hash (Lerp(a0)) = 0w107 + hashty a0
315        | hash (Clamp(a0)) = 0w109 + hashty a0        | hash (PrincipleEvec(a0)) = 0w109 + hashty a0
316        | hash (Lerp(a0)) = 0w113 + hashty a0        | hash EigenVecs2x2 = 0w113
317        | hash (Norm(a0)) = 0w127 + hashty a0        | hash EigenVecs3x3 = 0w127
318        | hash (Normalize(a0)) = 0w131 + hashint a0        | hash EigenVals2x2 = 0w131
319        | hash (PrincipleEvec(a0)) = 0w137 + hashty a0        | hash EigenVals3x3 = 0w137
320        | hash EigenVecs2x2 = 0w139        | hash (Zero(a0)) = 0w139 + hashty a0
321        | hash EigenVecs3x3 = 0w149        | hash (Select(a0,a1)) = 0w149 + hashty a0 + hashint a1
322        | hash EigenVals2x2 = 0w151        | hash (Index(a0,a1)) = 0w151 + hashty a0 + hashint a1
323        | hash EigenVals3x3 = 0w157        | hash (Subscript(a0)) = 0w157 + hashty a0
324        | hash (Zero(a0)) = 0w163 + hashty a0        | hash (MkDynamic(a0,a1)) = 0w163 + hashty a0 + hashint a1
325        | hash (Select(a0,a1)) = 0w167 + hashty a0 + hashint a1        | hash (Append(a0)) = 0w167 + hashty a0
326        | hash (Index(a0,a1)) = 0w173 + hashty a0 + hashint a1        | hash (Prepend(a0)) = 0w173 + hashty a0
327        | hash (Subscript(a0)) = 0w179 + hashty a0        | hash (Concat(a0)) = 0w179 + hashty a0
328        | hash (MkDynamic(a0,a1)) = 0w181 + hashty a0 + hashint a1        | hash Sqrt = 0w181
329        | hash (Append(a0)) = 0w191 + hashty a0        | hash (Ceiling(a0)) = 0w191 + hashint a0
330        | hash (Prepend(a0)) = 0w193 + hashty a0        | hash (Floor(a0)) = 0w193 + hashint a0
331        | hash (Concat(a0)) = 0w197 + hashty a0        | hash (Round(a0)) = 0w197 + hashint a0
332        | hash (Length(a0)) = 0w199 + hashty a0        | hash (Trunc(a0)) = 0w199 + hashint a0
333        | hash (Ceiling(a0)) = 0w211 + hashint a0        | hash IntToReal = 0w211
334        | hash (Floor(a0)) = 0w223 + hashint a0        | hash (RealToInt(a0)) = 0w223 + hashint a0
335        | hash (Round(a0)) = 0w227 + hashint a0        | hash (Transform(a0)) = 0w227 + ImageInfo.hash a0
336        | hash (Trunc(a0)) = 0w229 + hashint a0        | hash (Translate(a0)) = 0w229 + ImageInfo.hash a0
337        | hash IntToReal = 0w233        | hash (Kernel(a0,a1)) = 0w233 + Kernel.hash a0 + hashint a1
338        | hash (RealToInt(a0)) = 0w239 + hashint a0        | hash (ImageAddress(a0)) = 0w239 + ImageInfo.hash a0
339        | hash (Transform(a0)) = 0w241 + ImageInfo.hash a0        | hash (LoadVoxels(a0,a1)) = 0w241 + ImageInfo.hash a0 + hashint a1
340        | hash (Translate(a0)) = 0w251 + ImageInfo.hash a0        | hash (Inside(a0,a1)) = 0w251 + ImageInfo.hash a0 + hashint a1
341        | hash (Kernel(a0,a1)) = 0w257 + Kernel.hash a0 + hashint a1        | hash (LoadSeq(a0,a1)) = 0w257 + hashty a0 + hashstring a1
342        | hash (ImageAddress(a0)) = 0w263 + ImageInfo.hash a0        | hash (LoadImage(a0)) = 0w263 + ImageInfo.hash a0
343        | hash (LoadVoxels(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1        | hash (imgAddr(a0,a1,a2)) = 0w269 + ImageInfo.hash a0 + hashty a1 + hashint a2
344        | hash (Inside(a0,a1)) = 0w271 + ImageInfo.hash a0 + hashint a1        | hash (imgLoad(a0,a1,a2)) = 0w271 + ImageInfo.hash a0 + hashint a1 + hashint a2
345        | hash (LoadSeq(a0,a1)) = 0w277 + hashty a0 + hashstring a1        | hash (Input(a0,a1,a2)) = 0w277 + hashty a0 + hashstring a1 + hashstring a2
346        | hash (LoadImage(a0)) = 0w281 + ImageInfo.hash a0        | hash (InputWithDefault(a0,a1,a2)) = 0w281 + hashty a0 + hashstring a1 + hashstring a2
347        | hash (imgAddr(a0,a1,a2)) = 0w283 + ImageInfo.hash a0 + hashty a1 + hashint a2        | hash (Print(a0)) = 0w283 + hashtys a0
       | hash (imgLoad(a0,a1,a2)) = 0w293 + ImageInfo.hash a0 + hashint a1 + hashint a2  
       | hash (Input(a0,a1,a2)) = 0w307 + hashty a0 + hashstring a1 + hashstring a2  
       | hash (InputWithDefault(a0,a1,a2)) = 0w311 + hashty a0 + hashstring a1 + hashstring a2  
       | hash (Print(a0)) = 0w313 + hashtys a0  
348    
349      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
350        | toString ISub = "ISub"        | toString ISub = "ISub"
351        | toString IMul = "IMul"        | toString IMul = "IMul"
352        | toString IDiv = "IDiv"        | toString IDiv = "IDiv"
353        | toString INeg = "INeg"        | toString INeg = "INeg"
354        | toString (C(a0)) = concat["C<", intToString a0, ">"]        | toString (IndexTensor(a0,a1,a2,a3)) = concat["IndexTensor<", intToString a0, ",", tyToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
       | toString (V(a0,a1,a2,a3)) = concat["V<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]  
       | toString (S(a0,a1,a2)) = concat["S<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]  
355        | toString addSca = "addSca"        | toString addSca = "addSca"
356        | toString subSca = "subSca"        | toString subSca = "subSca"
357        | toString prodSca = "prodSca"        | toString prodSca = "prodSca"
# Line 395  Line 373 
373        | toString Min = "Min"        | toString Min = "Min"
374        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
375        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
       | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]  
       | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]  
376        | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]        | toString (PrincipleEvec(a0)) = concat["PrincipleEvec<", tyToString a0, ">"]
377        | toString EigenVecs2x2 = "EigenVecs2x2"        | toString EigenVecs2x2 = "EigenVecs2x2"
378        | toString EigenVecs3x3 = "EigenVecs3x3"        | toString EigenVecs3x3 = "EigenVecs3x3"
# Line 410  Line 386 
386        | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]        | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
387        | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]        | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
388        | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]        | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
389        | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]        | toString Sqrt = "Sqrt"
390        | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]        | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
391        | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]        | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
392        | toString (Round(a0)) = concat["Round<", intToString a0, ">"]        | toString (Round(a0)) = concat["Round<", intToString a0, ">"]

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

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