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-types.sml
ViewVC logotype

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

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

revision 3480, Fri Dec 4 18:30:36 2015 UTC revision 3529, Tue Dec 22 18:25:22 2015 UTC
# Line 20  Line 20 
20        | ImageTy of ImageInfo.info        | ImageTy of ImageInfo.info
21        | KernelTy        | KernelTy
22  (* FIXME: ask Charisee about the following *)  (* FIXME: ask Charisee about the following *)
23        | indexTy of int list (* Specific index *)        | IndexTy of int list (* Specific index *)
24        | imgIndex of int list (* Image Index V_0 or V_1, [] for scalars *)        | ImgIndexTy of int list (* Image Index V_0 or V_1, [] for scalars *)
25        | vectorLength of int list        | VectorLengthTy of int list
26        | unionTy of int  (*union5_t *)        | UnionTy of int  (*union5_t *)
27        | R of RationalEin.rat        | R of RationalEin.rat
28    
29      val intTy = IntTy      val intTy = IntTy
# Line 50  Line 50 
50  (* ??? the following don't seem correct ??? *)  (* ??? the following don't seem correct ??? *)
51        | same (TensorTy[], intTy) = true        | same (TensorTy[], intTy) = true
52        | same (intTy, TensorTy[]) = true        | same (intTy, TensorTy[]) = true
53        | same (indexTy dd1, indexTy dd2)=(dd1=dd2)        | same (IndexTy dd1, IndexTy dd2)=(dd1=dd2)
54        | same (imgIndex dd1, imgIndex dd2) = (dd1=dd2)        | same (ImgIndexTy dd1, ImgIndexTy dd2) = (dd1=dd2)
55        | same (vectorLength dd1, vectorLength  dd2) = (dd1=dd2)        | same (VectorLengthTy dd1, VectorLengthTy  dd2) = (dd1=dd2)
56        | same (unionTy n1, unionTy n2)= (n1=n2)        | same (UnionTy n1, UnionTy n2)= (n1=n2)
57        | same _ = false        | same _ = false
58    
59      fun hash BoolTy = 0w1      fun hash BoolTy = 0w1
# Line 65  Line 65 
65        | hash (AddrTy info) = 0w5 + ImageInfo.hash info        | hash (AddrTy info) = 0w5 + ImageInfo.hash info
66        | hash (ImageTy info) = 0w13 * ImageInfo.hash info + 0w6        | hash (ImageTy info) = 0w13 * ImageInfo.hash info + 0w6
67        | hash KernelTy = 0w17        | hash KernelTy = 0w17
68        | hash (imgIndex _ )=0w19        | hash (ImgIndexTy _ )=0w19
69        | hash (indexTy dd)= List.foldl (fn (d, s) => 0w11 * Word.fromInt d + s) 0w23 dd        | hash (IndexTy dd)= List.foldl (fn (d, s) => 0w11 * Word.fromInt d + s) 0w23 dd
70        | hash (vectorLength _)=0w29        | hash (VectorLengthTy _)=0w29
71        | hash (unionTy n1)= 0w31        | hash (UnionTy n1)= 0w31
72    
73      fun toString BoolTy = "bool"      fun toString BoolTy = "bool"
74        | toString StringTy = "string"        | toString StringTy = "string"
# Line 81  Line 81 
81        | toString (AddrTy info) = concat["addr(", ImageInfo.toString info, ")"]        | toString (AddrTy info) = concat["addr(", ImageInfo.toString info, ")"]
82        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]        | toString (ImageTy info) = concat["image(", ImageInfo.toString info, ")"]
83        | toString KernelTy = "kernel"        | toString KernelTy = "kernel"
84        | toString (indexTy []) = "-"        | toString (IndexTy []) = "-"
85        | toString (indexTy dd) = String.concat["Specific Index:[", String.concatWithMap "," Int.toString dd, "]"]        | toString (IndexTy dd) = String.concat["Specific Index:[", String.concatWithMap "," Int.toString dd, "]"]
86        | toString (imgIndex dd) = String.concat["ImgSpecificIndex:[", String.concatWithMap "," Int.toString dd, "]"]        | toString (ImgIndexTy dd) = String.concat["ImgSpecificIndex:[", String.concatWithMap "," Int.toString dd, "]"]
87        | toString (vectorLength dd) = String.concat["[", String.concatWithMap "," Int.toString dd, "]"]        | toString (VectorLengthTy dd) = String.concat["[", String.concatWithMap "," Int.toString dd, "]"]
88        | toString (unionTy n1) = String.concat["Unionty", Int.toString n1]        | toString (UnionTy n1) = String.concat["Unionty", Int.toString n1]
89    
90      (*Quick fix*)      (*Quick fix*)
91      fun cmp (e1, e2) = String.compare(toString(e1), toString(e2))      fun cmp (e1, e2) = String.compare(toString(e1), toString(e2))

Legend:
Removed from v.3480  
changed lines
  Added in v.3529

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