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 837, Fri Jun 1 17:27:54 2001 UTC revision 838, Tue Jun 5 19:10:21 2001 UTC
# Line 144  Line 144 
144        | copyOut _ = error "copyOut"        | copyOut _ = error "copyOut"
145    end    end
146    
147    fun genCall{name, proto={conv="", retTy, paramTys}, structRet, args} = let    fun genCall {name,proto={conv="", retTy, paramTys},structRet,
148                   saveRestoreDedicated, callComment,
149                   args} = let
150      fun push signed {sz, e} = let      fun push signed {sz, e} = let
151        fun pushl rexp = T.EXT(ix(IX.PUSHL(rexp)))        fun pushl rexp = T.EXT(ix(IX.PUSHL(rexp)))
152        fun signExtend(e) = if sz=32 then e else T.SX(32, sz, e)        fun signExtend(e) = if sz=32 then e else T.SX(32, sz, e)
# Line 293  Line 295 
295       (*esac*))       (*esac*))
296    
297      (* call defines callersave registers and uses result registers. *)      (* call defines callersave registers and uses result registers. *)
298      fun mkCall defs = T.CALL{      fun mkCall defs = let
299              funct=name, targets=[], defs=defs, uses=[],          val { save, restore } = saveRestoreDedicated defs
300              region=T.Region.memory          val callstm =
301            }              T.CALL { funct=name, targets=[], defs=defs, uses=[],
302                         region=T.Region.memory }
303            val callstm =
304                case callComment of
305                    NONE => callstm
306                  | SOME c => T.ANNOTATION (callstm,
307                                            #create MLRiscAnnotations.COMMENT c)
308        in
309            save @ callstm :: restore
310        end
311    
312      (* size to pop off on return *)      (* size to pop off on return *)
313      fun argsSz(Ty.C_STRUCT fields::rest) = let      fun argsSz(Ty.C_STRUCT fields::rest) = let
# Line 314  Line 325 
325    
326      val (cRets, cDefs) = resultsAndDefs (retTy)      val (cRets, cDefs) = resultsAndDefs (retTy)
327      val (retRegs, cpyOut) = copyOut(cRets, [], [])      val (retRegs, cpyOut) = copyOut(cRets, [], [])
328      val call = mkCall(cDefs) :: (case argsSz paramTys      val call = mkCall(cDefs) @
329           of 0 => cpyOut                 (case argsSz paramTys of
330            | n => T.MV(32, sp, T.ADD(32, T.REG(32,sp), LI n)) :: cpyOut                      0 => cpyOut
331          (* end case *))                    | n => T.MV(32, sp, T.ADD(32, T.REG(32,sp), LI n)) :: cpyOut)
332      val callSeq = pushArgs(paramTys, args, pushStructRetAddr(call))      val callSeq = pushArgs(paramTys, args, pushStructRetAddr(call))
333    in {callseq=callSeq, result=retRegs}    in {callseq=callSeq, result=retRegs}
334    end    end

Legend:
Removed from v.837  
changed lines
  Added in v.838

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