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

SCM Repository

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

Diff of /branches/vis15/src/compiler/tree-ir/tree-ops.sml

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

revision 3865, Mon May 16 16:32:19 2016 UTC revision 3866, Mon May 16 16:48:13 2016 UTC
# Line 139  Line 139 
139        | ImageDim of ImageInfo.info * int        | ImageDim of ImageInfo.info * int
140        | LoadSeq of ty * string        | LoadSeq of ty * string
141        | LoadImage of ty * string        | LoadImage of ty * string
       | Print of tys  
142        | MathFn of MathFns.t        | MathFn of MathFns.t
143    
144      fun resultArity IAdd = 1      fun resultArity IAdd = 1
# Line 185  Line 184 
184        | resultArity (Select _) = 1        | resultArity (Select _) = 1
185        | resultArity (Subscript _) = 1        | resultArity (Subscript _) = 1
186        | resultArity (MkDynamic _) = 1        | resultArity (MkDynamic _) = 1
187        | resultArity (Append _) = 2        | resultArity (Append _) = 1
188        | resultArity (Prepend _) = 2        | resultArity (Prepend _) = 1
189        | resultArity (Concat _) = 2        | resultArity (Concat _) = 1
190        | resultArity Range = 2        | resultArity Range = 1
191        | resultArity (Length _) = 1        | resultArity (Length _) = 1
192        | resultArity (SphereQuery _) = 1        | resultArity (SphereQuery _) = 1
193        | resultArity Sqrt = 1        | resultArity Sqrt = 1
# Line 222  Line 221 
221        | resultArity (ImageDim _) = 1        | resultArity (ImageDim _) = 1
222        | resultArity (LoadSeq _) = 1        | resultArity (LoadSeq _) = 1
223        | resultArity (LoadImage _) = 1        | resultArity (LoadImage _) = 1
       | resultArity (Print _) = 0  
224        | resultArity (MathFn _) = 1        | resultArity (MathFn _) = 1
225    
226      fun arity IAdd = 2      fun arity IAdd = 2
# Line 268  Line 266 
266        | arity (Select _) = 1        | arity (Select _) = 1
267        | arity (Subscript _) = 2        | arity (Subscript _) = 2
268        | arity (MkDynamic _) = 1        | arity (MkDynamic _) = 1
269        | arity (Append _) = 1        | arity (Append _) = 2
270        | arity (Prepend _) = 1        | arity (Prepend _) = 2
271        | arity (Concat _) = 1        | arity (Concat _) = 2
272        | arity Range = 1        | arity Range = 2
273        | arity (Length _) = 1        | arity (Length _) = 1
274        | arity (SphereQuery _) = 2        | arity (SphereQuery _) = 2
275        | arity Sqrt = 1        | arity Sqrt = 1
# Line 305  Line 303 
303        | arity (ImageDim _) = 1        | arity (ImageDim _) = 1
304        | arity (LoadSeq _) = 0        | arity (LoadSeq _) = 0
305        | arity (LoadImage _) = 0        | arity (LoadImage _) = 0
       | arity (Print _) = ~1  
306        | arity (MathFn _) = ~1        | arity (MathFn _) = ~1
307    
308      fun isPure (MkDynamic _) = false      fun isPure (MkDynamic _) = false
309        | isPure (Append _) = false        | isPure (Append _) = false
310        | isPure (Prepend _) = false        | isPure (Prepend _) = false
311        | isPure (Concat _) = false        | isPure (Concat _) = false
       | isPure (Print _) = false  
312        | isPure _ = true        | isPure _ = true
313    
314      fun same (IAdd, IAdd) = true      fun same (IAdd, IAdd) = true
# Line 395  Line 391 
391        | 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)
392        | 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)
393        | 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 (Print(a0), Print(b0)) = sametys(a0, b0)  
394        | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)        | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
395        | same _ = false        | same _ = false
396    
# Line 479  Line 474 
474        | hash (ImageDim(a0,a1)) = 0w401 + ImageInfo.hash a0 + hashint a1        | hash (ImageDim(a0,a1)) = 0w401 + ImageInfo.hash a0 + hashint a1
475        | hash (LoadSeq(a0,a1)) = 0w409 + hashty a0 + hashstring a1        | hash (LoadSeq(a0,a1)) = 0w409 + hashty a0 + hashstring a1
476        | hash (LoadImage(a0,a1)) = 0w419 + hashty a0 + hashstring a1        | hash (LoadImage(a0,a1)) = 0w419 + hashty a0 + hashstring a1
477        | hash (Print(a0)) = 0w421 + hashtys a0        | hash (MathFn(a0)) = 0w421 + MathFns.hash a0
       | hash (MathFn(a0)) = 0w431 + MathFns.hash a0  
478    
479      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
480        | toString ISub = "ISub"        | toString ISub = "ISub"
# Line 562  Line 556 
556        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
557        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
558        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
       | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]  
559        | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]        | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
560    
561    end    end

Legend:
Removed from v.3865  
changed lines
  Added in v.3866

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