2016-02-18 07:11:59 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. This file is distributed under the terms of *)
|
|
|
|
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
|
|
(* special exception on linking described in the file LICENSE. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
1995-08-09 08:06:35 -07:00
|
|
|
|
1995-06-15 01:17:29 -07:00
|
|
|
(* Processor descriptions *)
|
|
|
|
|
|
|
|
(* Instruction selection *)
|
1995-07-25 04:37:38 -07:00
|
|
|
val word_addressed: bool
|
1995-06-15 01:17:29 -07:00
|
|
|
|
|
|
|
(* Registers available for register allocation *)
|
|
|
|
val num_register_classes: int
|
|
|
|
val register_class: Reg.t -> int
|
|
|
|
val num_available_registers: int array
|
|
|
|
val first_available_register: int array
|
|
|
|
val register_name: int -> string
|
|
|
|
val phys_reg: int -> Reg.t
|
1995-10-25 07:54:47 -07:00
|
|
|
val rotate_registers: bool
|
1995-06-15 01:17:29 -07:00
|
|
|
|
|
|
|
(* Calling conventions *)
|
2020-07-07 11:03:57 -07:00
|
|
|
val loc_arguments: Cmm.machtype -> Reg.t array * int
|
|
|
|
val loc_results: Cmm.machtype -> Reg.t array
|
|
|
|
val loc_parameters: Cmm.machtype -> Reg.t array
|
2015-08-25 09:18:50 -07:00
|
|
|
(* For argument number [n] split across multiple registers, the target-specific
|
|
|
|
implementation of [loc_external_arguments] must return [regs] such that
|
2020-07-07 11:03:57 -07:00
|
|
|
[regs.(n).(0)] is to hold the part of the value at the lowest address. *)
|
|
|
|
val loc_external_arguments: Cmm.exttype list -> Reg.t array array * int
|
|
|
|
val loc_external_results: Cmm.machtype -> Reg.t array
|
1995-06-15 01:17:29 -07:00
|
|
|
val loc_exn_bucket: Reg.t
|
|
|
|
|
2016-01-29 07:57:36 -08:00
|
|
|
(* The maximum number of arguments of an OCaml to OCaml function call for
|
|
|
|
which it is guaranteed there will be no arguments passed on the stack.
|
2016-02-08 06:02:40 -08:00
|
|
|
(Above this limit, tail call optimization may be disabled.)
|
|
|
|
N.B. The values for this parameter in the backends currently assume
|
|
|
|
that no unboxed floats are passed using the OCaml calling conventions.
|
|
|
|
*)
|
|
|
|
val max_arguments_for_tailcalls : int
|
2016-01-29 07:57:36 -08:00
|
|
|
|
1995-07-02 09:41:48 -07:00
|
|
|
(* Maximal register pressures for pre-spilling *)
|
1995-07-10 02:48:27 -07:00
|
|
|
val safe_register_pressure: Mach.operation -> int
|
|
|
|
val max_register_pressure: Mach.operation -> int array
|
1995-07-02 09:41:48 -07:00
|
|
|
|
1995-06-15 01:17:29 -07:00
|
|
|
(* Registers destroyed by operations *)
|
|
|
|
val destroyed_at_oper: Mach.instruction_desc -> Reg.t array
|
|
|
|
val destroyed_at_raise: Reg.t array
|
2018-10-15 04:53:27 -07:00
|
|
|
val destroyed_at_reloadretaddr : Reg.t array
|
1995-06-15 01:17:29 -07:00
|
|
|
|
2014-05-16 07:37:22 -07:00
|
|
|
(* Volatile registers: those that change value when read *)
|
|
|
|
val regs_are_volatile: Reg.t array -> bool
|
|
|
|
|
2014-04-26 02:31:18 -07:00
|
|
|
(* Pure operations *)
|
|
|
|
val op_is_pure: Mach.operation -> bool
|
|
|
|
|
1995-07-07 09:14:06 -07:00
|
|
|
(* Info for laying out the stack frame *)
|
2019-08-14 04:52:05 -07:00
|
|
|
val frame_required : Mach.fundecl -> bool
|
2019-03-29 04:47:53 -07:00
|
|
|
|
|
|
|
(* Function prologues *)
|
2019-08-14 04:52:05 -07:00
|
|
|
val prologue_required : Mach.fundecl -> bool
|
1995-07-02 09:41:48 -07:00
|
|
|
|
2018-10-04 03:30:52 -07:00
|
|
|
(** For a given register class, the DWARF register numbering for that class.
|
|
|
|
Given an allocated register with location [Reg n] and class [reg_class], the
|
|
|
|
returned array contains the corresponding DWARF register number at index
|
|
|
|
[n - first_available_register.(reg_class)]. *)
|
|
|
|
val dwarf_register_numbers : reg_class:int -> int array
|
|
|
|
|
|
|
|
(** The DWARF register number corresponding to the stack pointer. *)
|
|
|
|
val stack_ptr_dwarf_register_number : int
|
|
|
|
|
1996-11-07 02:55:02 -08:00
|
|
|
(* Calling the assembler *)
|
1995-07-02 09:41:48 -07:00
|
|
|
val assemble_file: string -> string -> int
|
2013-06-03 11:03:59 -07:00
|
|
|
|
|
|
|
(* Called before translating a fundecl. *)
|
|
|
|
val init : unit -> unit
|