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

SCM Repository

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

Diff of /branches/charisee/src/compiler/mid-il/mid-il-types.sml

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

revision 2627, Sat May 17 00:44:22 2014 UTC revision 2628, Wed May 21 04:02:06 2014 UTC
# Line 21  Line 21 
21        | indexTy of int list (*Specific index *)        | indexTy of int list (*Specific index *)
22        | imgIndex of int list (*Image Index V_0 or V_1, [] for scalars*)        | imgIndex of int list (*Image Index V_0 or V_1, [] for scalars*)
23        | vectorLength of int list        | vectorLength of int list
24        | NativeVecTy of int  
25    
26    
27    
# Line 51  Line 51 
51        | same(indexTy dd1, indexTy dd2)=(dd1=dd2)        | same(indexTy dd1, indexTy dd2)=(dd1=dd2)
52        | same (imgIndex dd1, imgIndex dd2) = (dd1=dd2)        | same (imgIndex dd1, imgIndex dd2) = (dd1=dd2)
53        | same (vectorLength dd1, vectorLength  dd2) = (dd1=dd2)        | same (vectorLength dd1, vectorLength  dd2) = (dd1=dd2)
54        | same (NativeVecTy n1, NativeVecTy n2)=(n1=n2)  
55        | same _ = false        | same _ = false
56    
57      fun hash BoolTy = 0w1      fun hash BoolTy = 0w1
# Line 66  Line 66 
66        | hash (imgIndex _ )=0w19        | hash (imgIndex _ )=0w19
67        | hash (indexTy _)= 0w23        | hash (indexTy _)= 0w23
68        | hash (vectorLength _)=0w29        | hash (vectorLength _)=0w29
69        | hash (NativeVecTy n1)=0w37+ Word.fromInt n1  
70    
71    
72      fun toString BoolTy = "bool"      fun toString BoolTy = "bool"
73        | toString StringTy = "string"        | toString StringTy = "string"
74        | toString IntTy = "int"        | toString IntTy = "int"
75        | toString (TensorTy[]) = "real"        | toString (TensorTy[]) = "real"
76          | toString(TensorTy[n1])=String.concat["VecTy<", Int.toString n1, ">"]
77        | toString (TensorTy dd) = String.concat["tensor[", String.concatWith "," (List.map Int.toString dd), "]"  ]        | toString (TensorTy dd) = String.concat["tensor[", String.concatWith "," (List.map Int.toString dd), "]"  ]
78        | toString (TupleTy tys) = String.concat[ "(", String.concatWith " * " (List.map toString tys), ")"]        | toString (TupleTy tys) = String.concat[ "(", String.concatWith " * " (List.map toString tys), ")"]
79        | toString (SeqTy(ty, n)) = concat[toString ty, "{", Int.toString n, "}"]        | toString (SeqTy(ty, n)) = concat[toString ty, "{", Int.toString n, "}"]
# Line 83  Line 84 
84        | toString(indexTy dd)=String.concat["Specific Index:[", String.concatWith "," (List.map Int.toString dd), "]"]        | toString(indexTy dd)=String.concat["Specific Index:[", String.concatWith "," (List.map Int.toString dd), "]"]
85        | toString(imgIndex dd)=String.concat["ImgSpecificIndex:[", String.concatWith "," (List.map Int.toString dd), "]"]        | toString(imgIndex dd)=String.concat["ImgSpecificIndex:[", String.concatWith "," (List.map Int.toString dd), "]"]
86        | toString(vectorLength dd)=String.concat["[", String.concatWith "," (List.map Int.toString dd), "]"]        | toString(vectorLength dd)=String.concat["[", String.concatWith "," (List.map Int.toString dd), "]"]
87        | toString(NativeVecTy n1)=String.concat["<", Int.toString n1, ">"]  
88    
89    
90    

Legend:
Removed from v.2627  
changed lines
  Added in v.2628

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