20
20
val size_expr : environment -> Cmm.expression -> int
22
22
class virtual selector_generic : object
23
(* The following methods must or can be overriden by the processor
23
(* The following methods must or can be overridden by the processor
25
25
method virtual is_immediate : int -> bool
26
26
(* Must be defined to indicate whether a constant is a suitable
29
29
Cmm.expression -> Arch.addressing_mode * Cmm.expression
30
30
(* Must be defined to select addressing modes *)
31
31
method is_simple_expr: Cmm.expression -> bool
32
(* Can be overriden to reflect special extcalls known to be pure *)
32
(* Can be overridden to reflect special extcalls known to be pure *)
33
33
method select_operation :
35
35
Cmm.expression list -> Mach.operation * Cmm.expression list
36
(* Can be overriden to deal with special arithmetic instructions *)
36
(* Can be overridden to deal with special arithmetic instructions *)
37
37
method select_condition : Cmm.expression -> Mach.test * Cmm.expression
38
(* Can be overriden to deal with special test instructions *)
38
(* Can be overridden to deal with special test instructions *)
39
39
method select_store :
40
40
Arch.addressing_mode -> Cmm.expression -> Mach.operation * Cmm.expression
41
(* Can be overriden to deal with special store constant instructions *)
41
(* Can be overridden to deal with special store constant instructions *)
42
method regs_for : Cmm.machtype -> Reg.t array
43
(* Return an array of fresh registers of the given type.
44
Default implementation is like Reg.createv.
45
Can be overridden if float values are stored as pairs of
43
48
Mach.operation -> Reg.t array -> Reg.t array -> Reg.t array
44
(* Can be overriden to deal with 2-address instructions
49
(* Can be overridden to deal with 2-address instructions
45
50
or instructions with hardwired input/output registers *)
46
51
method insert_op_debug :
47
52
Mach.operation -> Debuginfo.t -> Reg.t array -> Reg.t array -> Reg.t array
48
(* Can be overriden to deal with 2-address instructions
53
(* Can be overridden to deal with 2-address instructions
49
54
or instructions with hardwired input/output registers *)
50
55
method emit_extcall_args :
51
56
environment -> Cmm.expression list -> Reg.t array * int
52
(* Can be overriden to deal with stack-based calling conventions *)
57
(* Can be overridden to deal with stack-based calling conventions *)
53
58
method emit_stores :
54
59
environment -> Cmm.expression list -> Reg.t array -> unit
55
(* Fill a freshly allocated block. Can be overriden for architectures
60
(* Fill a freshly allocated block. Can be overridden for architectures
56
61
that do not provide Arch.offset_addressing. *)
58
(* The following method is the entry point and should not be overriden *)
63
(* The following method is the entry point and should not be overridden *)
59
64
method emit_fundecl : Cmm.fundecl -> Mach.fundecl
61
(* The following methods should not be overriden. They cannot be
66
(* The following methods should not be overridden. They cannot be
62
67
declared "private" in the current implementation because they
63
68
are not always applied to "self", but ideally they should be private. *)
64
69
method extract : Mach.instruction