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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 344 - (view) (download)

1 : lamonts 344 (* low-il.in
2 :     *
3 :     * COPYRIGHT (c) 2010 The Diderot Project (http://diderot.cs.uchicago.edu)
4 :     * All rights reserved.
5 :     *
6 :     * Lower-level version of the Diderot IL input file.
7 :     *
8 :     *)
9 :    
10 :     structure LowOps =
11 :     struct
12 :    
13 :     datatype ty = BoolTy | StringTy | IntTy | VecTy of int
14 :    
15 :     val realTy = VecTy 0
16 :    
17 :     fun samety (ty1 : ty, ty2) = (ty1 = ty2)
18 :     fun hashty BoolTy = 0w1
19 :     | hashty StringTy = 0w2
20 :     | hashty IntTy = 0w3
21 :     | hashty (VecTy d) = Word.fromInt d + 0w4
22 :     fun tyToString BoolTy = "bool"
23 :     | tyToString StringTy = "string"
24 :     | tyToString IntTy = "int"
25 :     | tyToString (VecTy 0) = "real"
26 :     | tyToString (VecTy d) = "vec" ^ Int.toString d
27 :    
28 :     fun sameint (i1 : int, i2) = (i1 = i2)
29 :     fun hashint i = Word.fromInt i
30 :     fun intToString i = Int.toString i
31 :    
32 :     fun samestring (s1 : string, s2) = (s1 = s2)
33 :     val hashstring = HashString.hashString
34 :     fun stringToString s = String.concat["\"", s, "\""]
35 :    
36 :     @BODY@
37 :    
38 :     end
39 :    
40 :     structure MidIL = SSAFn(LowOps)

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