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

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

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

revision 888, Thu Jul 19 20:24:21 2001 UTC revision 889, Thu Jul 19 20:35:20 2001 UTC
# Line 43  Line 43 
43    structure S  = T.Stream    structure S  = T.Stream
44    structure R  = T.Region    structure R  = T.Region
45    structure C  = I.C    structure C  = I.C
46      structure CB = CellsBasis
47    structure LE = I.LabelExp    structure LE = I.LabelExp
48    structure W  = Word32    structure W  = Word32
49    structure P  = PseudoInstrs    structure P  = PseudoInstrs
# Line 68  Line 69 
69    functor Multiply32 = MLTreeMult    functor Multiply32 = MLTreeMult
70      (structure I = I      (structure I = I
71       structure T = T       structure T = T
72       type arg  = {r1:C.cell,r2:C.cell,d:C.cell}       structure CB = CellsBasis
73       type argi = {r:C.cell,i:int,d:C.cell}       type arg  = {r1:CB.cell,r2:CB.cell,d:CB.cell}
74         type argi = {r:CB.cell,i:int,d:CB.cell}
75    
76       val intTy = 32       val intTy = 32
77       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}
# Line 82  Line 84 
84    functor Multiply64 = MLTreeMult    functor Multiply64 = MLTreeMult
85      (structure I = I      (structure I = I
86       structure T = T       structure T = T
87       type arg  = {r1:C.cell,r2:C.cell,d:C.cell}       structure CB = CellsBasis
88       type argi = {r:C.cell,i:int,d:C.cell}       type arg  = {r1:CB.cell,r2:CB.cell,d:CB.cell}
89         type argi = {r:CB.cell,i:int,d:CB.cell}
90    
91       val intTy = 64       val intTy = 64
92       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}
# Line 246  Line 249 
249    
250        (* move register s to register d *)        (* move register s to register d *)
251        fun move(s,d,an) =        fun move(s,d,an) =
252            if C.sameColor(s,d) orelse C.registerId d = 0 then ()            if CB.sameColor(s,d) orelse CB.registerId d = 0 then ()
253            else mark(I.COPY{dst=[d],src=[s],tmp=NONE,impl=ref NONE},an)            else mark(I.COPY{dst=[d],src=[s],tmp=NONE,impl=ref NONE},an)
254    
255        (* move floating point register s to register d *)        (* move floating point register s to register d *)
256        fun fmoved(s,d,an) =        fun fmoved(s,d,an) =
257            if C.sameColor(s,d) then ()            if CB.sameColor(s,d) then ()
258            else mark(I.FCOPY{dst=[d],src=[s],tmp=NONE,impl=ref NONE},an)            else mark(I.FCOPY{dst=[d],src=[s],tmp=NONE,impl=ref NONE},an)
259        fun fmoves(s,d,an) = fmoved(s,d,an) (* error "fmoves" for now!!! XXX *)        fun fmoves(s,d,an) = fmoved(s,d,an) (* error "fmoves" for now!!! XXX *)
260        fun fmoveq(s,d,an) = error "fmoveq"        fun fmoveq(s,d,an) = error "fmoveq"
# Line 418  Line 421 
421            let val (r,i) = addr a            let val (r,i) = addr a
422                val defs=cellset(defs)                val defs=cellset(defs)
423                val uses=cellset(uses)                val uses=cellset(uses)
424            in  case (C.registerId r,i) of            in  case (CB.registerId r,i) of
425                    (0,I.LAB(T.LABEL l)) =>                    (0,I.LAB(T.LABEL l)) =>
426                    mark(I.CALL{label=l,defs=C.addReg(C.linkReg,defs),uses=uses,                    mark(I.CALL{label=l,defs=C.addReg(C.linkReg,defs),uses=uses,
427                                cutsTo=cutsTo,mem=mem,nop=true},an)                                cutsTo=cutsTo,mem=mem,nop=true},an)
# Line 440  Line 443 
443                   (doExpr(T.SUB(ty,a,b),newReg(),CC,[]); br(cond,lab,an))                   (doExpr(T.SUB(ty,a,b),newReg(),CC,[]); br(cond,lab,an))
444            end            end
445          | branch(T.CC(cond,r),lab,an) =          | branch(T.CC(cond,r),lab,an) =
446                if C.sameCell(r, C.psr) then br(cond,lab,an)                if CB.sameCell(r, C.psr) then br(cond,lab,an)
447                else (genCmp0(CC,r); br(cond,lab,an))                else (genCmp0(CC,r); br(cond,lab,an))
448          | branch(T.FCMP(fty,cond,a,b),lab,an) =          | branch(T.FCMP(fty,cond,a,b),lab,an) =
449            let val cmp = case fty of            let val cmp = case fty of
# Line 690  Line 693 
693            | e => doFexpr(Gen.compileFexp e,d,an)            | e => doFexpr(Gen.compileFexp e,d,an)
694    
695        and doCCexpr(T.CMP(ty,cond,e1,e2),cc,an) =        and doCCexpr(T.CMP(ty,cond,e1,e2),cc,an) =
696               if C.sameCell(cc,C.psr) then               if CB.sameCell(cc,C.psr) then
697                    doExpr(T.SUB(ty,e1,e2),newReg(),CC,an)                    doExpr(T.SUB(ty,e1,e2),newReg(),CC,an)
698               else error "doCCexpr"               else error "doCCexpr"
699          | doCCexpr(T.CC(_,r),d,an) =          | doCCexpr(T.CC(_,r),d,an) =
700               if C.sameColor(r,C.psr) then error "doCCexpr"               if CB.sameColor(r,C.psr) then error "doCCexpr"
701               else move(r,d,an)               else move(r,d,an)
702          | doCCexpr(T.CCMARK(e,A.MARKREG f),d,an) = (f d; doCCexpr(e,d,an))          | doCCexpr(T.CCMARK(e,A.MARKREG f),d,an) = (f d; doCCexpr(e,d,an))
703          | doCCexpr(T.CCMARK(e,a),d,an) = doCCexpr(e,d,a::an)          | doCCexpr(T.CCMARK(e,a),d,an) = doCCexpr(e,d,a::an)

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

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