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 554, Thu Mar 2 21:29:44 2000 UTC revision 555, Fri Mar 3 16:10:30 2000 UTC
# Line 13  Line 13 
13    (structure SparcInstr : SPARCINSTR    (structure SparcInstr : SPARCINSTR
14     structure SparcMLTree : MLTREE     structure SparcMLTree : MLTREE
15     structure PseudoInstrs : SPARC_PSEUDO_INSTR     structure PseudoInstrs : SPARC_PSEUDO_INSTR
16       structure ExtensionComp : MLTREE_EXTENSION_COMP
17          where I = SparcInstr and T = SparcMLTree
18        sharing SparcMLTree.Region = SparcInstr.Region        sharing SparcMLTree.Region = SparcInstr.Region
19        sharing SparcMLTree.LabelExp = SparcInstr.LabelExp        sharing SparcMLTree.LabelExp = SparcInstr.LabelExp
20        sharing PseudoInstrs.I = SparcInstr        sharing PseudoInstrs.I = SparcInstr
# Line 50  Line 52 
52    structure A  = MLRiscAnnotations    structure A  = MLRiscAnnotations
53    
54    type instrStream = (I.instruction,C.regmap,C.cellset) T.stream    type instrStream = (I.instruction,C.regmap,C.cellset) T.stream
55    type ('s,'r,'f,'c) mltreeStream =    type mltreeStream = (T.stm,C.regmap,T.mlrisc list) T.stream
      (('s,'r,'f,'c) T.stm,C.regmap,('s,'r,'f,'c) T.mlrisc list) T.stream  
   type ('s,'r,'f,'c) reducer =  
      (I.instruction,C.regmap,C.cellset,I.operand,I.addressing_mode,'s,'r,'f,'c)  
        T.reducer  
   type ('s,'r,'f,'c) extender =  
      (I.instruction,C.regmap,C.cellset,I.operand,I.addressing_mode,'s,'r,'f,'c)  
        T.extender  
56    
57    structure Gen = MLTreeGen(structure T = T    structure Gen = MLTreeGen(structure T = T
58                              val intTy = if V9 then 64 else 32                              val intTy = if V9 then 64 else 32
# Line 154  Line 149 
149    fun error msg = MLRiscErrorMsg.error("Sparc",msg)    fun error msg = MLRiscErrorMsg.error("Sparc",msg)
150    
151    fun selectInstructions    fun selectInstructions
        (T.EXTENDER{compileStm, compileRexp, compileFexp, compileCCexp,...})  
152         (instrStream as         (instrStream as
153          S.STREAM{emit,defineLabel,entryLabel,pseudoOp,annotation,          S.STREAM{emit,defineLabel,entryLabel,pseudoOp,annotation,
154                   beginCluster,endCluster,exitBlock,alias,phi,comment,...}) =                   beginCluster,endCluster,exitBlock,alias,phi,comment,...}) =
# Line 515  Line 509 
509          | stmt(T.BCC(ctrl,cc,lab),an) = branch(ctrl,cc,lab,an)          | stmt(T.BCC(ctrl,cc,lab),an) = branch(ctrl,cc,lab,an)
510          | stmt(T.DEFINE l,_) = defineLabel l          | stmt(T.DEFINE l,_) = defineLabel l
511          | stmt(T.ANNOTATION(s,a),an) = stmt(s,a::an)          | stmt(T.ANNOTATION(s,a),an) = stmt(s,a::an)
512          | stmt(T.EXT s,an) = compileStm (reducer()) {stm=s, an=an}          | stmt(T.EXT s,an) = ExtensionComp.compileSext(reducer()) {stm=s, an=an}
513          | stmt(s,an) = doStmts(Gen.compileStm s)          | stmt(s,an) = doStmts(Gen.compileStm s)
514    
515        and doStmt s = stmt(s,[])        and doStmt s = stmt(s,[])
# Line 614  Line 608 
608            | T.MARK(e,A.MARKREG f) => (f d; doExpr(e,d,cc,an))            | T.MARK(e,A.MARKREG f) => (f d; doExpr(e,d,cc,an))
609            | T.MARK(e,a) => doExpr(e,d,cc,a::an)            | T.MARK(e,a) => doExpr(e,d,cc,a::an)
610            | T.PRED(e,c) => doExpr(e,d,cc,A.CTRLUSE c::an)            | T.PRED(e,c) => doExpr(e,d,cc,A.CTRLUSE c::an)
611            | T.REXT e => compileRexp (reducer()) {e=e, rd=d, an=an}            | T.REXT e => ExtensionComp.compileRext (reducer()) {e=e, rd=d, an=an}
612            | e => doExpr(Gen.compileRexp e,d,cc,an)            | e => doExpr(Gen.compileRexp e,d,cc,an)
613    
614           (* generate a comparison with zero *)           (* generate a comparison with zero *)
# Line 683  Line 677 
677            | T.FMARK(e,A.MARKREG f) => (f d; doFexpr(e,d,an))            | T.FMARK(e,A.MARKREG f) => (f d; doFexpr(e,d,an))
678            | T.FMARK(e,a) => doFexpr(e,d,a::an)            | T.FMARK(e,a) => doFexpr(e,d,a::an)
679            | T.FPRED(e,c) => doFexpr(e,d,A.CTRLUSE c::an)            | T.FPRED(e,c) => doFexpr(e,d,A.CTRLUSE c::an)
680            | T.FEXT e => compileFexp (reducer()) {e=e, fd=d, an=an}            | T.FEXT e => ExtensionComp.compileFext (reducer()) {e=e, fd=d, an=an}
681            | e => doFexpr(Gen.compileFexp e,d,an)            | e => doFexpr(Gen.compileFexp e,d,an)
682    
683        and doCCexpr(T.CMP(ty,cond,e1,e2),65,an) =        and doCCexpr(T.CMP(ty,cond,e1,e2),65,an) =
# Line 695  Line 689 
689          | 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))
690          | doCCexpr(T.CCMARK(e,a),d,an) = doCCexpr(e,d,a::an)          | doCCexpr(T.CCMARK(e,a),d,an) = doCCexpr(e,d,a::an)
691          | doCCexpr(T.CCEXT e,d,an) =          | doCCexpr(T.CCEXT e,d,an) =
692               compileCCexp (reducer()) {e=e, cd=d, an=an}               ExtensionComp.compileCCext (reducer()) {e=e, ccd=d, an=an}
693          | doCCexpr e = error "doCCexpr"          | doCCexpr e = error "doCCexpr"
694    
695        and ccExpr e = let val d = newReg() in doCCexpr(e,d,[]); d end        and ccExpr e = let val d = newReg() in doCCexpr(e,d,[]); d end

Legend:
Removed from v.554  
changed lines
  Added in v.555

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