SCM Repository
Diff of /trunk/src/compiler/IL/high-il.sml
Parent Directory
|
Revision Log
|
Patch
revision 186, Thu Jul 29 04:26:57 2010 UTC | revision 187, Thu Jul 29 14:00:37 2010 UTC | |
---|---|---|
# | Line 11 | Line 11 |
11 | structure HighOps = | structure HighOps = |
12 | struct | struct |
13 | ||
14 | type ty = BoolTy | StringTy | IntTy | TensorTy of int list | datatype ty = BoolTy | StringTy | IntTy | TensorTy of int list |
15 | ||
16 | fun sameTy (ty1 : ty, ty2) = (ty1 = ty2) | fun samety (ty1 : ty, ty2) = (ty1 = ty2) |
17 | fun hashty BoolTy = 0w1 | |
18 | | hashty StringTy = 0w2 | |
19 | | hashty IntTy = 0w3 | |
20 | | hashty (TensorTy dd) = List.foldl (fn (d, s) => Word.fromInt d + s) 0w4 dd | |
21 | fun tyToString BoolTy = "bool" | |
22 | | tyToString StringTy = "string" | |
23 | | tyToString IntTy = "int" | |
24 | | tyToString (TensorTy dd) = String.concat[ | |
25 | "tensor[", String.concatWith "," (List.map Int.toString dd), "]" | |
26 | ] | |
27 | ||
28 | datatype rator | datatype rator |
29 | = Add of ty | = Add of ty |
# | Line 200 | Line 210 |
210 | end | end |
211 | ||
212 | structure HighIL = SSAFn(HighOps) | structure HighIL = SSAFn(HighOps) |