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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/tree-il/tree-func.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/tree-il/tree-func.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2689, Thu Aug 28 13:59:40 2014 UTC revision 2690, Fri Aug 29 15:41:22 2014 UTC
# Line 12  Line 12 
12          | STORE of bool*int *int (*Aligned, RtnSize, ArgSize*)          | STORE of bool*int *int (*Aligned, RtnSize, ArgSize*)
13    
14    
15        fun iTos m=Int.toString m
16    
17      fun q m=Int.toString(m)      fun same( LDArr(a0,a1,a2), LDArr(b0,b1,b2))=(a0=b0) andalso Op.sameint(a1, b1) andalso Op.sameint(a2, b2)
18        | same ( STORE(a0,a1,a2),  STORE(b0,b1,b2))=(a0=b0) andalso Op.sameint(a1, b1) andalso Op.sameint(a2, b2)
   
     fun same( LDArr(a2,a0,a1), LDArr(b2,b0,b1))= Op.sameint(a0, b0) andalso Op.sameint(a1, b1) andalso (a2=b2)  
     | same ( STORE(a2,a0,a3),  STORE(b2,b0,b3))=Op.sameint(a0, b0) andalso Op.sameint(a3, b3)  andalso (a2=b2)  
19      | same ( OP a0,  OP b0)= Op.same(a0,b0)      | same ( OP a0,  OP b0)= Op.same(a0,b0)
20      | same ( CONS a0, CONS b0)= Ty.same(a0,b0)      | same ( CONS a0, CONS b0)= Ty.same(a0,b0)
21      | same ( CONSV a0, CONSV b0)= Op.sameint(a0,b0)      | same ( CONSV a0, CONSV b0)= Op.sameint(a0,b0)
22      | same _ =false      | same _ =false
23    
24    
25      fun hash( LDArr(true,a0,a1)) =0w3+Op.hashint a0 + Op.hashint a1+0w13      fun hash( LDArr(true,a0,a1)) =0w3+Op.hashint a0 + Op.hashint a1+0w13
26      | hash( LDArr(_,a0,a1)) =0w3+Op.hashint a0 + Op.hashint a1      | hash( LDArr(_,a0,a1)) =0w3+Op.hashint a0 + Op.hashint a1
27      | hash ( STORE  (true,tyNew,tyOrig))= 0w13 + Op.hashint tyOrig      | hash ( STORE  (true,nSize,oSize))= 0w13 + Op.hashint nSize  + Op.hashint oSize
28      | hash ( STORE  (false,tyNew,tyOrig))= 0w19 + Op.hashint tyOrig      | hash ( STORE  (false,nSize,oSize))= 0w19 + Op.hashint nSize  + Op.hashint oSize
29      | hash ( OP(rator))= 0w7 + Op.hash(rator)      | hash ( OP rator)= 0w7 + Op.hash(rator)
30      | hash(  CONS a0)= 0w11 +Ty.hash(a0)      | hash(  CONS a0)= 0w11 +Ty.hash(a0)
31      | hash(  CONSV a0)= 0w13 +Op.hashint a0      | hash(  CONSV a0)= 0w13 +Op.hashint a0
32    
33      fun boolToString true="true"      fun boolToString true="true"
34        | boolToString false="false"        | boolToString false="false"
35    
36      fun toString( LDArr (b,tyNew,tyOrig))=String.concat["LDArr:", q tyOrig , "to",q tyNew,boolToString b]      fun toString( LDArr (b,nSize,oSize))=String.concat["LDArr:", iTos oSize , "to",iTos nSize,boolToString b]
37        | toString( STORE  (b,tyNew,tyOrig))=      | toString( STORE  (b,nSize,oSize))= String.concat["STOREToArr(",iTos nSize,"to",iTos oSize,")",boolToString b]
38          String.concat["STOREToArr(",q tyNew,"to",q tyOrig,")",boolToString b]      | toString( OP rator)=String.concat["OP-",Op.toString rator]
39      | toString( OP(rator))=String.concat["OP-",Op.toString rator]      | toString( CONS a0)= String.concat["CONStoArrayType-",Ty.toString a0]
40      | toString( CONS a0)= String.concat["CONStoArrayType-",Ty.toString(a0)]      | toString( CONSV a0)= String.concat["CONStoVecType-",iTos a0]
     | toString( CONSV a0)= String.concat["CONStoVecType-",q(a0)]  
   
   
41    
42      fun cmp(e1,e2)=String.compare(toString e1, toString e2)      fun cmp(e1,e2)=String.compare(toString e1, toString e2)
43    
# Line 61  Line 57 
57    
58      structure  OprSet= RedBlackSetFn(OprKey);      structure  OprSet= RedBlackSetFn(OprKey);
59    
60    
61        fun setToString(typs,ops,prefix)=let
62            val str1= List.map Ty.toString typs
63            val str2=List.map toString ops
64        in
65            String.concat[prefix,"\n \t Types: ",String.concatWith "," str1,"\n \t cFn: ",String.concatWith "\n\t" str2]
66        end
67    
68  end  end

Legend:
Removed from v.2689  
changed lines
  Added in v.2690

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