Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /MLRISC/trunk/amd64/staged-allocation/amd64-vararg-ccall-fn.sml
ViewVC logotype

Annotation of /MLRISC/trunk/amd64/staged-allocation/amd64-vararg-ccall-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3051 - (view) (download)

1 : mrainey 3039 (* amd64-vararg-ccall-fn.sml
2 :     *
3 :     * C calling conventions for the AMD64. We use the technique of Staged Allocation (see
4 :     * MLRISC/staged-allocation).
5 :     *
6 :     * Mike Rainey (mrainey@cs.uchicago.edu)
7 :     *)
8 :    
9 :     functor AMD64VarargCCallFn (
10 :     structure T : MLTREE
11 :     ) = struct
12 :    
13 :     structure T = T
14 :     structure C = AMD64Cells
15 :     structure CB = CellsBasis
16 :     structure CTy = CTypes
17 : mrainey 3051 structure CCall = AMD64SVIDFn(structure T = T)
18 : mrainey 3049 structure VarargCCall = VarargCCallFn(
19 :     structure T = T
20 : mrainey 3051 structure CCall = CCall
21 :     val gprParams = List.map #2 CCall.CCs.gprParams
22 :     val fprParams = List.map #2 CCall.CCs.fprParams
23 :     val spReg = CCall.spReg
24 : mrainey 3049 val wordTy = 64
25 :     val newReg = C.newReg
26 :     )
27 : mrainey 3039
28 :     val wordTy = 64
29 :     fun lit i = T.LI (T.I.fromInt (wordTy, i))
30 : mrainey 3042
31 : mrainey 3039 fun callWithArgs (cFun, args) = let
32 : mrainey 3051 val triplets = VarargCCall.encodeArgs args
33 : mrainey 3039 in
34 :     raise Fail "jump to the interpreter"
35 :     end
36 :    
37 : mrainey 3049 fun genVarargs (cFun, args) =
38 : mrainey 3051 T.MV(wordTy, C.rax, lit (List.length CCall.CCs.fprParams)) :: VarargCCall.genVarargs(cFun, args)
39 : mrainey 3049
40 : mrainey 3039 end (* AMD64VarargCCallFn *)

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