163 |
val regargwords = Int.min (nargwords, maxRegArgs) |
val regargwords = Int.min (nargwords, maxRegArgs) |
164 |
val stackargwords = Int.max (nargwords, maxRegArgs) - maxRegArgs |
val stackargwords = Int.max (nargwords, maxRegArgs) - maxRegArgs |
165 |
|
|
166 |
val scratchstart = paramAreaOffset + 4 * (maxRegArgs + stackargwords) |
val stackargsstart = paramAreaOffset + 4 * maxRegArgs |
167 |
|
|
168 |
|
val scratchstart = stackargsstart + 4 * stackargwords |
169 |
|
|
170 |
(* Copy struct or part thereof to designated area on the stack. |
(* Copy struct or part thereof to designated area on the stack. |
171 |
* An already properly aligned address (relative to %sp) is |
* An already properly aligned address (relative to %sp) is |
248 |
end |
end |
249 |
|
|
250 |
val (stackdelta, argsetupcode, copycode) = let |
val (stackdelta, argsetupcode, copycode) = let |
251 |
fun loop ([], [], _, ss, asc, cpc) = (roundup (ss, 8), asc, cpc) |
fun loop ([], [], _, ss, asc, cpc) = |
252 |
|
(roundup (Int.max (0, ss - stackargsstart), 8), asc, cpc) |
253 |
| loop (t :: tl, a :: al, n, ss, asc, cpc) = let |
| loop (t :: tl, a :: al, n, ss, asc, cpc) = let |
254 |
fun wordassign a = |
fun wordassign a = |
255 |
if n < 6 then T.MV (32, oreg n, a) |
if n < 6 then T.MV (32, oreg n, a) |