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

SCM Repository

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

Diff of /branches/vis15/src/compiler/low-ir/low-ir.sml

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

revision 3505, Fri Dec 18 02:47:03 2015 UTC revision 3506, Fri Dec 18 04:03:54 2015 UTC
# Line 44  Line 44 
44      fun maskToString m =      fun maskToString m =
45            String.concat(List.map (fn true => "_" | false => ":") m)            String.concat(List.map (fn true => "_" | false => ":") m)
46    
   (* required helper functions for the input type *)  
     type input = ty Inputs.input  
     val sameinput = Inputs.same  
     val hashinput = Inputs.hash  
     val inputToString = Inputs.toString  
   
47    (* required helper functions for the index control type type *)    (* required helper functions for the index control type type *)
48      type idxctl = IndexCtl.ctl      type idxctl = IndexCtl.ctl
49      val sameidxctl = IndexCtl.same      val sameidxctl = IndexCtl.same
# Line 119  Line 113 
113        | ImageDim of ImageInfo.info * int        | ImageDim of ImageInfo.info * int
114        | LoadSeq of ty * string        | LoadSeq of ty * string
115        | LoadImage of ty * string        | LoadImage of ty * string
       | Input of input  
       | InputWithDefault of input  
116        | Print of tys        | Print of tys
117    
118      fun resultArity IAdd = 1      fun resultArity IAdd = 1
# Line 185  Line 177 
177        | resultArity (ImageDim _) = 1        | resultArity (ImageDim _) = 1
178        | resultArity (LoadSeq _) = 1        | resultArity (LoadSeq _) = 1
179        | resultArity (LoadImage _) = 1        | resultArity (LoadImage _) = 1
       | resultArity (Input _) = 0  
       | resultArity (InputWithDefault _) = 0  
180        | resultArity (Print _) = 0        | resultArity (Print _) = 0
181    
182      fun arity IAdd = 2      fun arity IAdd = 2
# Line 251  Line 241 
241        | arity (ImageDim _) = 1        | arity (ImageDim _) = 1
242        | arity (LoadSeq _) = 0        | arity (LoadSeq _) = 0
243        | arity (LoadImage _) = 0        | arity (LoadImage _) = 0
       | arity (Input _) = 0  
       | arity (InputWithDefault _) = 1  
244        | arity (Print _) = ~1        | arity (Print _) = ~1
245    
246      fun isPure (MkDynamic _) = false      fun isPure (MkDynamic _) = false
247        | isPure (Append _) = false        | isPure (Append _) = false
248        | isPure (Prepend _) = false        | isPure (Prepend _) = false
249        | isPure (Concat _) = false        | isPure (Concat _) = false
       | isPure (Input _) = false  
       | isPure (InputWithDefault _) = false  
250        | isPure (Print _) = false        | isPure (Print _) = false
251        | isPure _ = true        | isPure _ = true
252    
# Line 326  Line 312 
312        | 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)
313        | 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)
314        | 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 (Input(a0), Input(b0)) = sameinput(a0, b0)  
       | same (InputWithDefault(a0), InputWithDefault(b0)) = sameinput(a0, b0)  
315        | same (Print(a0), Print(b0)) = sametys(a0, b0)        | same (Print(a0), Print(b0)) = sametys(a0, b0)
316        | same _ = false        | same _ = false
317    
# Line 393  Line 377 
377        | hash (ImageDim(a0,a1)) = 0w283 + ImageInfo.hash a0 + hashint a1        | hash (ImageDim(a0,a1)) = 0w283 + ImageInfo.hash a0 + hashint a1
378        | hash (LoadSeq(a0,a1)) = 0w293 + hashty a0 + hashstring a1        | hash (LoadSeq(a0,a1)) = 0w293 + hashty a0 + hashstring a1
379        | hash (LoadImage(a0,a1)) = 0w307 + hashty a0 + hashstring a1        | hash (LoadImage(a0,a1)) = 0w307 + hashty a0 + hashstring a1
380        | hash (Input(a0)) = 0w311 + hashinput a0        | hash (Print(a0)) = 0w311 + hashtys a0
       | hash (InputWithDefault(a0)) = 0w313 + hashinput a0  
       | hash (Print(a0)) = 0w317 + hashtys a0  
381    
382      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
383        | toString ISub = "ISub"        | toString ISub = "ISub"
# Line 459  Line 441 
441        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
442        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
443        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
       | toString (Input(a0)) = concat["Input<", inputToString a0, ">"]  
       | toString (InputWithDefault(a0)) = concat["InputWithDefault<", inputToString a0, ">"]  
444        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
445    
446    end    end

Legend:
Removed from v.3505  
changed lines
  Added in v.3506

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