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

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/Tools/MDL/mdl-rtl-tools.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/Tools/MDL/mdl-rtl-tools.sml

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

revision 774, Wed Jan 10 12:50:56 2001 UTC revision 775, Fri Jan 12 01:17:51 2001 UTC
# Line 26  Line 26 
26           | stm reduce (T.IF(T.FALSE, y, n)) = n           | stm reduce (T.IF(T.FALSE, y, n)) = n
27           | stm reduce s = s           | stm reduce s = s
28    
29         and rexp reduce (e as T.LI32 w) =         and (* rexp reduce (T.ADD(_,T.LI 0,x)) = x
               (T.LI(Word32.toIntX w) handle Overflow => e)  
          | rexp reduce (T.ADD(_,T.LI 0,x)) = x  
30           | rexp reduce (T.ADD(_,x,T.LI 0)) = x           | rexp reduce (T.ADD(_,x,T.LI 0)) = x
31           | rexp reduce (T.SUB(_,x,T.LI 0)) = x           | rexp reduce (T.SUB(_,x,T.LI 0)) = x
32           | rexp reduce (T.MULS(_,_,zero as T.LI 0)) = zero           | rexp reduce (T.MULS(_,_,zero as T.LI 0)) = zero
# Line 45  Line 43 
43           | rexp reduce (T.DIVT(_,x,T.LI 1)) = x           | rexp reduce (T.DIVT(_,x,T.LI 1)) = x
44           | rexp reduce (T.ANDB(_,_,zero as T.LI 0)) = zero           | rexp reduce (T.ANDB(_,_,zero as T.LI 0)) = zero
45           | rexp reduce (T.ANDB(_,zero as T.LI 0,_)) = zero           | rexp reduce (T.ANDB(_,zero as T.LI 0,_)) = zero
46           | rexp reduce (e as T.ANDB(_,x,y)) =           | *) rexp reduce (e as T.ANDB(_,x,y)) =
47               if RTL.Util.eqRexp(x,y) then x else e               if RTL.Util.eqRexp(x,y) then x else e
48           | rexp reduce (T.ORB(_,x,T.LI 0)) = x           (* | rexp reduce (T.ORB(_,x,T.LI 0)) = x
49           | rexp reduce (T.ORB(_,T.LI 0,x)) = x           | rexp reduce (T.ORB(_,T.LI 0,x)) = x *)
50           | rexp reduce (e as T.ORB(_,x,y)) =           | rexp reduce (e as T.ORB(_,x,y)) =
51               if RTL.Util.eqRexp(x,y) then x else e               if RTL.Util.eqRexp(x,y) then x else e
52           | rexp reduce (T.NOTB(_,T.NOTB(_,x))) = x           | rexp reduce (T.NOTB(_,T.NOTB(_,x))) = x
# Line 84  Line 82 
82      *      *
83      *========================================================================*)      *========================================================================*)
84     fun transRTL     fun transRTL
85          {app,id,int,word32,string,list,Nil,tuple,record,arg,          {app,id,int,intinf,word32,string,list,Nil,tuple,record,arg,
86           cellkind,oper,region}           cellkind,oper,region}
87                  rtl =                  rtl =
88     let fun word w = word32(Word.toLargeWord w)     let fun word w = word32(Word.toLargeWord w)
89         fun binOp n (ty,x,y) = app(n,[int ty,rexp x,rexp y])         fun binOp n (ty,x,y) = app(n,[int ty,rexp x,rexp y])
90         and unaryOp n (ty,x) = app(n,[int ty,rexp x])         and unaryOp n (ty,x) = app(n,[int ty,rexp x])
91         and rexp(T.LI i) = app("LI",[int i])         and rexp(T.LI i) = app("LI",[intinf i])
          | rexp(T.LI32 w) = app("LI32",[word32 w])  
92           | rexp(T.NEG x) = unaryOp "NEG" x           | rexp(T.NEG x) = unaryOp "NEG" x
93           | rexp(T.ADD x) = binOp "ADD" x           | rexp(T.ADD x) = binOp "ADD" x
94           | rexp(T.SUB x) = binOp "SUB" x           | rexp(T.SUB x) = binOp "SUB" x
# Line 193  Line 190 
190         fun oper(T.OPER{name,...}) = A.IDexp(A.IDENT(["P"],name))         fun oper(T.OPER{name,...}) = A.IDexp(A.IDENT(["P"],name))
191         val region=A.IDexp(A.IDENT(["T","Region"],"memory"))         val region=A.IDexp(A.IDENT(["T","Region"],"memory"))
192     in  transRTL{id=id, app=app, list=A.LISTexp, string=string,     in  transRTL{id=id, app=app, list=A.LISTexp, string=string,
193                  int=int, word32=U.WORD32exp, Nil=A.LISTexp([],NONE),                  int=int, intinf=U.INTINFexp,
194                    word32=U.WORD32exp, Nil=A.LISTexp([],NONE),
195                  tuple=A.TUPLEexp, record=A.RECORDexp,                  tuple=A.TUPLEexp, record=A.RECORDexp,
196                  region=region, arg=arg, cellkind=cellkind, oper=oper                  region=region, arg=arg, cellkind=cellkind, oper=oper
197                 } rtl                 } rtl
# Line 209  Line 207 
207           | app(n, es) = A.CONSpat(mkId n, SOME(A.TUPLEpat es))           | app(n, es) = A.CONSpat(mkId n, SOME(A.TUPLEpat es))
208         fun record ps = A.RECORDpat(ps,false)         fun record ps = A.RECORDpat(ps,false)
209         val int = U.INTpat         val int = U.INTpat
210           val intinf= U.INTINFpat
211         val string= U.STRINGpat         val string= U.STRINGpat
212         fun arg(ty,a,name) = A.IDpat name         fun arg(ty,a,name) = A.IDpat name
213         fun cellkind k = A.IDpat(CellsBasis.cellkindToString k)         fun cellkind k = A.IDpat(CellsBasis.cellkindToString k)
# Line 217  Line 216 
216              SOME(A.RECORDpat([("name",U.STRINGpat name)],true)))              SOME(A.RECORDpat([("name",U.STRINGpat name)],true)))
217         val region=A.WILDpat         val region=A.WILDpat
218     in  transRTL{id=id, app=app, list=A.LISTpat, string=string,     in  transRTL{id=id, app=app, list=A.LISTpat, string=string,
219                  int=int, word32=U.WORD32pat, Nil=A.LISTpat([],NONE),                  int=int, intinf=intinf,
220                    word32=U.WORD32pat, Nil=A.LISTpat([],NONE),
221                  tuple=A.TUPLEpat, record=record, region=region,                  tuple=A.TUPLEpat, record=record, region=region,
222                  arg=arg, cellkind=cellkind, oper=oper                  arg=arg, cellkind=cellkind, oper=oper
223                 } rtl                 } rtl

Legend:
Removed from v.774  
changed lines
  Added in v.775

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