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 3804, Tue May 3 18:03:41 2016 UTC revision 3846, Wed May 11 13:35:09 2016 UTC
# Line 17  Line 17 
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
19        | ImageTy of ImageInfo.info        | ImageTy of ImageInfo.info
20          | StrandTy of Atom.atom
21    
22      val intTy = IntTy      val intTy = IntTy
23      val realTy = TensorTy[]      val realTy = TensorTy[]
# Line 39  Line 40 
40        | same (SeqTy(ty1, NONE), SeqTy(ty2, NONE)) = same(ty1, ty2)        | same (SeqTy(ty1, NONE), SeqTy(ty2, NONE)) = same(ty1, ty2)
41        | 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)
42        | same (ImageTy info1, ImageTy info2) = ImageInfo.sameShape(info1, info2)        | same (ImageTy info1, ImageTy info2) = ImageInfo.sameShape(info1, info2)
43          | same (StrandTy n1, StrandTy n2) = Atom.same(n1, n2)
44        | same _ = false        | same _ = false
45    
46      fun hash BoolTy = 0w1      fun hash BoolTy = 0w1
# Line 49  Line 51 
51        | hash (SeqTy(ty, NONE)) = hash ty + 0w11        | hash (SeqTy(ty, NONE)) = hash ty + 0w11
52        | hash (SeqTy(ty, SOME n)) = Word.fromInt n * hash ty + 0w13        | hash (SeqTy(ty, SOME n)) = Word.fromInt n * hash ty + 0w13
53        | hash (ImageTy info) = 0w5 * ImageInfo.hash info + 0w17        | hash (ImageTy info) = 0w5 * ImageInfo.hash info + 0w17
54          | hash (StrandTy n) = Atom.hash n
55    
56      fun toString BoolTy = "bool"      fun toString BoolTy = "bool"
57        | toString StringTy = "string"        | toString StringTy = "string"
# Line 63  Line 66 
66        | toString (SeqTy(ty, NONE)) = toString ty ^ "[]"        | toString (SeqTy(ty, NONE)) = toString ty ^ "[]"
67        | toString (SeqTy(ty, SOME n)) = concat[toString ty, "[", Int.toString n, "]"]        | toString (SeqTy(ty, SOME n)) = concat[toString ty, "[", Int.toString n, "]"]
68        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]
69          | toString (StrandTy n) = Atom.toString n
70    
71    end    end
72    

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

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