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 282, Fri Aug 13 19:20:23 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      fun samety (ty1 : ty, ty2) = (ty1 = ty2)      fun samety (ty1 : ty, ty2) = (ty1 = ty2)
17      fun hashty BoolTy = 0w1      fun hashty BoolTy = 0w1
18        | hashty StringTy = 0w2        | hashty StringTy = 0w2
19        | hashty IntTy = 0w3        | hashty IntTy = 0w3
20        | hashty (TensorTy dd) = List.foldl (fn (d, s) => Word.fromInt d + s) 0w4 dd        | hashty (VecTy d) = Word.fromInt d + 0w4
21      fun tyToString BoolTy = "bool"      fun tyToString BoolTy = "bool"
22        | tyToString StringTy = "string"        | tyToString StringTy = "string"
23        | tyToString IntTy = "int"        | tyToString IntTy = "int"
24        | tyToString (TensorTy dd) = String.concat[        | tyToString (VecTy 0) = "real"
25              "tensor[", String.concatWith "," (List.map Int.toString dd), "]"        | tyToString (VecTy d) = "vec" ^ Int.toString d
           ]  
26    
27      fun samestring (s1 : string, s2) = (s1 = s2)      fun samestring (s1 : string, s2) = (s1 = s2)
28      val hashstring = HashString.hashString      val hashstring = HashString.hashString

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

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