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

SCM Repository

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

Diff of /branches/charisee/src/compiler/tree-il/tree-ops.sml

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

revision 2679, Tue Jul 29 04:18:35 2014 UTC revision 2680, Wed Aug 6 00:51:53 2014 UTC
# Line 51  Line 51 
51        | prodVec of int        | prodVec of int
52        | prodScaV of int        | prodScaV of int
53        | sumVec of int        | sumVec of int
54          | dotVec of int (*just combine sum and prod because it looked overwhelming*)
55        | Abs of ty        | Abs of ty
56        | LT of ty        | LT of ty
57        | LTE of ty        | LTE of ty
# Line 87  Line 88 
88        | RealToInt of int        | RealToInt of int
89        | Transform of ImageInfo.info        | Transform of ImageInfo.info
90        | Translate of ImageInfo.info        | Translate of ImageInfo.info
91        | Kernel of Kernel.kernel * int  
92        | ImageAddress of ImageInfo.info        | ImageAddress of ImageInfo.info
93        | LoadVoxels of ImageInfo.info * int        | LoadVoxels of ImageInfo.info * int
94        | Inside of ImageInfo.info * int        | Inside of ImageInfo.info * int
95        | LoadSeq of ty * string        | LoadSeq of ty * string
96        | LoadImage of ImageInfo.info  
97        | imgAddr of ImageInfo.info * ty * int        | imgAddr of ImageInfo.info * ty * int
98        | imgLoad of ImageInfo.info * int * int        | imgLoad of ImageInfo.info * int * int
99          | baseAddr  of ImageInfo.info
100        | Input of ty * string * string        | Input of ty * string * string
101        | InputWithDefault of ty * string * string        | InputWithDefault of ty * string * string
102        | Print of tys        | Print of tys
# Line 115  Line 117 
117        | resultArity (prodVec _) = 1        | resultArity (prodVec _) = 1
118        | resultArity (prodScaV _) = 1        | resultArity (prodScaV _) = 1
119        | resultArity (sumVec _) = 1        | resultArity (sumVec _) = 1
120           | resultArity (dotVec _) = 1
121        | resultArity (Abs _) = 1        | resultArity (Abs _) = 1
122        | resultArity (LT _) = 1        | resultArity (LT _) = 1
123        | resultArity (LTE _) = 1        | resultArity (LTE _) = 1
# Line 151  Line 154 
154        | resultArity (RealToInt _) = 1        | resultArity (RealToInt _) = 1
155        | resultArity (Transform _) = 1        | resultArity (Transform _) = 1
156        | resultArity (Translate _) = 1        | resultArity (Translate _) = 1
157        | resultArity (Kernel _) = 1  
158        | resultArity (ImageAddress _) = 1        | resultArity (ImageAddress _) = 1
159        | resultArity (LoadVoxels _) = 1        | resultArity (LoadVoxels _) = 1
160        | resultArity (Inside _) = 1        | resultArity (Inside _) = 1
161        | resultArity (LoadSeq _) = 1        | resultArity (LoadSeq _) = 1
162        | resultArity (LoadImage _) = 1  
163        | resultArity (imgAddr _) = 1        | resultArity (imgAddr _) = 1
164        | resultArity (imgLoad _) = 1        | resultArity (imgLoad _) = 1
165           | resultArity (baseAddr _) = 1
166        | resultArity (Input _) = 1        | resultArity (Input _) = 1
167        | resultArity (InputWithDefault _) = 1        | resultArity (InputWithDefault _) = 1
168        | resultArity (Print _) = 0        | resultArity (Print _) = 0
169    
170    
171      fun arity IAdd = 2      fun arity IAdd = 2
172        | arity ISub = 2        | arity ISub = 2
173        | arity IMul = 2        | arity IMul = 2
# Line 179  Line 184 
184        | arity (prodVec _) = 2        | arity (prodVec _) = 2
185        | arity (prodScaV _) = 2        | arity (prodScaV _) = 2
186        | arity (sumVec _) = 2        | arity (sumVec _) = 2
187           | arity (dotVec _) = 2
188        | arity (Abs _) = 1        | arity (Abs _) = 1
189        | arity (LT _) = 2        | arity (LT _) = 2
190        | arity (LTE _) = 2        | arity (LTE _) = 2
# Line 215  Line 221 
221        | arity (RealToInt _) = 1        | arity (RealToInt _) = 1
222        | arity (Transform _) = 2        | arity (Transform _) = 2
223        | arity (Translate _) = 2        | arity (Translate _) = 2
224        | arity (Kernel _) = 0  
225        | arity (ImageAddress _) = 1        | arity (ImageAddress _) = 1
226        | arity (LoadVoxels _) = 1        | arity (LoadVoxels _) = 1
227        | arity (Inside _) = 2        | arity (Inside _) = 2
228        | arity (LoadSeq _) = 0        | arity (LoadSeq _) = 0
229        | arity (LoadImage _) = 0  
230        | arity (imgAddr _) = 2        | arity (imgAddr _) = 2
231        | arity (imgLoad _) = 2        | arity (imgLoad _) = 2
232      | arity(baseAddr _) = 2
233        | arity (Input _) = 0        | arity (Input _) = 0
234        | arity (InputWithDefault _) = 1        | arity (InputWithDefault _) = 1
235        | arity (Print _) = ~1        | arity (Print _) = ~1
# Line 249  Line 256 
256        | same (subVec(a0), subVec(b0)) = sameint(a0, b0)        | same (subVec(a0), subVec(b0)) = sameint(a0, b0)
257        | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)        | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)
258        | same (prodScaV(a0), prodScaV(b0)) = sameint(a0, b0)        | same (prodScaV(a0), prodScaV(b0)) = sameint(a0, b0)
259        | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)        | same (dotVec(a0), dotVec(b0)) = sameint(a0, b0)
260        | same (Abs(a0), Abs(b0)) = samety(a0, b0)        | same (Abs(a0), Abs(b0)) = samety(a0, b0)
261        | same (LT(a0), LT(b0)) = samety(a0, b0)        | same (LT(a0), LT(b0)) = samety(a0, b0)
262        | same (LTE(a0), LTE(b0)) = samety(a0, b0)        | same (LTE(a0), LTE(b0)) = samety(a0, b0)
# Line 286  Line 293 
293        | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)        | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
294        | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)        | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
295        | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)        | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
296        | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)  
297        | same (ImageAddress(a0), ImageAddress(b0)) = ImageInfo.same(a0, b0)        | same (ImageAddress(a0), ImageAddress(b0)) = ImageInfo.same(a0, b0)
298        | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)        | same (LoadVoxels(a0,a1), LoadVoxels(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
299        | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)        | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
300        | 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)
301        | same (LoadImage(a0), LoadImage(b0)) = ImageInfo.same(a0, b0)  
302        | same (imgAddr(a0,a1,a2), imgAddr(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso samety(a1, b1) andalso sameint(a2, b2)        | same (imgAddr(a0,a1,a2), imgAddr(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso samety(a1, b1) andalso sameint(a2, b2)
303        | same (imgLoad(a0,a1,a2), imgLoad(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)        | same (imgLoad(a0,a1,a2), imgLoad(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
304        | same (baseAddr a0, baseAddr b0) = ImageInfo.same(a0, b0)
305        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (Input(a0,a1,a2), Input(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
306        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)        | same (InputWithDefault(a0,a1,a2), InputWithDefault(b0,b1,b2)) = samety(a0, b0) andalso samestring(a1, b1) andalso samestring(a2, b2)
307        | same (Print(a0), Print(b0)) = sametys(a0, b0)        | same (Print(a0), Print(b0)) = sametys(a0, b0)
# Line 315  Line 323 
323        | hash (prodVec(a0)) = 0w47 + hashint a0        | hash (prodVec(a0)) = 0w47 + hashint a0
324        | hash (prodScaV(a0)) = 0w53 + hashint a0        | hash (prodScaV(a0)) = 0w53 + hashint a0
325        | hash (sumVec(a0)) = 0w59 + hashint a0        | hash (sumVec(a0)) = 0w59 + hashint a0
326           | hash (dotVec(a0)) = 0w59 + hashint a0
327        | hash (Abs(a0)) = 0w61 + hashty a0        | hash (Abs(a0)) = 0w61 + hashty a0
328        | hash (LT(a0)) = 0w67 + hashty a0        | hash (LT(a0)) = 0w67 + hashty a0
329        | hash (LTE(a0)) = 0w71 + hashty a0        | hash (LTE(a0)) = 0w71 + hashty a0
# Line 351  Line 360 
360        | hash (RealToInt(a0)) = 0w233 + hashint a0        | hash (RealToInt(a0)) = 0w233 + hashint a0
361        | hash (Transform(a0)) = 0w239 + ImageInfo.hash a0        | hash (Transform(a0)) = 0w239 + ImageInfo.hash a0
362        | hash (Translate(a0)) = 0w241 + ImageInfo.hash a0        | hash (Translate(a0)) = 0w241 + ImageInfo.hash a0
363        | hash (Kernel(a0,a1)) = 0w251 + Kernel.hash a0 + hashint a1  
364        | hash (ImageAddress(a0)) = 0w257 + ImageInfo.hash a0        | hash (ImageAddress(a0)) = 0w257 + ImageInfo.hash a0
365        | hash (LoadVoxels(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1        | hash (LoadVoxels(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1
366        | hash (Inside(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1        | hash (Inside(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1
367        | hash (LoadSeq(a0,a1)) = 0w271 + hashty a0 + hashstring a1        | hash (LoadSeq(a0,a1)) = 0w271 + hashty a0 + hashstring a1
368        | hash (LoadImage(a0)) = 0w277 + ImageInfo.hash a0  
369        | hash (imgAddr(a0,a1,a2)) = 0w281 + ImageInfo.hash a0 + hashty a1 + hashint a2        | hash (imgAddr(a0,a1,a2)) = 0w281 + ImageInfo.hash a0 + hashty a1 + hashint a2
370        | hash (imgLoad(a0,a1,a2)) = 0w283 + ImageInfo.hash a0 + hashint a1 + hashint a2        | hash (imgLoad(a0,a1,a2)) = 0w283 + ImageInfo.hash a0 + hashint a1 + hashint a2
371       | hash(baseAddr a0) = 0w281 + ImageInfo.hash a0
372        | hash (Input(a0,a1,a2)) = 0w293 + hashty a0 + hashstring a1 + hashstring a2        | hash (Input(a0,a1,a2)) = 0w293 + hashty a0 + hashstring a1 + hashstring a2
373        | hash (InputWithDefault(a0,a1,a2)) = 0w307 + hashty a0 + hashstring a1 + hashstring a2        | hash (InputWithDefault(a0,a1,a2)) = 0w307 + hashty a0 + hashstring a1 + hashstring a2
374        | hash (Print(a0)) = 0w311 + hashtys a0        | hash (Print(a0)) = 0w311 + hashtys a0
# Line 379  Line 389 
389        | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]        | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]
390        | toString (prodScaV(a0)) = concat["prodScaV<", intToString a0, ">"]        | toString (prodScaV(a0)) = concat["prodScaV<", intToString a0, ">"]
391        | toString (sumVec(a0)) = concat["sumVec<", intToString a0, ">"]        | toString (sumVec(a0)) = concat["sumVec<", intToString a0, ">"]
392                      | toString (dotVec(a0)) = concat["dotVec<", intToString a0, ">"]
393        | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]        | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
394        | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]        | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
395        | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]        | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
# Line 415  Line 426 
426        | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]        | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
427        | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]        | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
428        | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]        | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
429        | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]  
430        | toString (ImageAddress(a0)) = concat["ImageAddress<", ImageInfo.toString a0, ">"]        | toString (ImageAddress(a0)) = concat["ImageAddress<", ImageInfo.toString a0, ">"]
431        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
432        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
433        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]        | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
434        | toString (LoadImage(a0)) = concat["LoadImage<", ImageInfo.toString a0, ">"]  
435        | toString (imgAddr(a0,a1,a2)) = concat["imgAddr<", ImageInfo.toString a0, ",", tyToString a1, ",", intToString a2, ">"]        | toString (imgAddr(a0,a1,a2)) = concat["imgAddr<", ImageInfo.toString a0, ",", tyToString a1, ",", intToString a2, ">"]
436        | toString (imgLoad(a0,a1,a2)) = concat["imgLoad<", ImageInfo.toString a0, ",", intToString a1, ",", intToString a2, ">"]        | toString (imgLoad(a0,a1,a2)) = concat["imgLoad<", ImageInfo.toString a0, ",", intToString a1, ",", intToString a2, ">"]
437                | toString(baseAddr a0) = concat["baseAddr", ImageInfo.toString a0]
438        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (Input(a0,a1,a2)) = concat["Input<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
439        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]        | toString (InputWithDefault(a0,a1,a2)) = concat["InputWithDefault<", tyToString a0, ",", stringToString a1, ",", stringToString a2, ">"]
440        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]        | toString (Print(a0)) = concat["Print<", tysToString a0, ">"]

Legend:
Removed from v.2679  
changed lines
  Added in v.2680

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