Ocaml_typing.Primitivetype native_repr = | Repr_poly| Same_as_ocaml_repr of Jkind_types.Sort.Const.t| Unboxed_float of boxed_float| Unboxed_vector of boxed_vector| Unboxed_or_untagged_integer of unboxed_or_untagged_integerRepresentation of arguments/result for the native code version of a primitive.
Untagged integers (such as int[@untagged]) are represented as Unboxed_integer Untagged_int
type description = native_repr description_genmake_prim_repr_args n x is the same as List.init n (fun _ -> x). Keeping this function here to be close to upstream. It's intended for use with make.
val make :
name:string ->
alloc:bool ->
c_builtin:bool ->
effects:effects ->
coeffects:coeffects ->
native_name:string ->
native_repr_args:(mode * 'repr) list ->
native_repr_res:(mode * 'repr) ->
is_layout_poly:bool ->
'repr description_genval parse_declaration :
Ocaml_parsing.Parsetree.value_description ->
native_repr_args:(mode * native_repr) list ->
native_repr_res:(mode * native_repr) ->
is_layout_poly:bool ->
descriptionval print : description -> Outcometree.out_val_decl -> Outcometree.out_val_declval native_name : 'a description_gen -> stringval byte_name : 'a description_gen -> stringval unboxed_float : boxed_float -> unboxed_floatval unboxed_or_untagged_integer : boxed_integer -> unboxed_or_untagged_integerval unboxed_vector : boxed_vector -> unboxed_vectorval equal_unboxed_or_untagged_integer :
unboxed_or_untagged_integer ->
unboxed_or_untagged_integer ->
boolval equal_unboxed_float : unboxed_float -> unboxed_float -> boolval equal_unboxed_vector : unboxed_vector -> unboxed_vector -> boolval compare_unboxed_float : unboxed_float -> unboxed_float -> intval compare_unboxed_vector : unboxed_vector -> unboxed_vector -> intval equal_boxed_integer : boxed_integer -> boxed_integer -> boolval equal_boxed_float : boxed_float -> boxed_float -> boolval equal_boxed_vector : boxed_vector -> boxed_vector -> boolval compare_boxed_float : boxed_float -> boxed_float -> intval compare_boxed_vector : boxed_vector -> boxed_vector -> intval equal_native_repr : native_repr -> native_repr -> boolval native_name_is_external : description -> boolnative_name_is_externa returns true iff the native_name for the given primitive identifies that the primitive is not implemented in the compiler itself.
val prim_has_valid_reprs : loc:Ocaml_parsing.Location.t -> description -> unitCheck if a primitive has the correct native representations for its argument/return types. This check is done based on the primitive name and only imposes constraints on built-in primitives. Raises if the check fails.
val prim_can_contain_layout_any : description -> boolCheck if a primitive can have layout any anywhere within its type declaration. Returns false for built-in primitives that inspect the layout of type parameters (%array_length for example).
type error = | Old_style_float_with_native_repr_attribute| Old_style_float_with_non_value| Old_style_noalloc_with_noalloc_attribute| No_native_primitive_with_repr_attribute| No_native_primitive_with_non_value| Inconsistent_attributes_for_effects| Inconsistent_noalloc_attributes_for_effects| Invalid_representation_polymorphic_attribute| Invalid_native_repr_for_primitive of stringexception Error of Ocaml_parsing.Location.t * error