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/c-calls/ia32-svid.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/x86/c-calls/ia32-svid.sml

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

revision 1666, Tue Oct 26 03:59:52 2004 UTC revision 1667, Wed Oct 27 22:15:45 2004 UTC
# Line 284  Line 284 
284          (* for functions that return a struct/union, pass the location          (* for functions that return a struct/union, pass the location
285           * as an implicit first argument.           * as an implicit first argument.
286           *)           *)
287            val (args, argLocs) = (case structRetLoc            val (args, argLocs, argMem') = (case structRetLoc
288                   of SOME pos => (ARG(structRet pos)::args, Stk(wordTy, 0)::argLocs)                   of SOME pos => (ARG(structRet pos)::args,
289                    | NONE => (args, argLocs)                                   Stk(wordTy, 0)::argLocs,
290                                     { szb = #szb argMem - 4, align = #align argMem })
291                      | NONE => (args, argLocs, argMem)
292                  (* end case *))                  (* end case *))
293          (* generate instructions to copy arguments into argument area          (* generate instructions to copy arguments into argument area
294           * using %esp to address the argument area.           * using %esp to address the argument area.
# Line 376  Line 378 
378            val callStm = T.CALL{            val callStm = T.CALL{
379                    funct=name, targets=[], defs=defs, uses=[],                    funct=name, targets=[], defs=defs, uses=[],
380                    region = mem,                    region = mem,
381                    pops = if calleePops then Int32.fromInt(#szb argMem) else 0                    pops = if calleePops then Int32.fromInt(#szb argMem)
382                             else Int32.fromInt (#szb argMem - #szb argMem')
383                  }                  }
384            val callStm = (case callComment            val callStm = (case callComment
385                   of NONE => callStm                   of NONE => callStm
# Line 396  Line 399 
399          (* code to pop the arguments from the stack *)          (* code to pop the arguments from the stack *)
400            val popArgs = if calleePops            val popArgs = if calleePops
401                  then []                  then []
402                  else [T.MV(wordTy, sp, T.ADD(wordTy, spR, T.LI(IntInf.fromInt(#szb argMem))))]                  else [T.MV(wordTy, sp, T.ADD(wordTy, spR, T.LI(IntInf.fromInt(#szb argMem'))))]
403          (* code to copy the result into fresh pseudo registers *)          (* code to copy the result into fresh pseudo registers *)
404            val (resultRegs, copyResult) = (case resLoc            val (resultRegs, copyResult) = (case resLoc
405                   of NONE => ([], [])                   of NONE => ([], [])

Legend:
Removed from v.1666  
changed lines
  Added in v.1667

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