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

SCM Repository

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

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

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

revision 3080, Mon Mar 16 22:01:42 2015 UTC revision 3081, Mon Mar 16 22:08:21 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 102  Line 108 
108        | IntToReal        | IntToReal
109        | RealToInt of int        | RealToInt of int
110        | VoxelAddress of ImageInfo.info * int        | VoxelAddress of ImageInfo.info * int
111          | VoxelAddressWithCtl of ImageInfo.info * int * idxctl
112        | LoadVoxels of ImageInfo.info * int        | LoadVoxels of ImageInfo.info * int
113        | PosToImgSpace of ImageInfo.info        | PosToImgSpace of ImageInfo.info
114        | TensorToWorldSpace of ImageInfo.info * ty        | TensorToWorldSpace of ImageInfo.info * ty
# Line 167  Line 174 
174        | resultArity IntToReal = 1        | resultArity IntToReal = 1
175        | resultArity (RealToInt _) = 1        | resultArity (RealToInt _) = 1
176        | resultArity (VoxelAddress _) = 1        | resultArity (VoxelAddress _) = 1
177          | resultArity (VoxelAddressWithCtl _) = 1
178        | resultArity (LoadVoxels _) = 1        | resultArity (LoadVoxels _) = 1
179        | resultArity (PosToImgSpace _) = 1        | resultArity (PosToImgSpace _) = 1
180        | resultArity (TensorToWorldSpace _) = 1        | resultArity (TensorToWorldSpace _) = 1
# Line 232  Line 240 
240        | arity IntToReal = 1        | arity IntToReal = 1
241        | arity (RealToInt _) = 1        | arity (RealToInt _) = 1
242        | arity (VoxelAddress _) = ~1        | arity (VoxelAddress _) = ~1
243          | arity (VoxelAddressWithCtl _) = ~1
244        | arity (LoadVoxels _) = 1        | arity (LoadVoxels _) = 1
245        | arity (PosToImgSpace _) = 2        | arity (PosToImgSpace _) = 2
246        | arity (TensorToWorldSpace _) = 2        | arity (TensorToWorldSpace _) = 2
# Line 306  Line 315 
315        | same (IntToReal, IntToReal) = true        | same (IntToReal, IntToReal) = true
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 (VoxelAddressWithCtl(a0,a1,a2), VoxelAddressWithCtl(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1) andalso sameidxctl(a2, b2)
319        | 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)
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)
# Line 372  Line 382 
382        | hash IntToReal = 0w239        | hash IntToReal = 0w239
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 (VoxelAddressWithCtl(a0,a1,a2)) = 0w257 + ImageInfo.hash a0 + hashint a1 + hashidxctl a2
386        | hash (PosToImgSpace(a0)) = 0w263 + ImageInfo.hash a0        | hash (LoadVoxels(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1
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 437  Line 448 
448        | toString IntToReal = "IntToReal"        | toString IntToReal = "IntToReal"
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 (VoxelAddressWithCtl(a0,a1,a2)) = concat["VoxelAddressWithCtl<", ImageInfo.toString a0, ",", intToString a1, ",", idxctlToString a2, ">"]
452        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]        | toString (LoadVoxels(a0,a1)) = concat["LoadVoxels<", ImageInfo.toString a0, ",", intToString a1, ">"]
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, ">"]

Legend:
Removed from v.3080  
changed lines
  Added in v.3081

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