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/treeOps.sml
ViewVC logotype

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

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

revision 2623, Thu May 15 20:01:40 2014 UTC revision 2624, Fri May 16 17:53:41 2014 UTC
# Line 51  Line 51 
51        | Not        | Not
52        | Max        | Max
53        | Min        | Min
54        | C of int  
       | V of int * int * ty * ty  
       | S of int * ty * ty  
55        | addSca        | addSca
56        | subSca        | subSca
57        | prodSca        | prodSca
58        | divSca        | divSca
59        | cons of ty * int        | addVec of int
       | imgAddr of ImageInfo.info * ty * int  
       | imgLoad of ImageInfo.info * int * int  
   
       | addVec of int *int* ty  
   
  (*Made different operators just to test it out  
  AddVec-(6,flag [(4,0), (2,2)])  
  ProdVec n   (var, var)  
  subVec,prodScaV  
   
  *)  
       | LoadVec of ty * int  
       | StoreVec of ty * int  
       | prodVec of int  
60        | subVec of int        | subVec of int
61          | prodVec of int
62        | prodScaV of int        | prodScaV of int
63        | sumVec of int        | sumVec of int
64     | V of int * int * ty * ty
65     | S of int * ty * ty
66     | imgAddr of ImageInfo.info * ty * int
67     | imgLoad of ImageInfo.info * int * int
68    
69        | Clamp of ty        | Clamp of ty
70        | Lerp of ty        | Lerp of ty
# Line 128  Line 117 
117        | resultArity Not = 1        | resultArity Not = 1
118        | resultArity Max = 1        | resultArity Max = 1
119        | resultArity Min = 1        | resultArity Min = 1
120        | resultArity (C _) = 1  
121        | resultArity (V _) = 1        | resultArity (V _) = 1
122        | resultArity (S _) = 1        | resultArity (S _) = 1
123        | resultArity addSca = 1        | resultArity addSca = 1
124        | resultArity subSca = 1        | resultArity subSca = 1
125        | resultArity prodSca = 1        | resultArity prodSca = 1
126        | resultArity divSca = 1        | resultArity divSca = 1
       | resultArity (cons _) = 1  
127        | resultArity (imgAddr _) = 1        | resultArity (imgAddr _) = 1
128        | resultArity (imgLoad _) = 1        | resultArity (imgLoad _) = 1
129        | resultArity (addVec _) = 1        | resultArity (addVec _) = 1
# Line 143  Line 131 
131        | resultArity (prodVec _) = 1        | resultArity (prodVec _) = 1
132        | resultArity (prodScaV _) = 1        | resultArity (prodScaV _) = 1
133        | resultArity (sumVec _) = 1        | resultArity (sumVec _) = 1
  | resultArity (LoadVec _) = 1  
  | resultArity (StoreVec _) = 1  
134        | resultArity (Clamp _) = 1        | resultArity (Clamp _) = 1
135        | resultArity (Lerp _) = 1        | resultArity (Lerp _) = 1
136        | resultArity (Norm _) = 1        | resultArity (Norm _) = 1
# Line 196  Line 182 
182        | arity Not = 1        | arity Not = 1
183        | arity Max = 2        | arity Max = 2
184        | arity Min = 2        | arity Min = 2
185        | arity (C _) = 2  
186        | arity (V _) = 2        | arity (V _) = 2
187        | arity (S _) = 2        | arity (S _) = 2
188        | arity addSca = 2        | arity addSca = 2
189        | arity subSca = 2        | arity subSca = 2
190        | arity prodSca = 2        | arity prodSca = 2
191        | arity divSca = 2        | arity divSca = 2
       | arity (cons _) = 2  
192        | arity (imgAddr _) = 2        | arity (imgAddr _) = 2
193        | arity (imgLoad _) = 2        | arity (imgLoad _) = 2
194        | arity (addVec _) = 2        | arity (addVec _) = 2
# Line 211  Line 196 
196        | arity (prodVec _) = 2        | arity (prodVec _) = 2
197        | arity (prodScaV _) = 2        | arity (prodScaV _) = 2
198        | arity (sumVec _) = 1        | arity (sumVec _) = 1
  | arity (LoadVec _) = 1  
  | arity (StoreVec _) = 1  
199        | arity (Clamp _) = 3        | arity (Clamp _) = 3
200        | arity (Lerp _) = 3        | arity (Lerp _) = 3
201        | arity (Norm _) = 1        | arity (Norm _) = 1
# Line 271  Line 254 
254        | same (Not, Not) = true        | same (Not, Not) = true
255        | same (Max, Max) = true        | same (Max, Max) = true
256        | same (Min, Min) = true        | same (Min, Min) = true
257        | same (C(a0), C(b0)) = sameint(a0, b0)  
258        | same (V(a0,a1,a2,a3), V(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)        | same (V(a0,a1,a2,a3), V(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)
259        | same (S(a0,a1,a2), S(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)        | same (S(a0,a1,a2), S(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)
260        | same (addSca, addSca) = true        | same (addSca, addSca) = true
261        | same (subSca, subSca) = true        | same (subSca, subSca) = true
262        | same (prodSca, prodSca) = true        | same (prodSca, prodSca) = true
263        | same (divSca, divSca) = true        | same (divSca, divSca) = true
       | same (cons(a0,a1), cons(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)  
264        | 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)
265        | 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)
266        | same (addVec(a0,a1,a2), addVec(b0,b1,b2)) =        | same (addVec(a0), addVec(b0)) =sameint(a0, b0)
         sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2)  
267        | same (subVec(a0), subVec(b0)) =        | same (subVec(a0), subVec(b0)) =
268              sameint(a0, b0)              sameint(a0, b0)
269        | same (prodVec(a0), prodVec(b0)) =        | same (prodVec(a0), prodVec(b0)) =
# Line 290  Line 271 
271        | same (prodScaV(a0), prodScaV(b0)) =        | same (prodScaV(a0), prodScaV(b0)) =
272              sameint(a0, b0)              sameint(a0, b0)
273        | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)        | same (sumVec(a0), sumVec(b0)) = sameint(a0, b0)
  | same (LoadVec(a0,a1), LoadVec(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)  
  | same (StoreVec(a0,a1), StoreVec(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)  
274        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)        | same (Clamp(a0), Clamp(b0)) = samety(a0, b0)
275        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)        | same (Lerp(a0), Lerp(b0)) = samety(a0, b0)
276        | same (Norm(a0), Norm(b0)) = samety(a0, b0)        | same (Norm(a0), Norm(b0)) = samety(a0, b0)
# Line 344  Line 323 
323        | hash Not = 0w43        | hash Not = 0w43
324        | hash Max = 0w47        | hash Max = 0w47
325        | hash Min = 0w53        | hash Min = 0w53
       | hash (C(a0)) = 0w61 + hashint a0  
326        | hash (V(a0,a1,a2,a3)) = 0w67 + hashint a0 + hashint a1 + hashty a2 + hashty a3        | hash (V(a0,a1,a2,a3)) = 0w67 + hashint a0 + hashint a1 + hashty a2 + hashty a3
327        | hash (S(a0,a1,a2)) = 0w71 + hashint a0 + hashty a1 + hashty a2        | hash (S(a0,a1,a2)) = 0w71 + hashint a0 + hashty a1 + hashty a2
328        | hash addSca = 0w73        | hash addSca = 0w73
329        | hash subSca = 0w79        | hash subSca = 0w79
330        | hash prodSca = 0w83        | hash prodSca = 0w83
331        | hash divSca = 0w89        | hash divSca = 0w89
       | hash (cons(a0,a1)) = 0w97 + hashty a0 + hashint a1  
332        | hash (imgAddr(a0,a1,a2)) = 0w101 + ImageInfo.hash a0 + hashty a1 + hashint a2        | hash (imgAddr(a0,a1,a2)) = 0w101 + ImageInfo.hash a0 + hashty a1 + hashint a2
333        | hash (imgLoad(a0,a1,a2)) = 0w103 + ImageInfo.hash a0 + hashint a1 + hashint a2        | hash (imgLoad(a0,a1,a2)) = 0w103 + ImageInfo.hash a0 + hashint a1 + hashint a2
334        | hash (addVec(a0,a1,a2)) = 0w107 + hashint a0+ hashint a1+hashty a2        | hash (addVec(a0)) = 0w107 + hashint a0
335        | hash (subVec(a0)) = 0w107 + hashint a0        | hash (subVec(a0)) = 0w107 + hashint a0
336        | hash (prodVec(a0)) = 0w107 + hashint a0        | hash (prodVec(a0)) = 0w107 + hashint a0
337        | hash (prodScaV(a0)) = 0w107 + hashint a0        | hash (prodScaV(a0)) = 0w107 + hashint a0
338        | hash (sumVec(a0)) = 0w107 + hashint a0        | hash (sumVec(a0)) = 0w107 + hashint a0
  | hash (LoadVec(a0,a1)) = 0w131 + hashty a0 + hashint a1  
  | hash (StoreVec(a0,a1)) = 0w137 + hashty a0 + hashint a1  
339        | hash (Clamp(a0)) = 0w137 + hashty a0        | hash (Clamp(a0)) = 0w137 + hashty a0
340        | hash (Lerp(a0)) = 0w139 + hashty a0        | hash (Lerp(a0)) = 0w139 + hashty a0
341        | hash (Norm(a0)) = 0w149 + hashty a0        | hash (Norm(a0)) = 0w149 + hashty a0
# Line 412  Line 387 
387        | toString Not = "Not"        | toString Not = "Not"
388        | toString Max = "Max"        | toString Max = "Max"
389        | toString Min = "Min"        | toString Min = "Min"
390        | toString (C(a0)) = concat["C<", intToString a0, ">"]  
391        | toString (V(a0,a1,a2,a3)) = concat["V<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]        | toString (V(a0,a1,a2,a3)) = concat["V<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
392        | toString (S(a0,a1,a2)) = concat["S<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]        | toString (S(a0,a1,a2)) = concat["S<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]
393        | toString addSca = "addSca"        | toString addSca = "addSca"
394        | toString subSca = "subSca"        | toString subSca = "subSca"
395        | toString prodSca = "prodSca"        | toString prodSca = "prodSca"
396        | toString divSca = "divSca"        | toString divSca = "divSca"
       | toString (cons(a0,a1)) = concat["cons<", tyToString a0, ",", intToString a1, ">"]  
397        | 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, ">"]
398        | 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, ">"]
399        | toString (addVec(a0,a1,ty)) = concat["addVec<", intToString a0,intToString a1,tyToString ty ,">"]        | toString (addVec(a0)) = concat["addVec<", intToString a0,">"]
400        | toString (subVec(a0)) = concat["subVec<", intToString a0,">"]        | toString (subVec(a0)) = concat["subVec<", intToString a0,">"]
401        | toString (prodVec(a0)) = concat["prodVec<", intToString a0,">"]        | toString (prodVec(a0)) = concat["prodVec<", intToString a0,">"]
402        | toString (prodScaV(a0)) = concat["prodScaVec<", intToString a0,">"]        | toString (prodScaV(a0)) = concat["prodScaVec<", intToString a0,">"]
403        | toString (sumVec(a0)) = concat["sumVec<", intToString a0,">"]        | toString (sumVec(a0)) = concat["sumVec<", intToString a0,">"]
           | toString (LoadVec(a0,a1)) = concat["LoadVec<", tyToString a0, ",", intToString a1, ">"]  
               | toString (StoreVec(a0,a1)) = concat["StoreVec<", tyToString a0, ",", intToString a1, ">"]  
404        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]        | toString (Clamp(a0)) = concat["Clamp<", tyToString a0, ">"]
405        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]        | toString (Lerp(a0)) = concat["Lerp<", tyToString a0, ">"]
406        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]        | toString (Norm(a0)) = concat["Norm<", tyToString a0, ">"]

Legend:
Removed from v.2623  
changed lines
  Added in v.2624

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