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/amd64-svid.sml
ViewVC logotype

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

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

revision 2996, Fri Apr 18 16:26:23 2008 UTC revision 2997, Fri Apr 18 19:33:29 2008 UTC
# Line 300  Line 300 
300           of (ARG (e as T.REG _), C_STK (mty, offset)) =>           of (ARG (e as T.REG _), C_STK (mty, offset)) =>
301              (T.STORE (wordTy, offSp offset, e, stack) :: stms, gprs, fprs)              (T.STORE (wordTy, offSp offset, e, stack) :: stms, gprs, fprs)
302            | (ARG (T.LOAD (ty, e, rgn)), C_GPR (mty1, r1)) =>            | (ARG (T.LOAD (ty, e, rgn)), C_GPR (mty1, r1)) =>
303              (copyToReg(mty1, r1, T.LOAD (ty, T.ADD(wordTy, e, li (i*8)), rgn)) @ stms, gprs, fprs)              (copyToReg(mty1, r1, T.LOAD (ty, T.ADD(wordTy, e, li (i*8)), rgn)) @ stms, r1 :: gprs, fprs)
304            | (ARG (T.LOAD (ty, e, rgn)), C_STK (mty, offset)) => let            | (ARG (T.LOAD (ty, e, rgn)), C_STK (mty, offset)) => let
305              val tmp = C.newReg ()              val tmp = C.newReg ()
306              in              in
307                  (T.STORE (wordTy, offSp offset, T.REG (wordTy, tmp), stack) ::                  (T.STORE (ty, offSp offset, T.REG (ty, tmp), stack) ::
308                   T.MV (wordTy, tmp, T.LOAD (ty, T.ADD(wordTy, e, li (i*8)), rgn)) :: stms, gprs, fprs)                   T.MV (ty, tmp, T.LOAD (ty, T.ADD(wordTy, e, li (i*8)), rgn)) :: stms, gprs, fprs)
309              end              end
310            | (ARG e, C_STK (mty, offset)) => let            | (ARG e, C_STK (mty, offset)) => let
311               val tmp = C.newReg ()               val tmp = C.newReg ()
# Line 316  Line 316 
316            | (FARG (e as T.FREG _), C_STK (mty, offset)) =>            | (FARG (e as T.FREG _), C_STK (mty, offset)) =>
317              (T.FSTORE (mty, offSp offset, e, stack) :: stms, gprs, fprs)              (T.FSTORE (mty, offSp offset, e, stack) :: stms, gprs, fprs)
318            | (ARG (T.LOAD (ty, e, rgn)), C_FPR (mty1, r1)) =>            | (ARG (T.LOAD (ty, e, rgn)), C_FPR (mty1, r1)) =>
319              (copyToFReg(mty1, r1, T.FLOAD (ty, T.ADD(wordTy, e, li (i*8)), rgn)) @ stms, gprs, fprs)              (copyToFReg(mty1, r1, T.FLOAD (ty, T.ADD(wordTy, e, li (i*8)), rgn)) @ stms, gprs, (mty1, r1) :: fprs)
320            | (FARG (T.FLOAD (ty, e, rgn)), C_STK (mty, offset)) => let            | (FARG (T.FLOAD (ty, e, rgn)), C_STK (mty, offset)) => let
321              val tmp = C.newFreg ()              val tmp = C.newFreg ()
322              in              in
# Line 334  Line 334 
334    
335      fun copyLocs (arg, locs, (stms, gprs, fprs)) =      fun copyLocs (arg, locs, (stms, gprs, fprs)) =
336          ListPair.foldl (copyLoc arg) (stms, gprs, fprs) (List.tabulate(List.length locs, fn i => i), locs)          ListPair.foldl (copyLoc arg) (stms, gprs, fprs) (List.tabulate(List.length locs, fn i => i), locs)
 (*  
       | copyLoc (arg, [loc1, loc2], (stms, gprs, fprs)) = (case (arg, loc1, loc2)  
          of (ARG (T.LOAD (ty, e, rgn)), C_GPR (mty1, r1), C_GPR (mty2, r2)) =>  
             (List.concat [ copyToReg(mty1, r1, T.LOAD (ty, e, rgn)),  
                            copyToReg(mty2, r2, T.LOAD (ty, T.ADD(wordTy, e, li 8), rgn)),  
                            stms],  
              gprs, fprs)  
           | (ARG (T.LOAD (ty, e, rgn)), C_FPR (mty1, r1), C_FPR (mty2, r2)) =>  
             (List.concat [ copyToFReg(mty1, r1, T.FLOAD (ty, e, rgn)),  
                            copyToFReg(mty2, r2, T.FLOAD (ty, T.ADD(wordTy, e, li 8), rgn)),  
                            stms],  
              gprs, fprs)  
           | (ARG (T.LOAD (ty, e, rgn)), C_GPR (mty1, r1), C_FPR (mty2, r2)) =>  
             (List.concat [ copyToReg(mty1, r1, T.LOAD (ty, e, rgn)),  
                            copyToFReg(mty2, r2, T.FLOAD (ty, T.ADD(wordTy, e, li 8), rgn)),  
                            stms],  
              gprs, fprs)  
           | (ARG (T.LOAD (ty, e, rgn)), C_FPR (mty1, r1), C_GPR (mty2, r2)) =>  
             (List.concat [ copyToFReg(mty1, r1, T.FLOAD (ty, e, rgn)),  
                            copyToReg(mty2, r2, T.LOAD (ty, T.ADD(wordTy, e, li 8), rgn)),  
                            stms],  
              gprs, fprs)  
           | _ => raise Fail "invalid arg / location combination"  
          (* end case *))  
 *)  
337    
338      (* copy C arguments into parameter locations *)      (* copy C arguments into parameter locations *)
339      fun copyArgs (args, argLocs) = let      fun copyArgs (args, argLocs) = let

Legend:
Removed from v.2996  
changed lines
  Added in v.2997

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