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/ppc/mltree/ppc.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/ppc/mltree/ppc.sml

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

revision 839, Thu Jun 7 20:28:44 2001 UTC revision 889, Thu Jul 19 20:35:20 2001 UTC
# Line 27  Line 27 
27    structure T   = I.T    structure T   = I.T
28    structure S   = T.Stream    structure S   = T.Stream
29    structure C   = PPCInstr.C    structure C   = PPCInstr.C
30      structure CB  = CellsBasis
31    structure W32 = Word32    structure W32 = Word32
32    structure A   = MLRiscAnnotations    structure A   = MLRiscAnnotations
33    
# Line 50  Line 51 
51     *)     *)
52    fun MTLR r = I.MTSPR{rs=r, spr=C.lr}    fun MTLR r = I.MTSPR{rs=r, spr=C.lr}
53    fun MFLR r = I.MFSPR{rt=r, spr=C.lr}    fun MFLR r = I.MFSPR{rt=r, spr=C.lr}
54    val CR0 = C.Reg C.CC 0    val CR0 = C.Reg CB.CC 0
55    val RET = I.BCLR{bo=I.ALWAYS, bf=CR0, bit=I.LT, LK=false, labels=[]}    val RET = I.BCLR{bo=I.ALWAYS, bf=CR0, bit=I.LT, LK=false, labels=[]}
56    fun SLLI32{r,i,d} =    fun SLLI32{r,i,d} =
57        I.ROTATEI{oper=I.RLWINM,ra=d,rs=r,sh=I.ImmedOp i,mb=0,me=SOME(31-i)}        I.ROTATEI{oper=I.RLWINM,ra=d,rs=r,sh=I.ImmedOp i,mb=0,me=SOME(31-i)}
# Line 63  Line 64 
64    functor Multiply32 = MLTreeMult    functor Multiply32 = MLTreeMult
65      (structure I = I      (structure I = I
66       structure T = T       structure T = T
67         structure CB = CellsBasis
68       val intTy = 32       val intTy = 32
69       type arg  = {r1:C.cell,r2:C.cell,d:C.cell}       type arg  = {r1:CB.cell,r2:CB.cell,d:CB.cell}
70       type argi = {r:C.cell,i:int,d:C.cell}       type argi = {r:CB.cell,i:int,d:CB.cell}
71    
72       fun mov{r,d} = I.COPY{dst=[d],src=[r],tmp=NONE,impl=ref NONE}       fun mov{r,d} = I.COPY{dst=[d],src=[r],tmp=NONE,impl=ref NONE}
73       fun add{r1,r2,d}= I.ARITH{oper=I.ADD,ra=r1,rb=r2,rt=d,Rc=false,OE=false}       fun add{r1,r2,d}= I.ARITH{oper=I.ADD,ra=r1,rb=r2,rt=d,Rc=false,OE=false}
# Line 114  Line 116 
116    
117        val newReg = C.newReg        val newReg = C.newReg
118        val newFreg = C.newFreg        val newFreg = C.newFreg
119        val newCCreg = C.newCell C.CC        val newCCreg = C.newCell CB.CC
120    
121    
122        val int_0       = T.I.int_0        val int_0       = T.I.int_0
# Line 134  Line 136 
136        fun unsigned6 mi  = LE(int_0, mi) andalso LT(mi, T.I.int_64)        fun unsigned6 mi  = LE(int_0, mi) andalso LT(mi, T.I.int_64)
137    
138        fun move(rs,rd,an) =        fun move(rs,rd,an) =
139          if C.sameColor(rs,rd) then ()          if CB.sameColor(rs,rd) then ()
140          else mark(I.COPY{dst=[rd],src=[rs],impl=ref NONE,tmp=NONE},an)          else mark(I.COPY{dst=[rd],src=[rs],impl=ref NONE,tmp=NONE},an)
141    
142        fun fmove(fs,fd,an) =        fun fmove(fs,fd,an) =
143          if C.sameColor(fs,fd) then ()          if CB.sameColor(fs,fd) then ()
144          else mark(I.FCOPY{dst=[fd],src=[fs],impl=ref NONE,tmp=NONE},an)          else mark(I.FCOPY{dst=[fd],src=[fs],impl=ref NONE,tmp=NONE},an)
145    
146        fun ccmove(ccs,ccd,an) =        fun ccmove(ccs,ccd,an) =
147          if C.sameColor(ccd,ccs) then () else mark(I.MCRF{bf=ccd, bfa=ccs},an)          if CB.sameColor(ccd,ccs) then () else mark(I.MCRF{bf=ccd, bfa=ccs},an)
148    
149        fun copy(dst, src, an) =        fun copy(dst, src, an) =
150            mark(I.COPY{dst=dst, src=src, impl=ref NONE,            mark(I.COPY{dst=dst, src=src, impl=ref NONE,
# Line 529  Line 531 
531         * the value.         * the value.
532         *)         *)
533        and expr(rexp as T.REG(_,r)) =        and expr(rexp as T.REG(_,r)) =
534            if C.sameColor(C.lr, r) then            if CB.sameColor(C.lr, r) then
535            let val rt = newReg()            let val rt = newReg()
536            in  doExpr(rexp, rt, []); rt end            in  doExpr(rexp, rt, []); rt end
537            else r            else r
# Line 542  Line 544 
544         *    and annotate the expression with an         *    and annotate the expression with an
545         *)         *)
546        and doExpr(e, rt, an) =        and doExpr(e, rt, an) =
547             if C.sameColor(rt,C.lr) then             if CB.sameColor(rt,C.lr) then
548             let val rt = newReg() in doExpr(e,rt,[]); mark(MTLR rt,an) end             let val rt = newReg() in doExpr(e,rt,[]); mark(MTLR rt,an) end
549             else             else
550             case e of             case e of
551               T.REG(_,rs)  => if C.sameColor(rs,C.lr) then mark(MFLR rt,an)               T.REG(_,rs)  => if CB.sameColor(rs,C.lr) then mark(MFLR rt,an)
552                               else move(rs,rt,an)                               else move(rs,rt,an)
553             | T.LI i        => loadImmed(i, rt, an)             | T.LI i        => loadImmed(i, rt, an)
554             | T.LABEXP lexp => loadLabexp(lexp, rt, an)             | T.LABEXP lexp => loadLabexp(lexp, rt, an)

Legend:
Removed from v.839  
changed lines
  Added in v.889

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