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/c-call/archs/sparc-c-call-fn.sml
ViewVC logotype

Diff of /MLRISC/trunk/c-call/archs/sparc-c-call-fn.sml

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

revision 3226, Thu Sep 18 03:28:24 2008 UTC revision 3227, Thu Sep 18 06:06:40 2008 UTC
# Line 49  Line 49 
49      structure SA = StagedAllocationFn (      structure SA = StagedAllocationFn (
50                      type reg_id = T.reg                      type reg_id = T.reg
51                      datatype loc_kind = datatype loc_kind                      datatype loc_kind = datatype loc_kind
52                      val memSize = 8)                      val memSize = 4)
53    
54      structure CCall = CCallFn(      structure Gen = CCallGenFn(
55               structure T = T               structure T = T
56               structure C = C               structure C = C
57               val wordTy = wordTy               val wordTy = wordTy
# Line 62  Line 62 
62               fun f2f {fromWidth, toWidth, e} = e               fun f2f {fromWidth, toWidth, e} = e
63               structure SA = SA)               structure SA = SA)
64    
65      datatype c_arg = datatype CCall.c_arg      datatype c_arg = datatype Gen.c_arg
66    
67      structure CCs = SparcCConventionFn (      structure CCs = SparcCConventionFn (
68                        type reg_id = T.reg                        type reg_id = T.reg
# Line 112  Line 112 
112               {argLocs=List.map singleton paramLocs, argMem=argMem, structRetLoc=NONE, resLocs=resLoc}               {argLocs=List.map singleton paramLocs, argMem=argMem, structRetLoc=NONE, resLocs=resLoc}
113            end            end
114    
115  (* FIXME *)      local
116      val callerSaveRegs = []      val g_regs = List.map greg [1, 2, 3, 4, 5, 6, 7]
117        val a_regs = List.map oreg [0, 1, 2, 3, 4, 5]
118        val l_reg = oreg 7
119        val f_regs = List.map freg
120                         [0, 2, 4, 6, 8, 10, 12, 14,
121                          16, 18, 20, 22, 24, 26, 28, 30]
122        in
123        val callerSaveRegs = l_reg :: g_regs @ a_regs
124      val calleeSaveRegs = []      val calleeSaveRegs = []
125      val callerSaveFRegs = []      val callerSaveFRegs = f_regs
126      val calleeSaveFRegs = []      val calleeSaveFRegs = []
127        end
128    
129      fun genCall {name, proto as {retTy, ...}, paramAlloc, structRet, saveRestoreDedicated, callComment, args} = let      fun genCall {name, proto as {retTy, ...}, paramAlloc, structRet, saveRestoreDedicated, callComment, args} = let
130            val {argLocs, argMem, resLocs, structRetLoc} = layout proto            val {argLocs, argMem, resLocs, structRetLoc} = layout proto
131            val argAlloc = []            val argAlloc = []
132            val (copyArgs, gprUses, fprUses) = CCall.writeLocs(args, argLocs)            val (copyArgs, gprUses, fprUses) = Gen.writeLocs(args, argLocs)
133            val (resultRegs, copyResult) = CCall.readLocs resLocs            val (resultRegs, copyResult) = Gen.readLocs resLocs
134    
135          (* bytes to allocate on the stack for returning structs *)          (* bytes to allocate on the stack for returning structs *)
136            val res_szal =            val res_szal =

Legend:
Removed from v.3226  
changed lines
  Added in v.3227

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