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

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

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

revision 411, Fri Sep 3 00:25:03 1999 UTC revision 429, Wed Sep 8 09:47:00 1999 UTC
# Line 10  Line 10 
10         and Constant = X86Instr.Constant         and Constant = X86Instr.Constant
11         and type cond = MLTreeBasis.cond         and type cond = MLTreeBasis.cond
12         and type fcond = MLTreeBasis.fcond         and type fcond = MLTreeBasis.fcond
    structure Stream : INSTRUCTION_STREAM  
      where B = X86MLTree.BNames  
        and P = X86MLTree.PseudoOp  
13     val tempMem : X86Instr.operand) : MLTREECOMP =     val tempMem : X86Instr.operand) : MLTREECOMP =
14  struct  struct
15    structure T = X86MLTree    structure T = X86MLTree
16      structure S = T.Stream
17    structure I = X86Instr    structure I = X86Instr
18    structure C = X86Cells    structure C = X86Cells
   structure S = Stream  
19    
20    structure W32 = Word32    structure W32 = Word32
21    structure LE = LabelExp    structure LE = LabelExp
# Line 30  Line 27 
27    
28    fun selectInstructions    fun selectInstructions
29         (S.STREAM{emit,defineLabel,entryLabel,blockName,pseudoOp,annotation,         (S.STREAM{emit,defineLabel,entryLabel,blockName,pseudoOp,annotation,
30                   init,finish,exitBlock,...}) =                   beginCluster,endCluster,exitBlock,alias,phi,comment,...}) =
31    let    let
32    
   val emit    = emit(fn _ => 0)  
33    val newReg  = C.newReg    val newReg  = C.newReg
34    val newFreg = C.newFreg    val newFreg = C.newFreg
35    
# Line 279  Line 275 
275        in  mark(I.CALL(operand t,        in  mark(I.CALL(operand t,
276                        addList(def,C.empty),addList(use,C.empty),mem),an)                        addList(def,C.empty),addList(use,C.empty),mem),an)
277        end        end
278      | reduceStm(T.RET,an) = mark(I.RET,an)      | reduceStm(T.RET,an) = mark(I.RET NONE,an)
279      | reduceStm(T.STORE(8, t1, t2, mem),an) =      | reduceStm(T.STORE(8, t1, t2, mem),an) =
280        let val opnd = immedOrReg(operand t2)        let val opnd = immedOrReg(operand t2)
281            val src =            val src =
# Line 643  Line 639 
639    end (*reduceFexp*)    end (*reduceFexp*)
640    
641    fun doStm s = reduceStm(s,[])    fun doStm s = reduceStm(s,[])
642          val beginCluster = fn _ => (trapLabel := NONE; beginCluster 0)
643    fun mltreeComp mltree = let        val endCluster = fn a =>
     fun mltc(T.PSEUDO_OP pOp)     = pseudoOp pOp  
       | mltc(T.DEFINELABEL lab)   = defineLabel lab  
       | mltc(T.ENTRYLABEL lab)    = entryLabel lab  
       | mltc(T.BEGINCLUSTER)      = (init 0; trapLabel := NONE)  
       | mltc(T.CODE stms)         = app doStm stms  
       | mltc(T.BLOCK_NAME name)   = blockName name  
       | mltc(T.BLOCK_ANNOTATION a)= annotation a  
       | mltc(T.ENDCLUSTER regmap) =  
644           (case !trapLabel           (case !trapLabel
645            of NONE => ()            of NONE => ()
646             | SOME lab => (defineLabel lab; emit(I.INTO))             | SOME lab => (defineLabel lab; emit(I.INTO))
647            (*esac*);            (*esac*);
648            finish regmap)            endCluster a)
649        | mltc(T.ESCAPEBLOCK regs)  = exitBlock regs    in S.STREAM
650    in mltc mltree       {  beginCluster= beginCluster,
651    end          endCluster  = endCluster,
652            emit        = doStm,
653    in          pseudoOp    = pseudoOp,
654        { mltreeComp = mltreeComp,          defineLabel = defineLabel,
655          mlriscComp = doStm,          entryLabel  = entryLabel,
656          emitInstr  = emit          blockName   = blockName,
657            comment     = comment,
658            annotation  = annotation,
659            exitBlock   = exitBlock,
660            alias       = alias,
661            phi         = phi
662        }        }
663    end    end
664    

Legend:
Removed from v.411  
changed lines
  Added in v.429

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