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

SCM Repository

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

Diff of /branches/charisee/src/compiler/low-il/low-il.sml

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

revision 2614, Fri May 9 19:23:07 2014 UTC revision 2615, Wed May 14 00:22:49 2014 UTC
# Line 24  Line 24 
24    
25    (* required helper functions for the int type *)    (* required helper functions for the int type *)
26      fun sameint (i1 : int, i2) = (i1 = i2)      fun sameint (i1 : int, i2) = (i1 = i2)
27          fun samereal (i1, i2) = sameint(Real.floor i1,Real.floor  i2)
28      fun hashint i = Word.fromInt i      fun hashint i = Word.fromInt i
29        fun hashreal i = Word.fromInt(Real.floor  i)
30      fun intToString i = Int.toString i      fun intToString i = Int.toString i
31         fun realToString i = Int.toString(Real.floor (i))
32    
33    (* required helper functions for the string type *)    (* required helper functions for the string type *)
34      fun samestring (s1 : string, s2) = (s1 = s2)      fun samestring (s1 : string, s2) = (s1 = s2)
# Line 115  Line 118 
118        | resultArity Not = 1        | resultArity Not = 1
119        | resultArity Max = 1        | resultArity Max = 1
120        | resultArity Min = 1        | resultArity Min = 1
121          | resultArity (CR _) = 1
122        | resultArity (C _) = 1        | resultArity (C _) = 1
123        | resultArity (V _) = 1        | resultArity (V _) = 1
124        | resultArity (S _) = 1        | resultArity (S _) = 1
# Line 181  Line 185 
185        | arity Not = 1        | arity Not = 1
186        | arity Max = 2        | arity Max = 2
187        | arity Min = 2        | arity Min = 2
188          | arity (CR _) = 2
189        | arity (C _) = 2        | arity (C _) = 2
190        | arity (V _) = 2        | arity (V _) = 2
191        | arity (S _) = 2        | arity (S _) = 2
# Line 254  Line 259 
259        | same (Not, Not) = true        | same (Not, Not) = true
260        | same (Max, Max) = true        | same (Max, Max) = true
261        | same (Min, Min) = true        | same (Min, Min) = true
262          | same (CR(a0), CR(b0)) = samereal(a0, b0)
263        | same (C(a0), C(b0)) = sameint(a0, b0)        | same (C(a0), C(b0)) = sameint(a0, b0)
264        | 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)
265        | 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)
# Line 321  Line 327 
327        | hash Not = 0w43        | hash Not = 0w43
328        | hash Max = 0w47        | hash Max = 0w47
329        | hash Min = 0w53        | hash Min = 0w53
330        | hash (C(a0)) = 0w59 + hashint a0        | hash (CR(a0)) = 0w59 + hashreal a0
331        | hash (V(a0,a1,a2,a3)) = 0w61 + hashint a0 + hashint a1 + hashty a2 + hashty a3        | hash (C(a0)) = 0w61 + hashint a0
332        | hash (S(a0,a1,a2)) = 0w67 + hashint a0 + hashty a1 + hashty a2        | hash (V(a0,a1,a2,a3)) = 0w67 + hashint a0 + hashint a1 + hashty a2 + hashty a3
333        | hash addSca = 0w71        | hash (S(a0,a1,a2)) = 0w71 + hashint a0 + hashty a1 + hashty a2
334        | hash subSca = 0w73        | hash addSca = 0w73
335        | hash prodSca = 0w79        | hash subSca = 0w79
336        | hash divSca = 0w83        | hash prodSca = 0w83
337        | hash (cons(a0,a1)) = 0w89 + hashty a0 + hashint a1        | hash divSca = 0w89
338        | hash (imgAddr(a0,a1,a2)) = 0w97 + ImageInfo.hash a0 + hashty a1 + hashint a2        | hash (cons(a0,a1)) = 0w97 + hashty a0 + hashint a1
339        | hash (imgLoad(a0,a1,a2)) = 0w101 + ImageInfo.hash a0 + hashint a1 + hashint a2        | hash (imgAddr(a0,a1,a2)) = 0w101 + ImageInfo.hash a0 + hashty a1 + hashint a2
340        | hash (addVec(a0)) = 0w103 + hashint a0        | hash (imgLoad(a0,a1,a2)) = 0w103 + ImageInfo.hash a0 + hashint a1 + hashint a2
341        | hash (subVec(a0)) = 0w107 + hashint a0        | hash (addVec(a0)) = 0w107 + hashint a0
342        | hash (prodVec(a0)) = 0w109 + hashint a0        | hash (subVec(a0)) = 0w109 + hashint a0
343        | hash (prodScaV(a0)) = 0w113 + hashint a0        | hash (prodVec(a0)) = 0w113 + hashint a0
344        | hash (sumVec(a0)) = 0w127 + hashint a0        | hash (prodScaV(a0)) = 0w127 + hashint a0
345        | hash (Clamp(a0)) = 0w131 + hashty a0        | hash (sumVec(a0)) = 0w131 + hashint a0
346        | hash (Lerp(a0)) = 0w137 + hashty a0        | hash (Clamp(a0)) = 0w137 + hashty a0
347        | hash (Norm(a0)) = 0w139 + hashty a0        | hash (Lerp(a0)) = 0w139 + hashty a0
348        | hash (Normalize(a0)) = 0w149 + hashint a0        | hash (Norm(a0)) = 0w149 + hashty a0
349        | hash (PrincipleEvec(a0)) = 0w151 + hashty a0        | hash (Normalize(a0)) = 0w151 + hashint a0
350        | hash EigenVecs2x2 = 0w157        | hash (PrincipleEvec(a0)) = 0w157 + hashty a0
351        | hash EigenVecs3x3 = 0w163        | hash EigenVecs2x2 = 0w163
352        | hash EigenVals2x2 = 0w167        | hash EigenVecs3x3 = 0w167
353        | hash EigenVals3x3 = 0w173        | hash EigenVals2x2 = 0w173
354        | hash (Zero(a0)) = 0w179 + hashty a0        | hash EigenVals3x3 = 0w179
355        | hash (Select(a0,a1)) = 0w181 + hashty a0 + hashint a1        | hash (Zero(a0)) = 0w181 + hashty a0
356        | hash (Index(a0,a1)) = 0w191 + hashty a0 + hashint a1        | hash (Select(a0,a1)) = 0w191 + hashty a0 + hashint a1
357        | hash (Subscript(a0)) = 0w193 + hashty a0        | hash (Index(a0,a1)) = 0w193 + hashty a0 + hashint a1
358        | hash (MkDynamic(a0,a1)) = 0w197 + hashty a0 + hashint a1        | hash (Subscript(a0)) = 0w197 + hashty a0
359        | hash (Append(a0)) = 0w199 + hashty a0        | hash (MkDynamic(a0,a1)) = 0w199 + hashty a0 + hashint a1
360        | hash (Prepend(a0)) = 0w211 + hashty a0        | hash (Append(a0)) = 0w211 + hashty a0
361        | hash (Concat(a0)) = 0w223 + hashty a0        | hash (Prepend(a0)) = 0w223 + hashty a0
362        | hash (Length(a0)) = 0w227 + hashty a0        | hash (Concat(a0)) = 0w227 + hashty a0
363        | hash (Ceiling(a0)) = 0w229 + hashint a0        | hash (Length(a0)) = 0w229 + hashty a0
364        | hash (Floor(a0)) = 0w233 + hashint a0        | hash (Ceiling(a0)) = 0w233 + hashint a0
365        | hash (Round(a0)) = 0w239 + hashint a0        | hash (Floor(a0)) = 0w239 + hashint a0
366        | hash (Trunc(a0)) = 0w241 + hashint a0        | hash (Round(a0)) = 0w241 + hashint a0
367        | hash IntToReal = 0w251        | hash (Trunc(a0)) = 0w251 + hashint a0
368        | hash (RealToInt(a0)) = 0w257 + hashint a0        | hash IntToReal = 0w257
369        | hash (Transform(a0)) = 0w263 + ImageInfo.hash a0        | hash (RealToInt(a0)) = 0w263 + hashint a0
370        | hash (Translate(a0)) = 0w269 + ImageInfo.hash a0        | hash (Transform(a0)) = 0w269 + ImageInfo.hash a0
371        | hash (Kernel(a0,a1)) = 0w271 + Kernel.hash a0 + hashint a1        | hash (Translate(a0)) = 0w271 + ImageInfo.hash a0
372        | hash (ImageAddress(a0)) = 0w277 + ImageInfo.hash a0        | hash (Kernel(a0,a1)) = 0w277 + Kernel.hash a0 + hashint a1
373        | hash (LoadVoxels(a0,a1)) = 0w281 + ImageInfo.hash a0 + hashint a1        | hash (ImageAddress(a0)) = 0w281 + ImageInfo.hash a0
374        | hash (Inside(a0,a1)) = 0w283 + ImageInfo.hash a0 + hashint a1        | hash (LoadVoxels(a0,a1)) = 0w283 + ImageInfo.hash a0 + hashint a1
375        | hash (LoadSeq(a0,a1)) = 0w293 + hashty a0 + hashstring a1        | hash (Inside(a0,a1)) = 0w293 + ImageInfo.hash a0 + hashint a1
376        | hash (LoadImage(a0)) = 0w307 + ImageInfo.hash a0        | hash (LoadSeq(a0,a1)) = 0w307 + hashty a0 + hashstring a1
377        | hash (Input(a0,a1,a2)) = 0w311 + hashty a0 + hashstring a1 + hashstring a2        | hash (LoadImage(a0)) = 0w311 + ImageInfo.hash a0
378        | hash (InputWithDefault(a0,a1,a2)) = 0w313 + hashty a0 + hashstring a1 + hashstring a2        | hash (Input(a0,a1,a2)) = 0w313 + hashty a0 + hashstring a1 + hashstring a2
379        | hash (Print(a0)) = 0w317 + hashtys a0        | hash (InputWithDefault(a0,a1,a2)) = 0w317 + hashty a0 + hashstring a1 + hashstring a2
380          | hash (Print(a0)) = 0w331 + hashtys a0
381    
382      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
383        | toString ISub = "ISub"        | toString ISub = "ISub"
# Line 387  Line 394 
394        | toString Not = "Not"        | toString Not = "Not"
395        | toString Max = "Max"        | toString Max = "Max"
396        | toString Min = "Min"        | toString Min = "Min"
397          | toString (CR(a0)) = concat["CR<", realToString a0, ">"]
398        | toString (C(a0)) = concat["C<", intToString a0, ">"]        | toString (C(a0)) = concat["C<", intToString a0, ">"]
399        | 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, ">"]
400        | 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, ">"]

Legend:
Removed from v.2614  
changed lines
  Added in v.2615

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