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 /MLRISC/trunk/staged-allocation/test-staged-allocation.sml
ViewVC logotype

Diff of /MLRISC/trunk/staged-allocation/test-staged-allocation.sml

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

revision 2991, Tue Apr 15 15:05:41 2008 UTC revision 2992, Tue Apr 15 22:30:33 2008 UTC
# Line 5  Line 5 
5      structure T = AMD64MLTree      structure T = AMD64MLTree
6      structure CFG = AMD64CFG      structure CFG = AMD64CFG
7    
8      fun codegen (functionName, target, proto, args) = let      val wordTy = 64
9    
10        fun codegen (functionName, target, proto, initStms, args) = let
11          val _ = Label.reset()          val _ = Label.reset()
12    
13          fun toLabel s = Label.global(s)          fun toLabel s = Label.global(s)
# Line 23  Line 25 
25                     args=args}                     args=args}
26    
27          val stms = List.concat [          val stms = List.concat [
28                     [T.EXT(AMD64InstrExt.PUSHQ(T.REG(64, C.rbp)))],                     [T.EXT(AMD64InstrExt.PUSHQ(T.REG(64, C.rbp))),
29                        T.COPY (wordTy, [C.rbp], [C.rsp])],
30                       initStms,
31                     callseq,                     callseq,
32                     [T.EXT(AMD64InstrExt.LEAVE)],                     [T.EXT(AMD64InstrExt.LEAVE)],
33                     [T.RET []]]                     [T.RET []]]
# Line 44  Line 48 
48              pseudoOp PseudoOpsBasisTyp.TEXT;              pseudoOp PseudoOpsBasisTyp.TEXT;
49              pseudoOp (PseudoOpsBasisTyp.EXPORT [functionName]);              pseudoOp (PseudoOpsBasisTyp.EXPORT [functionName]);
50              entryLabel functionName; (* define the entry label *)              entryLabel functionName; (* define the entry label *)
51              app emit stms; (* emit all the statements *)              List.app emit stms; (* emit all the statements *)
52              exitBlock result;              exitBlock result;
53              endCluster [])              endCluster [])
54          val cfg = doit ()          val cfg = doit ()

Legend:
Removed from v.2991  
changed lines
  Added in v.2992

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