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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/mid-il/mid-il.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/mid-il/mid-il.sml

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

revision 2962, Thu Mar 5 15:12:00 2015 UTC revision 3072, Sun Mar 15 16:33:00 2015 UTC
# Line 48  Line 48 
48      val hashinput = Inputs.hash      val hashinput = Inputs.hash
49      val inputToString = Inputs.toString      val inputToString = Inputs.toString
50    
51      (* required helper functions for the index control type type *)
52        type idxctl = IndexCtl.ctl
53        val sameidxctl = IndexCtl.same
54        val hashidxctl = IndexCtl.hash
55        val idxctlToString = IndexCtl.toString
56    
57      datatype rator      datatype rator
58        = Add of ty        = Add of ty
59        | Sub of ty        | Sub of ty
# Line 103  Line 109 
109        | RealToInt of int        | RealToInt of int
110        | VoxelAddress of ImageInfo.info * int        | VoxelAddress of ImageInfo.info * int
111        | LoadVoxels of ImageInfo.info * int        | LoadVoxels of ImageInfo.info * int
112          | VoxelAddressWithCtl of ImageInfo.info * int * idxctl
113        | PosToImgSpace of ImageInfo.info        | PosToImgSpace of ImageInfo.info
114        | TensorToWorldSpace of ImageInfo.info * ty        | TensorToWorldSpace of ImageInfo.info * ty
115        | EvalKernel of int * Kernel.kernel * int        | EvalKernel of int * Kernel.kernel * int
# Line 168  Line 175 
175        | resultArity (RealToInt _) = 1        | resultArity (RealToInt _) = 1
176        | resultArity (VoxelAddress _) = 1        | resultArity (VoxelAddress _) = 1
177        | resultArity (LoadVoxels _) = 1        | resultArity (LoadVoxels _) = 1
178          | resultArity (VoxelAddressWithCtl _) = 1
179        | resultArity (PosToImgSpace _) = 1        | resultArity (PosToImgSpace _) = 1
180        | resultArity (TensorToWorldSpace _) = 1        | resultArity (TensorToWorldSpace _) = 1
181        | resultArity (EvalKernel _) = 1        | resultArity (EvalKernel _) = 1
# Line 233  Line 241 
241        | arity (RealToInt _) = 1        | arity (RealToInt _) = 1
242        | arity (VoxelAddress _) = ~1        | arity (VoxelAddress _) = ~1
243        | arity (LoadVoxels _) = 1        | arity (LoadVoxels _) = 1
244          | arity (VoxelAddressWithCtl _) = ~1
245        | arity (PosToImgSpace _) = 2        | arity (PosToImgSpace _) = 2
246        | arity (TensorToWorldSpace _) = 2        | arity (TensorToWorldSpace _) = 2
247        | arity (EvalKernel _) = 1        | arity (EvalKernel _) = 1
# Line 307  Line 316 
316        | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)        | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
317        | 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)
318        | 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)
319          | same (VoxelAddressWithCtl(a0,a1,a2), VoxelAddressWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)
320        | same (PosToImgSpace(a0), PosToImgSpace(b0)) = ImageInfo.same(a0, b0)        | same (PosToImgSpace(a0), PosToImgSpace(b0)) = ImageInfo.same(a0, b0)
321        | same (TensorToWorldSpace(a0,a1), TensorToWorldSpace(b0,b1)) = ImageInfo.same(a0, b0) andalso samety(a1, b1)        | same (TensorToWorldSpace(a0,a1), TensorToWorldSpace(b0,b1)) = ImageInfo.same(a0, b0) andalso samety(a1, b1)
322        | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)        | same (EvalKernel(a0,a1,a2), EvalKernel(b0,b1,b2)) = sameint(a0, b0) andalso Kernel.same(a1, b1) andalso sameint(a2, b2)
# Line 373  Line 383 
383        | hash (RealToInt(a0)) = 0w241 + hashint a0        | hash (RealToInt(a0)) = 0w241 + hashint a0
384        | hash (VoxelAddress(a0,a1)) = 0w251 + ImageInfo.hash a0 + hashint a1        | hash (VoxelAddress(a0,a1)) = 0w251 + ImageInfo.hash a0 + hashint a1
385        | hash (LoadVoxels(a0,a1)) = 0w257 + ImageInfo.hash a0 + hashint a1        | hash (LoadVoxels(a0,a1)) = 0w257 + ImageInfo.hash a0 + hashint a1
386        | hash (PosToImgSpace(a0)) = 0w263 + ImageInfo.hash a0        | hash (VoxelAddressWithCtl(a0,a1,a2)) = 0w263 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2
387        | hash (TensorToWorldSpace(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashty a1        | hash (PosToImgSpace(a0)) = 0w269 + ImageInfo.hash a0
388        | hash (EvalKernel(a0,a1,a2)) = 0w271 + hashint a0 + Kernel.hash a1 + hashint a2        | hash (TensorToWorldSpace(a0,a1)) = 0w271 + ImageInfo.hash a0 + hashty a1
389        | hash (Inside(a0,a1)) = 0w277 + ImageInfo.hash a0 + hashint a1        | hash (EvalKernel(a0,a1,a2)) = 0w277 + hashint a0 + Kernel.hash a1 + hashint a2
390        | hash (ImageDim(a0,a1)) = 0w281 + ImageInfo.hash a0 + hashint a1        | hash (Inside(a0,a1)) = 0w281 + ImageInfo.hash a0 + hashint a1
391        | hash (LoadSeq(a0,a1)) = 0w283 + hashty a0 + hashstring a1        | hash (ImageDim(a0,a1)) = 0w283 + ImageInfo.hash a0 + hashint a1
392        | hash (LoadImage(a0,a1)) = 0w293 + hashty a0 + hashstring a1        | hash (LoadSeq(a0,a1)) = 0w293 + hashty a0 + hashstring a1
393        | hash (Input(a0)) = 0w307 + hashinput a0        | hash (LoadImage(a0,a1)) = 0w307 + hashty a0 + hashstring a1
394        | hash (InputWithDefault(a0)) = 0w311 + hashinput a0        | hash (Input(a0)) = 0w311 + hashinput a0
395        | hash (Print(a0)) = 0w313 + hashtys a0        | hash (InputWithDefault(a0)) = 0w313 + hashinput a0
396          | hash (Print(a0)) = 0w317 + hashtys a0
397    
398      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]      fun toString (Add(a0)) = concat["Add<", tyToString a0, ">"]
399        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]        | toString (Sub(a0)) = concat["Sub<", tyToString a0, ">"]
# Line 438  Line 449 
449        | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]        | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
450        | toString (VoxelAddress(a0,a1)) = concat["VoxelAddress<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (VoxelAddress(a0,a1)) = concat["VoxelAddress<", ImageInfo.toString a0, ",", intToString a1, ">"]
451        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
452          | toString (VoxelAddressWithCtl(a0,a1,a2)) = concat["VoxelAddressWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]
453        | toString (PosToImgSpace(a0)) = concat["PosToImgSpace<", ImageInfo.toString a0, ">"]        | toString (PosToImgSpace(a0)) = concat["PosToImgSpace<", ImageInfo.toString a0, ">"]
454        | toString (TensorToWorldSpace(a0,a1)) = concat["TensorToWorldSpace<", ImageInfo.toString a0, ",", tyToString a1, ">"]        | toString (TensorToWorldSpace(a0,a1)) = concat["TensorToWorldSpace<", ImageInfo.toString a0, ",", tyToString a1, ">"]
455        | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]        | toString (EvalKernel(a0,a1,a2)) = concat["EvalKernel<", intToString a0, ",", Kernel.toString a1, ",", intToString a2, ">"]

Legend:
Removed from v.2962  
changed lines
  Added in v.3072

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