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

SCM Repository

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

Diff of /trunk/src/compiler/low-il/low-il.sml

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

revision 2355, Sun Apr 7 11:35:08 2013 UTC revision 2356, Sun Apr 7 14:45:25 2013 UTC
# Line 54  Line 54 
54        | MulVecMat of int * int        | MulVecMat of int * int
55        | MulMatVec of int * int        | MulMatVec of int * int
56        | MulMatMat of int * int * int        | MulMatMat of int * int * int
57          | MulVecTen3 of int * int * int
58          | MulTen3Vec of int * int * int
59          | ColonMul of ty * ty
60        | Cross        | Cross
61        | Norm of ty        | Norm of ty
62        | Normalize of int        | Normalize of int
# Line 65  Line 68 
68        | EigenVals3x3        | EigenVals3x3
69        | Identity of int        | Identity of int
70        | Zero of ty        | Zero of ty
71          | Transpose of int * int
72        | Select of ty * int        | Select of ty * int
73        | Index of ty * int        | Index of ty * int
74        | Subscript of ty        | Subscript of ty
# Line 105  Line 109 
109        | resultArity (MulVecMat _) = 1        | resultArity (MulVecMat _) = 1
110        | resultArity (MulMatVec _) = 1        | resultArity (MulMatVec _) = 1
111        | resultArity (MulMatMat _) = 1        | resultArity (MulMatMat _) = 1
112          | resultArity (MulVecTen3 _) = 1
113          | resultArity (MulTen3Vec _) = 1
114          | resultArity (ColonMul _) = 1
115        | resultArity Cross = 1        | resultArity Cross = 1
116        | resultArity (Norm _) = 1        | resultArity (Norm _) = 1
117        | resultArity (Normalize _) = 1        | resultArity (Normalize _) = 1
# Line 116  Line 123 
123        | resultArity EigenVals3x3 = 1        | resultArity EigenVals3x3 = 1
124        | resultArity (Identity _) = 1        | resultArity (Identity _) = 1
125        | resultArity (Zero _) = 1        | resultArity (Zero _) = 1
126          | resultArity (Transpose _) = 1
127        | resultArity (Select _) = 1        | resultArity (Select _) = 1
128        | resultArity (Index _) = 1        | resultArity (Index _) = 1
129        | resultArity (Subscript _) = 1        | resultArity (Subscript _) = 1
# Line 156  Line 164 
164        | arity (MulVecMat _) = 2        | arity (MulVecMat _) = 2
165        | arity (MulMatVec _) = 2        | arity (MulMatVec _) = 2
166        | arity (MulMatMat _) = 2        | arity (MulMatMat _) = 2
167          | arity (MulVecTen3 _) = 2
168          | arity (MulTen3Vec _) = 2
169          | arity (ColonMul _) = 2
170        | arity Cross = 2        | arity Cross = 2
171        | arity (Norm _) = 1        | arity (Norm _) = 1
172        | arity (Normalize _) = 1        | arity (Normalize _) = 1
# Line 167  Line 178 
178        | arity EigenVals3x3 = 1        | arity EigenVals3x3 = 1
179        | arity (Identity _) = 0        | arity (Identity _) = 0
180        | arity (Zero _) = 0        | arity (Zero _) = 0
181          | arity (Transpose _) = 1
182        | arity (Select _) = 1        | arity (Select _) = 1
183        | arity (Index _) = 1        | arity (Index _) = 1
184        | arity (Subscript _) = 2        | arity (Subscript _) = 2
# Line 186  Line 198 
198        | arity (InputWithDefault _) = 1        | arity (InputWithDefault _) = 1
199        | arity (Print _) = ~1        | arity (Print _) = ~1
200    
201        fun isPure (Print _) = false
202          | isPure _ = true
203    
204      fun same (Add(a0), Add(b0)) = samety(a0, b0)      fun same (Add(a0), Add(b0)) = samety(a0, b0)
205        | same (Sub(a0), Sub(b0)) = samety(a0, b0)        | same (Sub(a0), Sub(b0)) = samety(a0, b0)
206        | same (Mul(a0), Mul(b0)) = samety(a0, b0)        | same (Mul(a0), Mul(b0)) = samety(a0, b0)
# Line 207  Line 222 
222        | same (MulVecMat(a0,a1), MulVecMat(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)        | same (MulVecMat(a0,a1), MulVecMat(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
223        | same (MulMatVec(a0,a1), MulMatVec(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)        | same (MulMatVec(a0,a1), MulMatVec(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
224        | same (MulMatMat(a0,a1,a2), MulMatMat(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)        | same (MulMatMat(a0,a1,a2), MulMatMat(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
225          | same (MulVecTen3(a0,a1,a2), MulVecTen3(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
226          | same (MulTen3Vec(a0,a1,a2), MulTen3Vec(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
227          | same (ColonMul(a0,a1), ColonMul(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
228        | same (Cross, Cross) = true        | same (Cross, Cross) = true
229        | same (Norm(a0), Norm(b0)) = samety(a0, b0)        | same (Norm(a0), Norm(b0)) = samety(a0, b0)
230        | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)        | same (Normalize(a0), Normalize(b0)) = sameint(a0, b0)
# Line 218  Line 236 
236        | same (EigenVals3x3, EigenVals3x3) = true        | same (EigenVals3x3, EigenVals3x3) = true
237        | same (Identity(a0), Identity(b0)) = sameint(a0, b0)        | same (Identity(a0), Identity(b0)) = sameint(a0, b0)
238        | same (Zero(a0), Zero(b0)) = samety(a0, b0)        | same (Zero(a0), Zero(b0)) = samety(a0, b0)
239          | same (Transpose(a0,a1), Transpose(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
240        | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)        | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
241        | same (Index(a0,a1), Index(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)        | same (Index(a0,a1), Index(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
242        | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)        | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
# Line 259  Line 278 
278        | hash (MulVecMat(a0,a1)) = 0w71 + hashint a0 + hashint a1        | hash (MulVecMat(a0,a1)) = 0w71 + hashint a0 + hashint a1
279        | hash (MulMatVec(a0,a1)) = 0w73 + hashint a0 + hashint a1        | hash (MulMatVec(a0,a1)) = 0w73 + hashint a0 + hashint a1
280        | hash (MulMatMat(a0,a1,a2)) = 0w79 + hashint a0 + hashint a1 + hashint a2        | hash (MulMatMat(a0,a1,a2)) = 0w79 + hashint a0 + hashint a1 + hashint a2
281        | hash Cross = 0w83        | hash (MulVecTen3(a0,a1,a2)) = 0w83 + hashint a0 + hashint a1 + hashint a2
282        | hash (Norm(a0)) = 0w89 + hashty a0        | hash (MulTen3Vec(a0,a1,a2)) = 0w89 + hashint a0 + hashint a1 + hashint a2
283        | hash (Normalize(a0)) = 0w97 + hashint a0        | hash (ColonMul(a0,a1)) = 0w97 + hashty a0 + hashty a1
284        | hash (Scale(a0)) = 0w101 + hashty a0        | hash Cross = 0w101
285        | hash (PrincipleEvec(a0)) = 0w103 + hashty a0        | hash (Norm(a0)) = 0w103 + hashty a0
286        | hash EigenVecs2x2 = 0w107        | hash (Normalize(a0)) = 0w107 + hashint a0
287        | hash EigenVecs3x3 = 0w109        | hash (Scale(a0)) = 0w109 + hashty a0
288        | hash EigenVals2x2 = 0w113        | hash (PrincipleEvec(a0)) = 0w113 + hashty a0
289        | hash EigenVals3x3 = 0w127        | hash EigenVecs2x2 = 0w127
290        | hash (Identity(a0)) = 0w131 + hashint a0        | hash EigenVecs3x3 = 0w131
291        | hash (Zero(a0)) = 0w137 + hashty a0        | hash EigenVals2x2 = 0w137
292        | hash (Select(a0,a1)) = 0w139 + hashty a0 + hashint a1        | hash EigenVals3x3 = 0w139
293        | hash (Index(a0,a1)) = 0w149 + hashty a0 + hashint a1        | hash (Identity(a0)) = 0w149 + hashint a0
294        | hash (Subscript(a0)) = 0w151 + hashty a0        | hash (Zero(a0)) = 0w151 + hashty a0
295        | hash (Ceiling(a0)) = 0w157 + hashint a0        | hash (Transpose(a0,a1)) = 0w157 + hashint a0 + hashint a1
296        | hash (Floor(a0)) = 0w163 + hashint a0        | hash (Select(a0,a1)) = 0w163 + hashty a0 + hashint a1
297        | hash (Round(a0)) = 0w167 + hashint a0        | hash (Index(a0,a1)) = 0w167 + hashty a0 + hashint a1
298        | hash (Trunc(a0)) = 0w173 + hashint a0        | hash (Subscript(a0)) = 0w173 + hashty a0
299        | hash IntToReal = 0w179        | hash (Ceiling(a0)) = 0w179 + hashint a0
300        | hash (RealToInt(a0)) = 0w181 + hashint a0        | hash (Floor(a0)) = 0w181 + hashint a0
301        | hash (ImageAddress(a0)) = 0w191 + ImageInfo.hash a0        | hash (Round(a0)) = 0w191 + hashint a0
302        | hash (LoadVoxels(a0,a1)) = 0w193 + ImageInfo.hash a0 + hashint a1        | hash (Trunc(a0)) = 0w193 + hashint a0
303        | hash (PosToImgSpace(a0)) = 0w197 + ImageInfo.hash a0        | hash IntToReal = 0w197
304        | hash (TensorToWorldSpace(a0,a1)) = 0w199 + ImageInfo.hash a0 + hashty a1        | hash (RealToInt(a0)) = 0w199 + hashint a0
305        | hash (LoadImage(a0)) = 0w211 + ImageInfo.hash a0        | hash (ImageAddress(a0)) = 0w211 + ImageInfo.hash a0
306        | hash (Inside(a0,a1)) = 0w223 + ImageInfo.hash a0 + hashint a1        | hash (LoadVoxels(a0,a1)) = 0w223 + ImageInfo.hash a0 + hashint a1
307        | hash (Input(a0,a1,a2)) = 0w227 + hashty a0 + hashstring a1 + hashstring a2        | hash (PosToImgSpace(a0)) = 0w227 + ImageInfo.hash a0
308        | hash (InputWithDefault(a0,a1,a2)) = 0w229 + hashty a0 + hashstring a1 + hashstring a2        | hash (TensorToWorldSpace(a0,a1)) = 0w229 + ImageInfo.hash a0 + hashty a1
309        | hash (Print(a0)) = 0w233 + hashtys a0        | hash (LoadImage(a0)) = 0w233 + ImageInfo.hash a0
310          | hash (Inside(a0,a1)) = 0w239 + ImageInfo.hash a0 + hashint a1
311          | hash (Input(a0,a1,a2)) = 0w241 + hashty a0 + hashstring a1 + hashstring a2
312          | hash (InputWithDefault(a0,a1,a2)) = 0w251 + hashty a0 + hashstring a1 + hashstring a2
313          | hash (Print(a0)) = 0w257 + hashtys a0
314    
315      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]
316        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]
# Line 310  Line 333 
333        | toString (MulVecMat(a0,a1)) = concat["MulVecMat<", intToString a0, ",", intToString a1, ">"]        | toString (MulVecMat(a0,a1)) = concat["MulVecMat<", intToString a0, ",", intToString a1, ">"]
334        | toString (MulMatVec(a0,a1)) = concat["MulMatVec<", intToString a0, ",", intToString a1, ">"]        | toString (MulMatVec(a0,a1)) = concat["MulMatVec<", intToString a0, ",", intToString a1, ">"]
335        | toString (MulMatMat(a0,a1,a2)) = concat["MulMatMat<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]        | toString (MulMatMat(a0,a1,a2)) = concat["MulMatMat<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
336          | toString (MulVecTen3(a0,a1,a2)) = concat["MulVecTen3<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
337          | toString (MulTen3Vec(a0,a1,a2)) = concat["MulTen3Vec<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
338          | toString (ColonMul(a0,a1)) = concat["ColonMul<", tyToString a0, ",", tyToString a1, ">"]
339        | toString Cross = "Cross"        | toString Cross = "Cross"
340        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]
341        | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]        | toString (Normalize(a0)) = concat["Normalize<", intToString a0, ">"]
# Line 321  Line 347 
347        | toString EigenVals3x3 = "EigenVals3x3"        | toString EigenVals3x3 = "EigenVals3x3"
348        | toString (Identity(a0)) = concat["Identity<", intToString a0, ">"]        | toString (Identity(a0)) = concat["Identity<", intToString a0, ">"]
349        | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]        | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
350          | toString (Transpose(a0,a1)) = concat["Transpose<", intToString a0, ",", intToString a1, ">"]
351        | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]        | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
352        | toString (Index(a0,a1)) = concat["Index<", tyToString a0, ",", intToString a1, ">"]        | toString (Index(a0,a1)) = concat["Index<", tyToString a0, ",", intToString a1, ">"]
353        | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]        | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]

Legend:
Removed from v.2355  
changed lines
  Added in v.2356

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