Skip to content

Prototypes

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.

Prototypes shared by the functions. A function refers to one of them with proto_ref (Interfaces). The generator derives from the prototype the C signatures, the C++ overloads, the LMUL > 1 versions built from two halves and the scalar fallback. The names follow the pattern ret_<return>_<n>args_<arguments>.

Files (in generator/) Schema
helpers_headers/registry_protos.json helpers_headers/schemas/protos_schema.json

Example

{
    "ret_reg_2args_reg": {
        "ret": {
            "type": "reg",
            "fixeddatatype": false,
            "charac": "WO"
        },
        "args": [
            {
                "type": "reg",
                "fixeddatatype": false,
                "charac": "RO"
            },
            {
                "type": "reg",
                "fixeddatatype": false,
                "charac": "RO"
            }
        ]
    }
}

Fields

Field Type Description
<prototype> object A prototype.
<prototype>.ret param Required. Return value.
<prototype>.args array of param Required. Arguments, in order.
<prototype>.ldiv boolean false: the functions of this prototype have no half-vector (d2) version (compress, expand...: a function that takes a mask and moves the lanes, whose half-vector by mask would need a mask conversion for little use). Default true.

Definitions

param

Type: object. A return value or an argument.

Field Type Description
type string or false Required. Kind of value: reg (data register), msk (mask register), val (scalar), ptr (pointer to elements), regout (data register written by the function: a pointer in C, a reference in C++, the outputs of loadu_unzip3), valout (scalar written by the function through a pointer, which may be NULL; nullptr by default in C++: the extremum of argmin), Nele (array of one scalar per lane), or false for a void return.
fixeddatatype boolean or string Required. false: the value has the datatype of the function (the first type dt_par of a pair for the arguments, the second one dt_ret for the return value). Otherwise its type is fixed: a datatype (int32 for a shift count, uint32, ...), a category (uint: the unsigned type of the same size as dt_par), par (the first type of the pair: the result of gather) or ret (the second type of the pair: the index of gather and scatter, pairs "data,index").
charac string RO: read only, the argument is const in the signatures. WO: written (return values, stored pointers).
lmul any LMUL of the returned register, relative to the LMUL of the function: same (default), down (one step below: m4 -> m2 -> m1 -> d2), up (one step above: d2 -> m1 -> m2 -> m4 -> m8) or a fixed LMUL (d2, m1, m2, m4, m8). The function is only generated for the LMULs whose resulting LMUL exists (no down from d2, no up from m8). The LMUL in the name of a C function is always the one of the arguments. For an argument, ratio (the index of gather / scatter): the argument has one lane per lane of the function, so its LMUL is the LMUL of the function times size(dt_ret) / size(dt_par) (32-bit indices of 64-bit data at m1: d2); the function is only generated for the LMULs where this LMUL exists. Values: same, down, up, d2, m1, m2, m4, m8, ratio.
changes_type boolean Return value only. true if the datatype of the result differs from the one of the argument (wcvt, ncvt): the LMUL change then keeps the lanes, a wider (up) or narrower (down) element in a register one step above or below. Without it, down / up split (lo, hi) or join (combine) the registers.
offset_lmul boolean or "stride" Pointers only. When a function with LMUL > 1 is built from two calls on halves, the pointer of the second call is advanced by one half. false passes the same pointer to both calls (gather and scatter, whose indices give the offsets). "stride" advances it by one half times the stride s0 (loadu_strided, storeu_strided). Omitted: true.