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

SCM Repository

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

Diff of /trunk/src/compiler/high-il/high-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 65  Line 65 
65        | MulVecMat of ty        | MulVecMat of ty
66        | MulMatVec of ty        | MulMatVec of ty
67        | MulMatMat of ty * ty        | MulMatMat of ty * ty
68          | MulVecTen3 of ty
69          | MulTen3Vec of ty
70          | ColonMul of ty * ty
71        | Cross        | Cross
72        | Outer of ty        | Outer of ty
73        | Norm of ty        | Norm of ty
# Line 76  Line 79 
79        | Identity of int        | Identity of int
80        | Zero of ty        | Zero of ty
81        | Trace of ty        | Trace of ty
82          | Transpose of int * int
83        | Slice of ty * mask        | Slice of ty * mask
84        | TensorSub of ty        | TensorSub of ty
85        | Select of ty * int        | Select of ty * int
# Line 93  Line 97 
97        | AddField        | AddField
98        | SubField        | SubField
99        | ScaleField        | ScaleField
100          | OffsetField
101        | NegField        | NegField
102        | DiffField        | DiffField
103          | CurlField of int
104        | Input of ty * string * string        | Input of ty * string * string
105        | InputWithDefault of ty * string * string        | InputWithDefault of ty * string * string
106        | Print of tys        | Print of tys
# Line 121  Line 127 
127        | resultArity (MulVecMat _) = 1        | resultArity (MulVecMat _) = 1
128        | resultArity (MulMatVec _) = 1        | resultArity (MulMatVec _) = 1
129        | resultArity (MulMatMat _) = 1        | resultArity (MulMatMat _) = 1
130          | resultArity (MulVecTen3 _) = 1
131          | resultArity (MulTen3Vec _) = 1
132          | resultArity (ColonMul _) = 1
133        | resultArity Cross = 1        | resultArity Cross = 1
134        | resultArity (Outer _) = 1        | resultArity (Outer _) = 1
135        | resultArity (Norm _) = 1        | resultArity (Norm _) = 1
# Line 132  Line 141 
141        | resultArity (Identity _) = 1        | resultArity (Identity _) = 1
142        | resultArity (Zero _) = 1        | resultArity (Zero _) = 1
143        | resultArity (Trace _) = 1        | resultArity (Trace _) = 1
144          | resultArity (Transpose _) = 1
145        | resultArity (Slice _) = 1        | resultArity (Slice _) = 1
146        | resultArity (TensorSub _) = 1        | resultArity (TensorSub _) = 1
147        | resultArity (Select _) = 1        | resultArity (Select _) = 1
# Line 149  Line 159 
159        | resultArity AddField = 1        | resultArity AddField = 1
160        | resultArity SubField = 1        | resultArity SubField = 1
161        | resultArity ScaleField = 1        | resultArity ScaleField = 1
162          | resultArity OffsetField = 1
163        | resultArity NegField = 1        | resultArity NegField = 1
164        | resultArity DiffField = 1        | resultArity DiffField = 1
165          | resultArity (CurlField _) = 1
166        | resultArity (Input _) = 1        | resultArity (Input _) = 1
167        | resultArity (InputWithDefault _) = 1        | resultArity (InputWithDefault _) = 1
168        | resultArity (Print _) = 0        | resultArity (Print _) = 0
# Line 177  Line 189 
189        | arity (MulVecMat _) = 2        | arity (MulVecMat _) = 2
190        | arity (MulMatVec _) = 2        | arity (MulMatVec _) = 2
191        | arity (MulMatMat _) = 2        | arity (MulMatMat _) = 2
192          | arity (MulVecTen3 _) = 2
193          | arity (MulTen3Vec _) = 2
194          | arity (ColonMul _) = 2
195        | arity Cross = 2        | arity Cross = 2
196        | arity (Outer _) = 2        | arity (Outer _) = 2
197        | arity (Norm _) = 1        | arity (Norm _) = 1
# Line 188  Line 203 
203        | arity (Identity _) = 0        | arity (Identity _) = 0
204        | arity (Zero _) = 0        | arity (Zero _) = 0
205        | arity (Trace _) = 1        | arity (Trace _) = 1
206          | arity (Transpose _) = 1
207        | arity (Slice _) = 1        | arity (Slice _) = 1
208        | arity (TensorSub _) = ~1        | arity (TensorSub _) = ~1
209        | arity (Select _) = 1        | arity (Select _) = 1
# Line 205  Line 221 
221        | arity AddField = 2        | arity AddField = 2
222        | arity SubField = 2        | arity SubField = 2
223        | arity ScaleField = 2        | arity ScaleField = 2
224          | arity OffsetField = 2
225        | arity NegField = 1        | arity NegField = 1
226        | arity DiffField = 1        | arity DiffField = 1
227          | arity (CurlField _) = 1
228        | arity (Input _) = 0        | arity (Input _) = 0
229        | arity (InputWithDefault _) = 1        | arity (InputWithDefault _) = 1
230        | arity (Print _) = ~1        | arity (Print _) = ~1
231    
232        fun isPure (Print _) = false
233          | isPure _ = true
234    
235      fun same (Add(a0), Add(b0)) = samety(a0, b0)      fun same (Add(a0), Add(b0)) = samety(a0, b0)
236        | same (Sub(a0), Sub(b0)) = samety(a0, b0)        | same (Sub(a0), Sub(b0)) = samety(a0, b0)
237        | same (Mul(a0), Mul(b0)) = samety(a0, b0)        | same (Mul(a0), Mul(b0)) = samety(a0, b0)
# Line 233  Line 254 
254        | same (MulVecMat(a0), MulVecMat(b0)) = samety(a0, b0)        | same (MulVecMat(a0), MulVecMat(b0)) = samety(a0, b0)
255        | same (MulMatVec(a0), MulMatVec(b0)) = samety(a0, b0)        | same (MulMatVec(a0), MulMatVec(b0)) = samety(a0, b0)
256        | same (MulMatMat(a0,a1), MulMatMat(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)        | same (MulMatMat(a0,a1), MulMatMat(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
257          | same (MulVecTen3(a0), MulVecTen3(b0)) = samety(a0, b0)
258          | same (MulTen3Vec(a0), MulTen3Vec(b0)) = samety(a0, b0)
259          | same (ColonMul(a0,a1), ColonMul(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
260        | same (Cross, Cross) = true        | same (Cross, Cross) = true
261        | same (Outer(a0), Outer(b0)) = samety(a0, b0)        | same (Outer(a0), Outer(b0)) = samety(a0, b0)
262        | same (Norm(a0), Norm(b0)) = samety(a0, b0)        | same (Norm(a0), Norm(b0)) = samety(a0, b0)
# Line 244  Line 268 
268        | same (Identity(a0), Identity(b0)) = sameint(a0, b0)        | same (Identity(a0), Identity(b0)) = sameint(a0, b0)
269        | same (Zero(a0), Zero(b0)) = samety(a0, b0)        | same (Zero(a0), Zero(b0)) = samety(a0, b0)
270        | same (Trace(a0), Trace(b0)) = samety(a0, b0)        | same (Trace(a0), Trace(b0)) = samety(a0, b0)
271          | same (Transpose(a0,a1), Transpose(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
272        | same (Slice(a0,a1), Slice(b0,b1)) = samety(a0, b0) andalso samemask(a1, b1)        | same (Slice(a0,a1), Slice(b0,b1)) = samety(a0, b0) andalso samemask(a1, b1)
273        | same (TensorSub(a0), TensorSub(b0)) = samety(a0, b0)        | same (TensorSub(a0), TensorSub(b0)) = samety(a0, b0)
274        | 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)
# Line 261  Line 286 
286        | same (AddField, AddField) = true        | same (AddField, AddField) = true
287        | same (SubField, SubField) = true        | same (SubField, SubField) = true
288        | same (ScaleField, ScaleField) = true        | same (ScaleField, ScaleField) = true
289          | same (OffsetField, OffsetField) = true
290        | same (NegField, NegField) = true        | same (NegField, NegField) = true
291        | same (DiffField, DiffField) = true        | same (DiffField, DiffField) = true
292          | same (CurlField(a0), CurlField(b0)) = sameint(a0, b0)
293        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
294        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
295        | same (Print(a0), Print(b0)) = sametys(a0, b0)        | same (Print(a0), Print(b0)) = sametys(a0, b0)
# Line 290  Line 317 
317        | hash (MulVecMat(a0)) = 0w73 + hashty a0        | hash (MulVecMat(a0)) = 0w73 + hashty a0
318        | hash (MulMatVec(a0)) = 0w79 + hashty a0        | hash (MulMatVec(a0)) = 0w79 + hashty a0
319        | hash (MulMatMat(a0,a1)) = 0w83 + hashty a0 + hashty a1        | hash (MulMatMat(a0,a1)) = 0w83 + hashty a0 + hashty a1
320        | hash Cross = 0w89        | hash (MulVecTen3(a0)) = 0w89 + hashty a0
321        | hash (Outer(a0)) = 0w97 + hashty a0        | hash (MulTen3Vec(a0)) = 0w97 + hashty a0
322        | hash (Norm(a0)) = 0w101 + hashty a0        | hash (ColonMul(a0,a1)) = 0w101 + hashty a0 + hashty a1
323        | hash (Normalize(a0)) = 0w103 + hashty a0        | hash Cross = 0w103
324        | hash (Scale(a0)) = 0w107 + hashty a0        | hash (Outer(a0)) = 0w107 + hashty a0
325        | hash (PrincipleEvec(a0)) = 0w109 + hashty a0        | hash (Norm(a0)) = 0w109 + hashty a0
326        | hash Eigen2x2 = 0w113        | hash (Normalize(a0)) = 0w113 + hashty a0
327        | hash Eigen3x3 = 0w127        | hash (Scale(a0)) = 0w127 + hashty a0
328        | hash (Identity(a0)) = 0w131 + hashint a0        | hash (PrincipleEvec(a0)) = 0w131 + hashty a0
329        | hash (Zero(a0)) = 0w137 + hashty a0        | hash Eigen2x2 = 0w137
330        | hash (Trace(a0)) = 0w139 + hashty a0        | hash Eigen3x3 = 0w139
331        | hash (Slice(a0,a1)) = 0w149 + hashty a0 + hashmask a1        | hash (Identity(a0)) = 0w149 + hashint a0
332        | hash (TensorSub(a0)) = 0w151 + hashty a0        | hash (Zero(a0)) = 0w151 + hashty a0
333        | hash (Select(a0,a1)) = 0w157 + hashty a0 + hashint a1        | hash (Trace(a0)) = 0w157 + hashty a0
334        | hash (SeqSub(a0)) = 0w163 + hashty a0        | hash (Transpose(a0,a1)) = 0w163 + hashint a0 + hashint a1
335        | hash IntToReal = 0w167        | hash (Slice(a0,a1)) = 0w167 + hashty a0 + hashmask a1
336        | hash TruncToInt = 0w173        | hash (TensorSub(a0)) = 0w173 + hashty a0
337        | hash RoundToInt = 0w179        | hash (Select(a0,a1)) = 0w179 + hashty a0 + hashint a1
338        | hash CeilToInt = 0w181        | hash (SeqSub(a0)) = 0w181 + hashty a0
339        | hash FloorToInt = 0w191        | hash IntToReal = 0w191
340        | hash (Kernel(a0,a1)) = 0w193 + Kernel.hash a0 + hashint a1        | hash TruncToInt = 0w193
341        | hash (LoadImage(a0)) = 0w197 + ImageInfo.hash a0        | hash RoundToInt = 0w197
342        | hash (Inside(a0)) = 0w199 + hashint a0        | hash CeilToInt = 0w199
343        | hash (Field(a0)) = 0w211 + hashint a0        | hash FloorToInt = 0w211
344        | hash (Probe(a0,a1)) = 0w223 + hashty a0 + hashty a1        | hash (Kernel(a0,a1)) = 0w223 + Kernel.hash a0 + hashint a1
345        | hash AddField = 0w227        | hash (LoadImage(a0)) = 0w227 + ImageInfo.hash a0
346        | hash SubField = 0w229        | hash (Inside(a0)) = 0w229 + hashint a0
347        | hash ScaleField = 0w233        | hash (Field(a0)) = 0w233 + hashint a0
348        | hash NegField = 0w239        | hash (Probe(a0,a1)) = 0w239 + hashty a0 + hashty a1
349        | hash DiffField = 0w241        | hash AddField = 0w241
350        | hash (Input(a0,a1,a2)) = 0w251 + hashty a0 + hashstring a1 + hashstring a2        | hash SubField = 0w251
351        | hash (InputWithDefault(a0,a1,a2)) = 0w257 + hashty a0 + hashstring a1 + hashstring a2        | hash ScaleField = 0w257
352        | hash (Print(a0)) = 0w263 + hashtys a0        | hash OffsetField = 0w263
353          | hash NegField = 0w269
354          | hash DiffField = 0w271
355          | hash (CurlField(a0)) = 0w277 + hashint a0
356          | hash (Input(a0,a1,a2)) = 0w281 + hashty a0 + hashstring a1 + hashstring a2
357          | hash (InputWithDefault(a0,a1,a2)) = 0w283 + hashty a0 + hashstring a1 + hashstring a2
358          | hash (Print(a0)) = 0w293 + hashtys a0
359    
360      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]
361        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]
# Line 346  Line 379 
379        | toString (MulVecMat(a0)) = concat["MulVecMat<", tyToString a0, ">"]        | toString (MulVecMat(a0)) = concat["MulVecMat<", tyToString a0, ">"]
380        | toString (MulMatVec(a0)) = concat["MulMatVec<", tyToString a0, ">"]        | toString (MulMatVec(a0)) = concat["MulMatVec<", tyToString a0, ">"]
381        | toString (MulMatMat(a0,a1)) = concat["MulMatMat<", tyToString a0, ",", tyToString a1, ">"]        | toString (MulMatMat(a0,a1)) = concat["MulMatMat<", tyToString a0, ",", tyToString a1, ">"]
382          | toString (MulVecTen3(a0)) = concat["MulVecTen3<", tyToString a0, ">"]
383          | toString (MulTen3Vec(a0)) = concat["MulTen3Vec<", tyToString a0, ">"]
384          | toString (ColonMul(a0,a1)) = concat["ColonMul<", tyToString a0, ",", tyToString a1, ">"]
385        | toString Cross = "Cross"        | toString Cross = "Cross"
386        | toString (Outer(a0)) = concat["Outer<", tyToString a0, ">"]        | toString (Outer(a0)) = concat["Outer<", tyToString a0, ">"]
387        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]
# Line 357  Line 393 
393        | toString (Identity(a0)) = concat["Identity<", intToString a0, ">"]        | toString (Identity(a0)) = concat["Identity<", intToString a0, ">"]
394        | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]        | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
395        | toString (Trace(a0)) = concat["Trace<", tyToString a0, ">"]        | toString (Trace(a0)) = concat["Trace<", tyToString a0, ">"]
396          | toString (Transpose(a0,a1)) = concat["Transpose<", intToString a0, ",", intToString a1, ">"]
397        | toString (Slice(a0,a1)) = concat["Slice<", tyToString a0, ",", maskToString a1, ">"]        | toString (Slice(a0,a1)) = concat["Slice<", tyToString a0, ",", maskToString a1, ">"]
398        | toString (TensorSub(a0)) = concat["TensorSub<", tyToString a0, ">"]        | toString (TensorSub(a0)) = concat["TensorSub<", tyToString a0, ">"]
399        | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]        | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
# Line 374  Line 411 
411        | toString AddField = "AddField"        | toString AddField = "AddField"
412        | toString SubField = "SubField"        | toString SubField = "SubField"
413        | toString ScaleField = "ScaleField"        | toString ScaleField = "ScaleField"
414          | toString OffsetField = "OffsetField"
415        | toString NegField = "NegField"        | toString NegField = "NegField"
416        | toString DiffField = "DiffField"        | toString DiffField = "DiffField"
417          | toString (CurlField(a0)) = concat["CurlField<", intToString a0, ">"]
418        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
419        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
420        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]        | toString (Print(a0)) = concat["Print<", tysToString 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