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

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

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

revision 3051, Fri May 30 06:29:06 2008 UTC revision 3058, Tue Jun 3 17:17:28 2008 UTC
# Line 328  Line 328 
328  structure CCalls = AMD64SVIDFn (  structure CCalls = AMD64SVIDFn (
329                      structure T = AMD64MLTree)                      structure T = AMD64MLTree)
330    
331  (*  
332  structure CCalls = AMD64SVID (  structure OldCCalls = AMD64SVID (
333             structure T = AMD64MLTree             structure T = AMD64MLTree
334             val frameAlign = 16)             val frameAlign = 16)
335  *)  
336    
337  structure RA2 =  structure RA2 =
338      RISC_RA      RISC_RA
# Line 493  Line 493 
493  structure CFG = AMD64CFG  structure CFG = AMD64CFG
494  structure FlowGraph = AMD64FlowGraph  structure FlowGraph = AMD64FlowGraph
495  structure ChkTy = MLTreeCheckTy(structure T = T val intTy = 64)  structure ChkTy = MLTreeCheckTy(structure T = T val intTy = 64)
496  structure Vararg = AMD64VarargCCallFn(structure T = T)  structure Vararg = AMD64VarargCCallFn(
497                           structure T = T
498                           fun push e = T.EXT(AMD64InstrExt.PUSHQ e)
499                           val leave = T.EXT(AMD64InstrExt.LEAVE)
500                       )
501    
502  structure TestSA =  structure TestSA =
503    struct    struct
# Line 570  Line 574 
574      fun lit i = T.LI (T.I.fromInt (wordTy, i))      fun lit i = T.LI (T.I.fromInt (wordTy, i))
575    
576     fun vararg _ = let     fun vararg _ = let
577             val lab = Label.global "varargs"             val _ = Label.reset()
578             val tmp = C.newReg()             val (lab, varargStms) = Vararg.genVarargs()
            val tmpC = C.newReg()  
            val stms =  
                List.concat [  
                    [T.EXT(AMD64InstrExt.PUSHQ(T.REG(64, Cells.rbp))),  
                     T.COPY (wordTy, [Cells.rbp], [Cells.rsp])],  
                    [T.MV(wordTy, tmp, T.REG(wordTy, C.rsi))],  
                    [T.MV(wordTy, tmpC, T.REG(wordTy, C.rdi))],  
                    Vararg.genVarargs (T.REG(wordTy, tmpC), tmp),  
                    [T.EXT(AMD64InstrExt.LEAVE)],  
                    [T.RET []]  
                    ]  
   
579             val asmOutStrm = TextIO.openOut "mlrisc.s"             val asmOutStrm = TextIO.openOut "mlrisc.s"
580             fun doit () = dumpOutput(gen(lab, stms, [T.GPR (T.REG (wordTy, C.rax))]))             fun doit () = dumpOutput(gen(lab, varargStms, [T.GPR (T.REG (wordTy, C.rax))]))
581             val _ = AsmStream.withStream asmOutStrm doit ()             val _ = AsmStream.withStream asmOutStrm doit ()
582             val _ = TextIO.closeOut asmOutStrm             val _ = TextIO.closeOut asmOutStrm
583             in             in

Legend:
Removed from v.3051  
changed lines
  Added in v.3058

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