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

SCM Repository

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

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

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

revision 3483, Sat Dec 5 15:02:33 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 107  Line 101 
101        | ImageDim of ImageInfo.info * int        | ImageDim of ImageInfo.info * int
102        | LoadSeq of ty * string        | LoadSeq of ty * string
103        | LoadImage of ty * string        | LoadImage of ty * string
       | Input of input  
       | InputWithDefault of input  
104        | Print of tys        | Print of tys
105    
106      fun resultArity IAdd = 1      fun resultArity IAdd = 1
# Line 161  Line 153 
153        | resultArity (ImageDim _) = 1        | resultArity (ImageDim _) = 1
154        | resultArity (LoadSeq _) = 1        | resultArity (LoadSeq _) = 1
155        | resultArity (LoadImage _) = 1        | resultArity (LoadImage _) = 1
       | resultArity (Input _) = 0  
       | resultArity (InputWithDefault _) = 0  
156        | resultArity (Print _) = 0        | resultArity (Print _) = 0
157    
158      fun arity IAdd = 2      fun arity IAdd = 2
# Line 215  Line 205 
205        | arity (ImageDim _) = 1        | arity (ImageDim _) = 1
206        | arity (LoadSeq _) = 0        | arity (LoadSeq _) = 0
207        | arity (LoadImage _) = 0        | arity (LoadImage _) = 0
       | arity (Input _) = 0  
       | arity (InputWithDefault _) = 1  
208        | arity (Print _) = ~1        | arity (Print _) = ~1
209    
210      fun isPure (MkDynamic _) = false      fun isPure (MkDynamic _) = false
211        | isPure (Append _) = false        | isPure (Append _) = false
212        | isPure (Prepend _) = false        | isPure (Prepend _) = false
213        | isPure (Concat _) = false        | isPure (Concat _) = false
       | isPure (Input _) = false  
       | isPure (InputWithDefault _) = false  
214        | isPure (Print _) = false        | isPure (Print _) = false
215        | isPure _ = true        | isPure _ = true
216    
# Line 278  Line 264 
264        | 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)
265        | 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)
266        | 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)  
267        | same (Print(a0), Print(b0)) = sametys(a0, b0)        | same (Print(a0), Print(b0)) = sametys(a0, b0)
268        | same _ = false        | same _ = false
269    
# Line 333  Line 317 
317        | hash (ImageDim(a0,a1)) = 0w227 + ImageInfo.hash a0 + hashint a1        | hash (ImageDim(a0,a1)) = 0w227 + ImageInfo.hash a0 + hashint a1
318        | hash (LoadSeq(a0,a1)) = 0w229 + hashty a0 + hashstring a1        | hash (LoadSeq(a0,a1)) = 0w229 + hashty a0 + hashstring a1
319        | hash (LoadImage(a0,a1)) = 0w233 + hashty a0 + hashstring a1        | hash (LoadImage(a0,a1)) = 0w233 + hashty a0 + hashstring a1
320        | hash (Input(a0)) = 0w239 + hashinput a0        | hash (Print(a0)) = 0w239 + hashtys a0
       | hash (InputWithDefault(a0)) = 0w241 + hashinput a0  
       | hash (Print(a0)) = 0w251 + hashtys a0  
321    
322      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
323        | toString ISub = "ISub"        | toString ISub = "ISub"
# Line 387  Line 369 
369        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
370        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
371        | 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, ">"]  
372        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]
373    
374    end    end

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

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