| 1 |
(* |
| 2 |
* This module defines special handling of various types in MLRISC |
| 3 |
* |
| 4 |
*) |
| 5 |
|
| 6 |
signature MLRISC_TYPES = |
| 7 |
sig |
| 8 |
|
| 9 |
structure Ast : MDL_AST |
| 10 |
structure RTL : MLTREE_RTL |
| 11 |
|
| 12 |
(* Does this type has special meaning in an instruction representation? |
| 13 |
* If so, we warn the user if the argument is somehow not mentioned |
| 14 |
* in the RTL. |
| 15 |
*) |
| 16 |
val isSpecialRepType : Ast.ty -> bool |
| 17 |
|
| 18 |
(* |
| 19 |
* Given a type for an rtl argument, |
| 20 |
* return actual representation type in MLRISC |
| 21 |
*) |
| 22 |
val representationOf : Ast.id * Ast.id * Ast.loc * Ast.ty -> int * Ast.id |
| 23 |
|
| 24 |
(* |
| 25 |
* Given an rtl argument and the actual representation type, |
| 26 |
* insert coercion if possible. |
| 27 |
*) |
| 28 |
val insertRepCoercion : RTL.exp * Ast.ty -> unit |
| 29 |
|
| 30 |
(* |
| 31 |
* Code generation magic |
| 32 |
*) |
| 33 |
val isConst : RTL.T.rep -> bool (* does it represent a constant? *) |
| 34 |
|
| 35 |
val ofCellKind : RTL.exp * Ast.storagedecl -> bool |
| 36 |
|
| 37 |
(* |
| 38 |
* Generate code for extracting an operand. |
| 39 |
* The functions generated are |
| 40 |
* get_cellset, |
| 41 |
* get_cell, |
| 42 |
* get_label, |
| 43 |
* get_operand, |
| 44 |
* etc. |
| 45 |
*) |
| 46 |
datatype conv = IGNORE |
| 47 |
| CONV of string |
| 48 |
| MULTI of string |
| 49 |
val getOpnd : |
| 50 |
(string * conv) list -> |
| 51 |
{ decl : Ast.decl, |
| 52 |
get : Ast.exp * RTL.exp * Ast.exp -> Ast.exp |
| 53 |
} |
| 54 |
|
| 55 |
end |