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 197, Mon Aug 2 20:51:47 2010 UTC revision 226, Tue Aug 3 21:34:18 2010 UTC
# Line 25  Line 25 
25              "tensor[", String.concatWith "," (List.map Int.toString dd), "]"              "tensor[", String.concatWith "," (List.map Int.toString dd), "]"
26            ]            ]
27    
28        fun samestring (s1 : string, s2) = (s1 = s2)
29        val hashstring = HashString.hashString
30        fun stringToString s = String.concat["\"", s, "\""]
31    
32      datatype rator      datatype rator
33        = Add of ty        = Add of ty
34        | Sub of ty        | Sub of ty
# Line 67  Line 71 
71        | DiffField        | DiffField
72        | Probe        | Probe
73        | Transform of ImageInfo.info        | Transform of ImageInfo.info
74          | Input of string
75          | InputWithDefault of string
76    
77      fun arity (Add _) = 2      fun arity (Add _) = 2
78        | arity (Sub _) = 2        | arity (Sub _) = 2
# Line 99  Line 105 
105        | arity CeilToInt = 1        | arity CeilToInt = 1
106        | arity FloorToInt = 1        | arity FloorToInt = 1
107        | arity (Kernel _) = 0        | arity (Kernel _) = 0
108        | arity (LoadImage _) = 1        | arity (LoadImage _) = 0
109        | arity Convolve = 2        | arity Convolve = 2
110        | arity Inside = 2        | arity Inside = 2
111        | arity (Field _) = 0        | arity (Field _) = 0
# Line 109  Line 115 
115        | arity DiffField = 1        | arity DiffField = 1
116        | arity Probe = 2        | arity Probe = 2
117        | arity (Transform _) = 1        | arity (Transform _) = 1
118          | arity (Input _) = 0
119          | arity (InputWithDefault _) = 1
120    
121      fun same (Add a, Add b) = samety(a, b)      fun same (Add a, Add b) = samety(a, b)
122        | same (Sub a, Sub b) = samety(a, b)        | same (Sub a, Sub b) = samety(a, b)
# Line 151  Line 159 
159        | same (DiffField, DiffField) = true        | same (DiffField, DiffField) = true
160        | same (Probe, Probe) = true        | same (Probe, Probe) = true
161        | same (Transform a, Transform b) = ImageInfo.same(a, b)        | same (Transform a, Transform b) = ImageInfo.same(a, b)
162          | same (Input a, Input b) = samestring(a, b)
163          | same (InputWithDefault a, InputWithDefault b) = samestring(a, b)
164        | same _ = false        | same _ = false
165    
166      fun hash (Add a) = 0w3 + hashty a      fun hash (Add a) = 0w3 + hashty a
# Line 194  Line 204 
204        | hash DiffField = 0w173        | hash DiffField = 0w173
205        | hash Probe = 0w179        | hash Probe = 0w179
206        | hash (Transform a) = 0w181 + ImageInfo.hash a        | hash (Transform a) = 0w181 + ImageInfo.hash a
207          | hash (Input a) = 0w191 + hashstring a
208          | hash (InputWithDefault a) = 0w193 + hashstring a
209    
210      fun toString (Add a) = concat["Add(", tyToString a, ")"]      fun toString (Add a) = concat["Add(", tyToString a, ")"]
211        | toString (Sub a) = concat["Sub(", tyToString a, ")"]        | toString (Sub a) = concat["Sub(", tyToString a, ")"]
# Line 236  Line 248 
248        | toString DiffField = "DiffField"        | toString DiffField = "DiffField"
249        | toString Probe = "Probe"        | toString Probe = "Probe"
250        | toString (Transform a) = concat["Transform(", ImageInfo.toString a, ")"]        | toString (Transform a) = concat["Transform(", ImageInfo.toString a, ")"]
251          | toString (Input a) = concat["Input(", stringToString a, ")"]
252          | toString (InputWithDefault a) = concat["InputWithDefault(", stringToString a, ")"]
253    
254    end    end
255    

Legend:
Removed from v.197  
changed lines
  Added in v.226

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