Interfaces¶
Generated page
This page is generated by gen_mipp_docs.py from the JSON Schemas of the generator (generator/helpers_headers/schemas/, generator/helpers_tests/schemas/). To change it, edit the description fields of the schemas, not this page.
Public functions of MIPP, one entry per function. The generator derives from it the names and the signatures in the three APIs: mipp_add_float32, mipp_add_float32_maskz, mipp_add_float32_m2 in C, mipp::add in C++.
Checked when the file is loaded: proto_ref exists in registry_protos.json, the function has a scalar implementation for each of its datatypes and mask variants (Scalar Implementations), and it is in at most one category (Categories).
Files (in generator/) |
Schema |
|---|---|
helpers_headers/registry_interfaces.json |
helpers_headers/schemas/interfaces_schema.json |
Example¶
{
"absdiff": {
"proto_ref": "ret_reg_2args_reg",
"datatypes": "all_datatypes",
"horizontal": false,
"variants": [
"u",
"m",
"z",
"s"
]
}
}
Fields¶
| Field | Type | Description |
|---|---|---|
<function> |
object | A function. |
<function>.proto_ref |
string | Required. Name of a prototype of registry_protos.json (Prototypes). |
<function>.datatypes |
string or array of string | Required. Datatypes of the function: an alias of DATATYPES_MAP (helpers_headers/tools.py), such as all_datatypes, all_float, all_int, all_uint, all_32bit, or a pair alias for the conversions (all_datatypes_same_size, all_datatypes_widenning, ...), or an explicit list. |
<function>.horizontal |
boolean | Required. true for the functions that combine the lanes of a register (reductions such as hadd, hmax). Their LMUL > 1 versions come from the lmulh generic templates instead of two calls on halves. |
<function>.variants |
array of any | Required. Variants of the function: u (unmasked, always present), m (Merge-Masked), z (Zero-Masked), s (Source-Masked). ["u"]: no mask variant; ["u", "m", "z", "s"]: all of them. |
<function>.lane_crossing |
boolean | true for the functions that move lanes across the register (reverse, slide, ziplo...), on the whole register and the whole LMUL group: the LMUL > 1 versions of the ISAs with a software LMUL are not two calls on the halves but the templates of generic_emu_implems_lmulh.json (a missing one is an error), and the half-vector of the ISAs whose d2 is a masked register goes through the scalar d2 function. Default false. |
<function>.main_category |
string | Main category of a function listed in several categories of registry_categories.json (required then, and one of them): the location of its headers (mipp/internal/.../functions/<category>/), of its tests and of its documentation page. The other categories only list it: their headers (mipp/<api>/cat/<category>.h) include it, and the documentation and the API Explorer show it in each of them. loadu_unzip2 is a rearrangement listed with the loads. |
<function>.cpp_name |
string | Name of the function in the C++ APIs when it differs from the C name: get_k is mipp::get. |
<function>.cpp_ret |
string | Return type of the function in the C++ APIs when it differs from the one of the C API: bool for the tests of masks (any, all, none, testz), whose C function returns an int32_t. Values: bool. |
<function>.forms |
array of string | Scalar forms of the function (see Scalar Forms): one string per form, with one letter per data register argument of the prototype, v (register) or s (scalar of the type of the function, broadcast to every lane). "forms": ["vs", "sv"] on sub gives sub_vs(r, s) and sub_sv(s, r) (C: mipp_sub_vs_float32, C++: overloads of mipp::sub). Each form is a function of its own, derived when the registry is loaded (helpers_headers/forms.py): prototype, category, scalar reference and a generic Level 2 body (the base function with the scalar broadcast), whose level is the one of the base. The all-v form is the base function itself. |
<function>.imm |
string | Values of the integer argument when it is a constant (lt_n: [0, N), le_n: [0, N], lt_nb / le_nb: the same with the lanes of a block of 128 bits, lt_bits: [0, bits of the elements)): the ISAs that have immediate bodies for the function (<isa>_imm_implems.json) start its unmasked LMUL 1 version with a dispatch on these values, used when the argument is known at compile time (see codegen/imm.py), and the C++ APIs have a template version f<N>(...). Values: lt_n, le_n, lt_nb, le_nb, lt_bits. |
<function>.domain |
map of string | Values of the lanes of a register argument outside of which the function is undefined behavior, as its documentation says: one entry per argument (vd0, vd1... of the unmasked prototype), checked on the active lanes only (an inactive lane does not compute the operation). lt_n: [0, N), N the lanes of the register; lt_nb: [0, B), B the lanes of a block of 128 bits; lt_2n: [0, 2N) (indices in the concatenation of two registers); lt_bits: [0, bits of the elements) (shift counts); lt_64: [0, 64) on the integer datatypes (1 << x in 64 bits), no constraint on the floating-point ones; in_tr: representable in the type of the result once truncated toward zero (conversion from a floating-point type to an integer type; NaN is out of the domain). The scalar simulator of the API Explorer refuses the other values; the immediate arguments are checked with imm. |
<function>.domain.<key> |
string | Values: lt_n, lt_nb, lt_2n, lt_bits, lt_64, in_tr. |