| 1 |
signature C_CALL_GEN = |
| 2 |
sig |
| 3 |
|
| 4 |
structure T : MLTREE |
| 5 |
structure SA : STAGED_ALLOCATION |
| 6 |
where type reg_id = T.reg |
| 7 |
where type loc_kind = CLocKind.loc_kind |
| 8 |
|
| 9 |
datatype c_arg |
| 10 |
= ARG of T.rexp |
| 11 |
(* rexp specifies integer or pointer; if the |
| 12 |
* corresponding parameter is a C struct, then |
| 13 |
* this argument is the address of the struct. |
| 14 |
*) |
| 15 |
| FARG of T.fexp |
| 16 |
(* fexp specifies floating-point argument *) |
| 17 |
|
| 18 |
(* write a C argument (non aggregate) to a machine location |
| 19 |
* - arg is the argument data |
| 20 |
* - off is an offset into the argument data |
| 21 |
* - loc is the machine location |
| 22 |
* - stms is the accumulator of machine instructions |
| 23 |
*) |
| 24 |
val writeLoc : c_arg -> (T.rexp * SA.loc * T.stm list) -> T.stm list |
| 25 |
(* write C arguments to parameter locations; also return any used GPRs and FPRs *) |
| 26 |
val writeLocs : (c_arg list * SA.loc list list) -> (T.stm list * T.reg list * (int * T.reg) list) |
| 27 |
|
| 28 |
(* read from a machine location *) |
| 29 |
val readLoc : (SA.loc * (T.mlrisc list * T.stm list)) -> (T.mlrisc list * T.stm list) |
| 30 |
(* read from some machine locations *) |
| 31 |
val readLocs : SA.loc list -> (T.mlrisc list * T.stm list) |
| 32 |
|
| 33 |
end |