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 2679, Tue Jul 29 04:18:35 2014 UTC revision 2680, Wed Aug 6 00:51:53 2014 UTC
# Line 5  Line 5 
5      structure Ty = TreeILTypes      structure Ty = TreeILTypes
6      structure Op = TreeOps      structure Op = TreeOps
7    
8      datatype oprator = LD of bool*int * int      datatype oprator = LDArr of bool*int * int
9            | LDVec of bool*int * int
10          | MKVEC of bool*int *int (*Aligned, RtnSize, ArgSize*)          | MKVEC of bool*int *int (*Aligned, RtnSize, ArgSize*)
11          | OP of Op.rator          | OP of Op.rator
12          | CONS of Ty.ty (*returns Diderot_real Prog-Ty*)          | CONS of Ty.ty (*returns Diderot_real Prog-Ty*)
# Line 16  Line 17 
17      fun q m=Int.toString(m)      fun q m=Int.toString(m)
18    
19    
20      fun same( LD(a2,a0,a1), LD(b2,b0,b1))= Op.sameint(a0, b0) andalso Op.sameint(a1, b1) andalso (a2=b2)      fun same( LDArr(a2,a0,a1), LDArr(b2,b0,b1))= Op.sameint(a0, b0) andalso Op.sameint(a1, b1) andalso (a2=b2)
21        | same( LDVec(a2,a0,a1), LDVec(b2,b0,b1))= Op.sameint(a0, b0) andalso Op.sameint(a1, b1) andalso (a2=b2)
22      | same ( MKVEC(a2,a0,a3),  MKVEC (b2,b0,b3))=Op.sameint(a0, b0) andalso Op.sameint(a3, b3)  andalso (a2=b2)      | same ( MKVEC(a2,a0,a3),  MKVEC (b2,b0,b3))=Op.sameint(a0, b0) andalso Op.sameint(a3, b3)  andalso (a2=b2)
23      | same ( OP a0,  OP b0)= Op.same(a0,b0)      | same ( OP a0,  OP b0)= Op.same(a0,b0)
24      | same ( CONS a0, CONS b0)= Ty.same(a0,b0)      | same ( CONS a0, CONS b0)= Ty.same(a0,b0)
25      | same ( CONSV a0, CONSV b0)= Op.sameint(a0,b0)      | same ( CONSV a0, CONSV b0)= Op.sameint(a0,b0)
26      | same _ =false      | same _ =false
27    
28      fun hash( LD(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
29      | hash( LD(_,a0,a1)) =0w3+Op.hashint a0 + Op.hashint a1      | hash( LDArr(_,a0,a1)) =0w3+Op.hashint a0 + Op.hashint a1
30        | hash( LDVec(true,a0,a1)) =0w17+Op.hashint a0 + Op.hashint a1+0w13
31        | hash( LDVec(_,a0,a1)) =0w17+Op.hashint a0 + Op.hashint a1
32      | hash ( MKVEC (true,tyNew,tyOrig))= 0w5 + Op.hashint tyOrig+0w13      | hash ( MKVEC (true,tyNew,tyOrig))= 0w5 + Op.hashint tyOrig+0w13
33      | hash ( MKVEC (_,tyNew,tyOrig))= 0w5 + Op.hashint tyOrig      | hash ( MKVEC (_,tyNew,tyOrig))= 0w5 + Op.hashint tyOrig
34      | hash ( OP(rator))= 0w7 + Op.hash(rator)      | hash ( OP(rator))= 0w7 + Op.hash(rator)
# Line 34  Line 38 
38      fun boolToString true="true"      fun boolToString true="true"
39        | boolToString false="false"        | boolToString false="false"
40    
41      fun toString( LD (b,tyNew,tyOrig))=      fun toString( LDArr (b,tyNew,tyOrig))=String.concat["LD:", q tyOrig , "to",q tyNew,boolToString b]
42          String.concat["LD:", q tyOrig , "to",q tyNew,boolToString b]        | toString( LDVec (b,tyNew,tyOrig))=String.concat["LD:", q tyOrig , "to",q tyNew,boolToString b]
43      | toString( MKVEC (b,tyNew,tyOrig))=      | toString( MKVEC (b,tyNew,tyOrig))=
44          String.concat["MKVEC(",q tyNew,"to",q tyOrig,")",boolToString b]          String.concat["MKVEC(",q tyNew,"to",q tyOrig,")",boolToString b]
45      | toString( OP(rator))=String.concat["OP-",Op.toString rator]      | toString( OP(rator))=String.concat["OP-",Op.toString rator]

Legend:
Removed from v.2679  
changed lines
  Added in v.2680

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