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 3767, Mon Apr 18 18:42:10 2016 UTC revision 3768, Mon Apr 18 22:20:53 2016 UTC
# Line 133  Line 133 
133        | ImageDim of ImageInfo.info * int        | ImageDim of ImageInfo.info * int
134        | LoadSeq of ty * string        | LoadSeq of ty * string
135        | LoadImage of ty * string        | LoadImage of ty * string
       | Print of tys  
136        | MathFn of MathFns.t        | MathFn of MathFns.t
137    
138      fun resultArity IAdd = 1      fun resultArity IAdd = 1
# Line 210  Line 209 
209        | resultArity (ImageDim _) = 1        | resultArity (ImageDim _) = 1
210        | resultArity (LoadSeq _) = 1        | resultArity (LoadSeq _) = 1
211        | resultArity (LoadImage _) = 1        | resultArity (LoadImage _) = 1
       | resultArity (Print _) = 0  
212        | resultArity (MathFn _) = 1        | resultArity (MathFn _) = 1
213    
214      fun arity IAdd = 2      fun arity IAdd = 2
# Line 287  Line 285 
285        | arity (ImageDim _) = 1        | arity (ImageDim _) = 1
286        | arity (LoadSeq _) = 0        | arity (LoadSeq _) = 0
287        | arity (LoadImage _) = 0        | arity (LoadImage _) = 0
       | arity (Print _) = ~1  
288        | arity (MathFn _) = ~1        | arity (MathFn _) = ~1
289    
290      fun isPure (MkDynamic _) = false      fun isPure (MkDynamic _) = false
291        | isPure (Append _) = false        | isPure (Append _) = false
292        | isPure (Prepend _) = false        | isPure (Prepend _) = false
293        | isPure (Concat _) = false        | isPure (Concat _) = false
       | isPure (Print _) = false  
294        | isPure _ = true        | isPure _ = true
295    
296      fun same (IAdd, IAdd) = true      fun same (IAdd, IAdd) = true
# Line 371  Line 367 
367        | 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)
368        | 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)
369        | 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)  
370        | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)        | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
371        | same _ = false        | same _ = false
372    
# Line 449  Line 444 
444        | hash (ImageDim(a0,a1)) = 0w367 + ImageInfo.hash a0 + hashint a1        | hash (ImageDim(a0,a1)) = 0w367 + ImageInfo.hash a0 + hashint a1
445        | hash (LoadSeq(a0,a1)) = 0w373 + hashty a0 + hashstring a1        | hash (LoadSeq(a0,a1)) = 0w373 + hashty a0 + hashstring a1
446        | hash (LoadImage(a0,a1)) = 0w379 + hashty a0 + hashstring a1        | hash (LoadImage(a0,a1)) = 0w379 + hashty a0 + hashstring a1
447        | hash (Print(a0)) = 0w383 + hashtys a0        | hash (MathFn(a0)) = 0w383 + MathFns.hash a0
       | hash (MathFn(a0)) = 0w389 + MathFns.hash a0  
448    
449      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
450        | toString ISub = "ISub"        | toString ISub = "ISub"
# Line 526  Line 520 
520        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
521        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
522        | 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, ">"]  
523        | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]        | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
524    
525    end    end

Legend:
Removed from v.3767  
changed lines
  Added in v.3768

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