Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/SSA/ssa-props-util.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/SSA/ssa-props-util.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 222 - (view) (download)
Original Path: sml/branches/SMLNJ/src/MLRISC/SSA/ssa-props-util.sml

1 : monnier 221 structure SSAPropsUtil : SSA_PROPERTIES_UTIL =
2 :     struct
3 :    
4 :     structure E = LabelExp
5 :     structure L = Label
6 :    
7 :     local
8 :    
9 :     fun hash(E.LABEL(L.Label{id,...})) = id + 10000
10 :     | hash(E.CONST i) = i
11 :     | hash(E.PLUS(x,y)) = hash x + hash y + 20000
12 :     | hash(E.MINUS(x,y)) = hash x + hash y + 30000
13 :     | hash(E.MULT(x,y)) = hash x + hash y + 40000
14 :     | hash(E.DIV(x,y)) = hash x + hash y + 50000
15 :     | hash(E.LSHIFT(x,i)) = hash x + Word.toIntX i + 60000
16 :     | hash(E.RSHIFT(x,i)) = hash x + Word.toIntX i + 7000
17 :     | hash(E.AND(x,i)) = hash x + Word.toIntX i + 80000
18 :     | hash(E.OR(x,i)) = hash x + Word.toIntX i + 90000
19 :    
20 :     fun eq(E.LABEL(L.Label{id=x,...}),E.LABEL(L.Label{id=y,...})) = x=y
21 :     | eq(E.CONST i, E.CONST j) = i = j
22 :     | eq(E.PLUS(a,b), E.PLUS(c,d)) = eq(a,c) andalso eq(b,d)
23 :     | eq(E.MINUS(a,b), E.MINUS(c,d)) = eq(a,c) andalso eq(b,d)
24 :     | eq(E.MULT(a,b), E.MULT(c,d)) = eq(a,c) andalso eq(b,d)
25 :     | eq(E.DIV(a,b), E.DIV(c,d)) = eq(a,c) andalso eq(b,d)
26 :     | eq(E.LSHIFT(a,b), E.LSHIFT(c,d)) = b = d andalso eq(a,c)
27 :     | eq(E.RSHIFT(a,b), E.RSHIFT(c,d)) = b = d andalso eq(a,c)
28 :     | eq(E.AND(a,b), E.AND(c,d)) = b = d andalso eq(a,c)
29 :     | eq(E.OR(a,b), E.OR(c,d)) = b = d andalso eq(a,c)
30 :     | eq _ = false
31 :    
32 :     in
33 :    
34 :     fun hashLabel(L.Label{id,...}) = id
35 :     fun eqLabel(L.Label{id=x,...},L.Label{id=y,...}) = x = y
36 :    
37 :     val hashLabelExp = hash
38 :     val eqLabelExp = eq
39 :    
40 :     end
41 :    
42 :     end
43 :    
44 :     (*
45 :     * $Log: ssa-props-util.sml,v $
46 :     * Revision 1.1.1.1 1998/11/16 21:47:06 george
47 :     * Version 110.10
48 :     *
49 :     *)

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