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

SCM Repository

[diderot] Diff of /trunk/src/compiler/IL/gen/mid-il.in
ViewVC logotype

Diff of /trunk/src/compiler/IL/gen/mid-il.in

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

revision 266, Tue Aug 10 21:25:40 2010 UTC revision 328, Wed Aug 18 22:19:26 2010 UTC
# Line 11  Line 11 
11  structure MidOps =  structure MidOps =
12    struct    struct
13    
14      datatype ty = BoolTy | StringTy | IntTy | TensorTy of int list      datatype ty = BoolTy | StringTy | IntTy | VecTy of int
15    
16        val realTy = VecTy 0
17    
18      fun samety (ty1 : ty, ty2) = (ty1 = ty2)      fun samety (ty1 : ty, ty2) = (ty1 = ty2)
19      fun hashty BoolTy = 0w1      fun hashty BoolTy = 0w1
20        | hashty StringTy = 0w2        | hashty StringTy = 0w2
21        | hashty IntTy = 0w3        | hashty IntTy = 0w3
22        | hashty (TensorTy dd) = List.foldl (fn (d, s) => Word.fromInt d + s) 0w4 dd        | hashty (VecTy d) = Word.fromInt d + 0w4
23      fun tyToString BoolTy = "bool"      fun tyToString BoolTy = "bool"
24        | tyToString StringTy = "string"        | tyToString StringTy = "string"
25        | tyToString IntTy = "int"        | tyToString IntTy = "int"
26        | tyToString (TensorTy dd) = String.concat[        | tyToString (VecTy 0) = "real"
27              "tensor[", String.concatWith "," (List.map Int.toString dd), "]"        | tyToString (VecTy d) = "vec" ^ Int.toString d
           ]  
28    
29      fun samestring (s1 : string, s2) = (s1 = s2)      fun samestring (s1 : string, s2) = (s1 = s2)
30      val hashstring = HashString.hashString      val hashstring = HashString.hashString

Legend:
Removed from v.266  
changed lines
  Added in v.328

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