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 3628, Sun Jan 31 14:30:06 2016 UTC revision 3720, Mon Apr 4 18:20:42 2016 UTC
# Line 23  Line 23 
23      type tys = ty list      type tys = ty list
24      fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)      fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
25      fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys      fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
26      fun tysToString tys = String.concat["[", String.concatWith "," (List.map tyToString tys), "]" ]      fun tysToString tys = String.concat["[", String.concatWithMap "," tyToString tys, "]" ]
27    
28    (* required helper functions for the int type *)    (* required helper functions for the int type *)
29      fun sameint (i1 : int, i2) = (i1 = i2)      fun sameint (i1 : int, i2) = (i1 = i2)
# Line 101  Line 101 
101        | Kernel of Kernel.kernel * int        | Kernel of Kernel.kernel * int
102        | Transform of ImageInfo.info        | Transform of ImageInfo.info
103        | Translate of ImageInfo.info        | Translate of ImageInfo.info
       | EvalKernel of int * Kernel.kernel * int  
104        | VoxelAddress of ImageInfo.info * int        | VoxelAddress of ImageInfo.info * int
105        | VoxelAddressWithCtl of ImageInfo.info * int * idxctl        | VoxelAddressWithCtl of ImageInfo.info * int * idxctl
106        | LoadVoxels of ImageInfo.info * int        | LoadVoxels of ImageInfo.info * int
# Line 162  Line 161 
161        | resultArity (Kernel _) = 1        | resultArity (Kernel _) = 1
162        | resultArity (Transform _) = 1        | resultArity (Transform _) = 1
163        | resultArity (Translate _) = 1        | resultArity (Translate _) = 1
       | resultArity (EvalKernel _) = 1  
164        | resultArity (VoxelAddress _) = 1        | resultArity (VoxelAddress _) = 1
165        | resultArity (VoxelAddressWithCtl _) = 1        | resultArity (VoxelAddressWithCtl _) = 1
166        | resultArity (LoadVoxels _) = 1        | resultArity (LoadVoxels _) = 1
# Line 223  Line 221 
221        | arity (Kernel _) = 0        | arity (Kernel _) = 0
222        | arity (Transform _) = 1        | arity (Transform _) = 1
223        | arity (Translate _) = 1        | arity (Translate _) = 1
       | arity (EvalKernel _) = 1  
224        | arity (VoxelAddress _) = ~1        | arity (VoxelAddress _) = ~1
225        | arity (VoxelAddressWithCtl _) = ~1        | arity (VoxelAddressWithCtl _) = ~1
226        | arity (LoadVoxels _) = 1        | arity (LoadVoxels _) = 1
# Line 291  Line 288 
288        | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)        | same (Kernel(a0,a1), Kernel(b0,b1)) = Kernel.same(a0, b0) andalso sameint(a1, b1)
289        | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)        | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
290        | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)        | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
       | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)  
291        | same (VoxelAddress(a0,a1), VoxelAddress(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)        | same (VoxelAddress(a0,a1), VoxelAddress(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
292        | same (VoxelAddressWithCtl(a0,a1,a2), VoxelAddressWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)        | same (VoxelAddressWithCtl(a0,a1,a2), VoxelAddressWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)
293        | 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)
# Line 353  Line 349 
349        | hash (Kernel(a0,a1)) = 0w227 + Kernel.hash a0 + hashint a1        | hash (Kernel(a0,a1)) = 0w227 + Kernel.hash a0 + hashint a1
350        | hash (Transform(a0)) = 0w229 + ImageInfo.hash a0        | hash (Transform(a0)) = 0w229 + ImageInfo.hash a0
351        | hash (Translate(a0)) = 0w233 + ImageInfo.hash a0        | hash (Translate(a0)) = 0w233 + ImageInfo.hash a0
352        | hash (EvalKernel(a0,a1,a2)) = 0w239 + hashint a0 + Kernel.hash a1 + hashint a2        | hash (VoxelAddress(a0,a1)) = 0w239 + ImageInfo.hash a0 + hashint a1
353        | hash (VoxelAddress(a0,a1)) = 0w241 + ImageInfo.hash a0 + hashint a1        | hash (VoxelAddressWithCtl(a0,a1,a2)) = 0w241 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2
354        | hash (VoxelAddressWithCtl(a0,a1,a2)) = 0w251 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2        | hash (LoadVoxels(a0,a1)) = 0w251 + ImageInfo.hash a0 + hashint a1
355        | hash (LoadVoxels(a0,a1)) = 0w257 + ImageInfo.hash a0 + hashint a1        | hash (Inside(a0,a1)) = 0w257 + ImageInfo.hash a0 + hashint a1
356        | hash (Inside(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1        | hash (ImageDim(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1
357        | hash (ImageDim(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1        | hash (LoadSeq(a0,a1)) = 0w269 + hashty a0 + hashstring a1
358        | hash (LoadSeq(a0,a1)) = 0w271 + hashty a0 + hashstring a1        | hash (LoadImage(a0,a1)) = 0w271 + hashty a0 + hashstring a1
359        | hash (LoadImage(a0,a1)) = 0w277 + hashty a0 + hashstring a1        | hash (Print(a0)) = 0w277 + hashtys a0
360        | hash (Print(a0)) = 0w281 + hashtys a0        | hash (MathFn(a0)) = 0w281 + MathFns.hash a0
       | hash (MathFn(a0)) = 0w283 + MathFns.hash a0  
361    
362      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
363        | toString ISub = "ISub"        | toString ISub = "ISub"
# Line 414  Line 409 
409        | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]        | toString (Kernel(a0,a1)) = concat["Kernel<", Kernel.toString a0, ",", intToString a1, ">"]
410        | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]        | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
411        | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]        | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
       | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]  
412        | toString (VoxelAddress(a0,a1)) = concat["VoxelAddress<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (VoxelAddress(a0,a1)) = concat["VoxelAddress<", ImageInfo.toString a0, ",", intToString a1, ">"]
413        | toString (VoxelAddressWithCtl(a0,a1,a2)) = concat["VoxelAddressWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]        | toString (VoxelAddressWithCtl(a0,a1,a2)) = concat["VoxelAddressWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]
414        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]

Legend:
Removed from v.3628  
changed lines
  Added in v.3720

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