Module Cmm
type machtype = Cmm.machtype_component arrayval typ_void : Cmm.machtypeval typ_val : Cmm.machtypeval typ_addr : Cmm.machtypeval typ_int : Cmm.machtypeval typ_float : Cmm.machtypeval typ_float32 : Cmm.machtypeval typ_vec128 : Cmm.machtypeval typ_vec256 : Cmm.machtypeval typ_vec512 : Cmm.machtypeval typ_int128 : Cmm.machtypeval lub_component :
Cmm.machtype_component ->
Cmm.machtype_component ->
Cmm.machtype_componentLeast upper bound of two machtype_components.
val ge_component : Cmm.machtype_component -> Cmm.machtype_component -> boolReturns true iff the first supplied machtype_component is greater than or equal to the second under the relation used by lub_component.
type exttype = | XInt(*r OCaml value, word-sized integer
*)| XInt8(*r 8-bit integer
*)| XInt16(*r 16-bit integer
*)| XInt32(*r 32-bit integer
*)| XInt64(*r 64-bit integer
*)| XFloat32(*r single-precision FP number
*)| XFloat(*r double-precision FP number
*)| XVec128(*r 128-bit vector
*)| XVec256(*r 256-bit vector
*)| XVec512(*r 512-bit vector
*)
A variant of machtype used to describe arguments to external C functions
val machtype_of_exttype : Cmm.exttype -> Cmm.machtypeval machtype_of_exttype_list : Cmm.exttype list -> Cmm.machtypeval equal_stack_align : Cmm.stack_align -> Cmm.stack_align -> booltype integer_comparison = Scalar.Integer_comparison.t = val negate_integer_comparison :
Cmm.integer_comparison ->
Cmm.integer_comparisonval swap_integer_comparison : Cmm.integer_comparison -> Cmm.integer_comparisontype float_comparison = Scalar.Float_comparison.t = val negate_float_comparison : Cmm.float_comparison -> Cmm.float_comparisonval swap_float_comparison : Cmm.float_comparison -> Cmm.float_comparisontype label = Label.tval new_label : unit -> Cmm.labelval set_label : Cmm.label -> unitval cur_label : unit -> Cmm.labeltype phantom_defining_expr = | Cphantom_const_int of Targetint.t(*The phantom-let-bound variable is a constant integer. The argument must be the tagged representation of an integer within the range of type
*)inton the target. (Analogously toCconst_int.)| Cphantom_const_symbol of string(*The phantom-let-bound variable is an alias for a symbol.
*)| Cphantom_var of Backend_var.t(*The phantom-let-bound variable is an alias for another variable. The aliased variable must not be a bound by a phantom let.
*)| Cphantom_offset_var of {var : Backend_var.t;offset_in_words : int;
}(*The phantom-let-bound-variable's value is defined by adding the given number of words to the pointer contained in the given identifier.
*)| Cphantom_read_field of {var : Backend_var.t;field : int;
}(*The phantom-let-bound-variable's value is found by adding the given number of words to the pointer contained in the given identifier, then dereferencing.
*)| Cphantom_read_symbol_field of {}(*As for
*)Uphantom_read_var_field, but with the pointer specified by a symbol.| Cphantom_block of {tag : int;fields : Backend_var.t list;
}(*The phantom-let-bound variable points at a block with the given structure.
*)
type trap_action = | Push of Cmm.trywith_shared_label(*Add the corresponding handler to the trap stack.
*)| Pop of Cmm.trywith_shared_label(*Remove the last handler from the trap stack.
*)
type memory_chunk = | Byte_unsigned| Byte_signed| Sixteen_unsigned| Sixteen_signed| Thirtytwo_unsigned| Thirtytwo_signed| Word_int| Word_val| Single of {reg : Cmm.float_width;
}| Double| Onetwentyeight_unaligned| Onetwentyeight_aligned| Twofiftysix_unaligned| Twofiftysix_aligned| Fivetwelve_unaligned| Fivetwelve_aligned
type reinterpret_cast = | Int_of_value| Value_of_int| Float_of_float32| Float32_of_float| Float_of_int64| Int64_of_float| Float32_of_int32| Int32_of_float32| V128_of_vec of Cmm.vector_width| V256_of_vec of Cmm.vector_width| V512_of_vec of Cmm.vector_width
type static_cast = | Float_of_int of Cmm.float_width| Int_of_float of Cmm.float_width| Float_of_float32| Float32_of_float| V128_of_scalar of Cmm.vec128_type| Scalar_of_v128 of Cmm.vec128_type| V256_of_scalar of Cmm.vec256_type| Scalar_of_v256 of Cmm.vec256_type| V512_of_scalar of Cmm.vec512_type| Scalar_of_v512 of Cmm.vec512_type
module Alloc_mode : sig ... endtype alloc_block_kind = | Alloc_block_kind_other| Alloc_block_kind_closure| Alloc_block_kind_float| Alloc_block_kind_float32| Alloc_block_kind_vec128| Alloc_block_kind_vec256| Alloc_block_kind_vec512| Alloc_block_kind_boxed_int of Primitive.boxed_integer| Alloc_block_kind_float_array| Alloc_block_kind_float32_u_array| Alloc_block_kind_int_u_array| Alloc_block_kind_int8_u_array| Alloc_block_kind_int16_u_array| Alloc_block_kind_int32_u_array| Alloc_block_kind_int64_u_array| Alloc_block_kind_vec128_u_array| Alloc_block_kind_vec256_u_array| Alloc_block_kind_vec512_u_array
type alloc_dbginfo_item = {alloc_words : int;alloc_block_kind : Cmm.alloc_block_kind;alloc_dbg : Debuginfo.t;
}Due to Comballoc, a single Ialloc instruction may combine several unrelated allocations. Their Debuginfo.t (which may differ) are stored as a list of alloc_dbginfo. This list is in order of increasing memory address, which is the reverse of the original allocation order. Later allocations are consed to the front of this list by Comballoc.
type alloc_dbginfo = Cmm.alloc_dbginfo_item listval equal_is_global : Cmm.is_global -> Cmm.is_global -> booltype operation = | Capply of {result_type : Cmm.machtype;region : Lambda.region_close;callees : Cmm.symbol list option;
}| Cextcall of {func : string;ty : Cmm.machtype;ty_args : Cmm.exttype list;alloc : bool;builtin : bool;returns : bool;effects : Cmm.effects;coeffects : Cmm.coeffects;
}(*The
*)machtypeis the machine type of the result. Theexttype listdescribes the unboxing types of the arguments. An empty list means "all arguments are machine wordsXInt". The boolean indicates whether the function may allocate.| Cload of {memory_chunk : Cmm.memory_chunk;mutability : Asttypes.mutable_flag;is_atomic : bool;
}| Calloc of Cmm.Alloc_mode.t * Cmm.alloc_block_kind| Cstore of Cmm.memory_chunk * Cmm.initialization_or_assignment| Caddi| Csubi| Cmuli| Cmulhi of {}| Cdivi| Cmodi| Caddi128| Csubi128| Cmuli64 of {}| Cand| Cor| Cxor| Clsl| Clsr| Casr| Cbswap of {bitwidth : Cmm.bswap_bitwidth;
}| Ccsel of Cmm.machtype| Cclz of {}| Cctz of {}| Cpopcnt| Cprefetch of {is_write : bool;locality : Cmm.prefetch_temporal_locality_hint;
}| Catomic of {op : Cmm.atomic_op;size : Cmm.atomic_bitwidth;
}| Ccmpi of Cmm.integer_comparison| Caddv| Cadda| Cnegf of Cmm.float_width| Cabsf of Cmm.float_width| Caddf of Cmm.float_width| Csubf of Cmm.float_width| Cmulf of Cmm.float_width| Cdivf of Cmm.float_width| Cpackf32| Creinterpret_cast of Cmm.reinterpret_cast| Cstatic_cast of Cmm.static_cast| Ccmpf of Cmm.float_width * Cmm.float_comparison| Craise of Lambda.raise_kind| Cprobe of {}| Cprobe_is_enabled of {}| Copaque| Cbeginregion| Cendregion| Ctuple_field of int * Cmm.machtype array| Cdls_get| Ctls_get| Cpoll| Cpause
val global_symbol : string -> Cmm.symboltype static_handler = {label : Lambda.static_label;params : (Backend_var.With_provenance.t * Cmm.machtype) list;body : Cmm.expression;dbg : Debuginfo.t;is_cold : bool;
}Every basic block should have a corresponding Debuginfo.t for its beginning.
and expression = | Cconst_int of int * Debuginfo.t| Cconst_natint of nativeint * Debuginfo.t| Cconst_float32 of float * Debuginfo.t| Cconst_float of float * Debuginfo.t| Cconst_vec128 of Cmm.vec128_bits * Debuginfo.t| Cconst_vec256 of Cmm.vec256_bits * Debuginfo.t| Cconst_vec512 of Cmm.vec512_bits * Debuginfo.t| Cconst_symbol of Cmm.symbol * Debuginfo.t| Cvar of Backend_var.t| Clet of Backend_var.With_provenance.t * Cmm.expression * Cmm.expression| Cphantom_let of Backend_var.With_provenance.t * Cmm.phantom_defining_expr option * Cmm.expression| Ctuple of Cmm.expression list| Cop of Cmm.operation * Cmm.expression list * Debuginfo.t| Csequence of Cmm.expression * Cmm.expression| Cifthenelse of Cmm.expression * Debuginfo.t * Cmm.expression * Debuginfo.t * Cmm.expression * Debuginfo.t| Cswitch of Cmm.expression * int array * (Cmm.expression * Debuginfo.t) array * Debuginfo.t| Ccatch of Cmm.ccatch_flag * Cmm.static_handler list * Cmm.expression| Cexit of Cmm.exit_label * Cmm.expression list * Cmm.trap_action list
type codegen_option = | Reduce_code_size| No_CSE| Use_linscan_regalloc| Use_regalloc of Clflags.Register_allocator.t| Use_regalloc_param of string list| Cold| Assume_zero_alloc of {strict : bool;never_returns_normally : bool;never_raises : bool;loc : Location.t;
}| Check_zero_alloc of {strict : bool;loc : Location.t;custom_error_msg : string option;
}
type fundecl = {fun_name : Cmm.symbol;fun_args : (Backend_var.With_provenance.t * Cmm.machtype) list;fun_body : Cmm.expression;fun_codegen_options : Cmm.codegen_option list;fun_poll : Lambda.poll_attribute;fun_dbg : Debuginfo.t;fun_ret_type : Cmm.machtype;
}type data_item = | Cdefine_symbol of Cmm.symbol| Cint8 of int| Cint16 of int| Cint32 of nativeint| Cint of nativeint| Csingle of float| Cdouble of float| Cvec128 of Cmm.vec128_bits| Cvec256 of Cmm.vec256_bits| Cvec512 of Cmm.vec512_bits| Csymbol_address of Cmm.symbol| Csymbol_offset of Cmm.symbol * int| Cstring of string| Cskip of int| Calign of int
When data items that are less than 64 bits wide occur in blocks, whose fields are 64-bits wide, the following rules apply:
- For int32, the value is sign extended.
- For float32, the value is zero extended. It is ok to rely on zero-initialization of the data section to achieve this.
val ccatch :
(Lambda.static_label
* (Backend_var.With_provenance.t * Cmm.machtype) list
* Cmm.expression
* Cmm.expression
* Debuginfo.t
* bool) ->
Cmm.expressionval ctrywith :
(Cmm.expression
* Cmm.trywith_shared_label
* Backend_var.With_provenance.t
* (Backend_var.With_provenance.t * Cmm.machtype) list
* Cmm.expression
* Debuginfo.t) ->
Cmm.expressionval iter_shallow_tail : (Cmm.expression -> unit) -> Cmm.expression -> boolEither apply the callback to all immediate sub-expressions that can produce the final result for the expression and return true, or do nothing and return false. Note that the notion of "tail" sub-expression used here does not match the one used to trigger tail calls; in particular, try...with handlers are considered to be in tail position (because their result become the final result for the expression).
val map_shallow_tail :
(Cmm.expression -> Cmm.expression) ->
Cmm.expression ->
Cmm.expressionApply the transformation to those immediate sub-expressions of an expression that are in tail position, using the same definition of "tail" as iter_shallow_tail
val map_tail :
(Cmm.expression -> Cmm.expression) ->
Cmm.expression ->
Cmm.expressionApply the transformation to an expression, trying to push it to all inner sub-expressions that can produce the final result, by recursively applying map_shallow_tail
val iter_shallow : (Cmm.expression -> unit) -> Cmm.expression -> unitApply the callback to each immediate sub-expression.
val map_shallow :
(Cmm.expression -> Cmm.expression) ->
Cmm.expression ->
Cmm.expressionApply the transformation to each immediate sub-expression.
val compare_machtype_component :
Cmm.machtype_component ->
Cmm.machtype_component ->
intval equal_machtype_component :
Cmm.machtype_component ->
Cmm.machtype_component ->
boolval equal_exttype : Cmm.exttype -> Cmm.exttype -> boolval equal_static_cast : Cmm.static_cast -> Cmm.static_cast -> boolval equal_reinterpret_cast :
Cmm.reinterpret_cast ->
Cmm.reinterpret_cast ->
boolval equal_float_width : Cmm.float_width -> Cmm.float_width -> boolval equal_float_comparison :
Cmm.float_comparison ->
Cmm.float_comparison ->
boolval equal_memory_chunk : Cmm.memory_chunk -> Cmm.memory_chunk -> boolval equal_integer_comparison :
Cmm.integer_comparison ->
Cmm.integer_comparison ->
boolval is_val : Cmm.machtype_component -> boolval is_int : Cmm.machtype_component -> boolval is_addr : Cmm.machtype_component -> boolval is_exn_handler : Cmm.ccatch_flag -> bool