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

SCM Repository

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

Annotation of /trunk/src/compiler/IL/gen/high-il.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 226 - (view) (download)

1 : jhr 186 (* high-il.sml
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * High-level version of the Diderot IL.
7 :     *
8 :     * Note: this file is generated from gen/high-il.spec and gen/high-il.in.
9 :     *)
10 :    
11 :     structure HighOps =
12 :     struct
13 :    
14 : jhr 187 datatype ty = BoolTy | StringTy | IntTy | TensorTy of int list
15 : jhr 186
16 : jhr 187 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 : jhr 186
28 : jhr 226 fun samestring (s1 : string, s2) = (s1 = s2)
29 :     val hashstring = HashString.hashString
30 :     fun stringToString s = String.concat["\"", s, "\""]
31 :    
32 : jhr 186 @BODY@
33 :    
34 :     end
35 :    
36 :     structure HighIL = SSAFn(HighOps)

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