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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/low-ir/low-types.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/low-ir/low-types.sml

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

revision 3802, Tue May 3 17:13:30 2016 UTC revision 3804, Tue May 3 18:03:41 2016 UTC
# Line 16  Line 16 
16        | TensorTy of int list            (* tensor types, which include reals, vectors, etc. *)        | TensorTy of int list            (* tensor types, which include reals, vectors, etc. *)
17        | TupleTy of ty list              (* tuples; used for multiple return values *)        | TupleTy of ty list              (* tuples; used for multiple return values *)
18        | SeqTy of ty * int option        | SeqTy of ty * int option
       | AddrTy of ImageInfo.info        (* voxel address *)  
19        | ImageTy of ImageInfo.info        | ImageTy of ImageInfo.info
20    
21      val intTy = IntTy      val intTy = IntTy
# Line 39  Line 38 
38        | same (TupleTy tys1, TupleTy tys2) = ListPair.allEq same (tys1, tys2)        | same (TupleTy tys1, TupleTy tys2) = ListPair.allEq same (tys1, tys2)
39        | same (SeqTy(ty1, NONE), SeqTy(ty2, NONE)) = same(ty1, ty2)        | same (SeqTy(ty1, NONE), SeqTy(ty2, NONE)) = same(ty1, ty2)
40        | same (SeqTy(ty1, SOME n1), SeqTy(ty2, SOME n2)) = (n1 = n2) andalso same(ty1, ty2)        | same (SeqTy(ty1, SOME n1), SeqTy(ty2, SOME n2)) = (n1 = n2) andalso same(ty1, ty2)
       | same (AddrTy info1, AddrTy info2) = ImageInfo.same(info1, info2)  
41        | same (ImageTy info1, ImageTy info2) = ImageInfo.sameShape(info1, info2)        | same (ImageTy info1, ImageTy info2) = ImageInfo.sameShape(info1, info2)
42        | same _ = false        | same _ = false
43    
# Line 50  Line 48 
48        | hash (TupleTy tys) = List.foldl (fn (ty, s) => hash ty + s) 0w7 tys        | hash (TupleTy tys) = List.foldl (fn (ty, s) => hash ty + s) 0w7 tys
49        | hash (SeqTy(ty, NONE)) = hash ty + 0w11        | hash (SeqTy(ty, NONE)) = hash ty + 0w11
50        | hash (SeqTy(ty, SOME n)) = Word.fromInt n * hash ty + 0w13        | hash (SeqTy(ty, SOME n)) = Word.fromInt n * hash ty + 0w13
51        | hash (AddrTy info) = 0w17 + ImageInfo.hash info        | hash (ImageTy info) = 0w5 * ImageInfo.hash info + 0w17
       | hash (ImageTy info) = 0w5 * ImageInfo.hash info + 0w23  
52    
53      fun toString BoolTy = "bool"      fun toString BoolTy = "bool"
54        | toString StringTy = "string"        | toString StringTy = "string"
# Line 65  Line 62 
62            ]            ]
63        | toString (SeqTy(ty, NONE)) = toString ty ^ "[]"        | toString (SeqTy(ty, NONE)) = toString ty ^ "[]"
64        | toString (SeqTy(ty, SOME n)) = concat[toString ty, "[", Int.toString n, "]"]        | toString (SeqTy(ty, SOME n)) = concat[toString ty, "[", Int.toString n, "]"]
       | toString (AddrTy info) = concat["addr(", ImageInfo.toString info, ")"]  
65        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]
66    
67    end    end

Legend:
Removed from v.3802  
changed lines
  Added in v.3804

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