Skip to content

ISA Descriptor

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.

Description of a target ISA, in simd_ext/<isa>/<isa>_isa.json (and helpers_headers/registry_scalar_isa.json for the scalar fallback). Adding a directory with this file and the native implementation files is enough to add an ISA (Add an ISA).

Checked when the file is loaded, in addition to the schema:

  • sub_isa names an existing directory of simd_ext/;
  • a negative factor in sw_lmul requires sw_ldiv_type: sub_isa or mask, and only -2 is supported;
  • sw_ldiv_type: sub_isa requires sub_isa, and a size twice the size of sub_isa;
  • info_names has at most one entry without if, in last position.

Top-level keys are sorted alphabetically (json-structure audit).

Files (in generator/) Schema
simd_ext/<isa>/<isa>_isa.json
helpers_headers/registry_scalar_isa.json
helpers_headers/schemas/isa_schema.json

Example

{
    "datatypes": {
        "float32": {
            "data_ext": "ps",
            "data_ext_logi": "ps",
            "data_ext_msk": "ps",
            "reg": "__m256",
            "msk": "__m256",
            "to_ptr": "float32_t"
        }
    },
    "define": "defined(__AVX__)",
    "header_template": [
        "#ifndef MIPP_INTERNAL_AVX_COMMON_H_",
        "#define MIPP_INTERNAL_AVX_COMMON_H_",
        "#include <immintrin.h>",
        "#include <mipp/internal/simd_ext/sse/c/common.h> // ldiv 2 support"
    ],
    "hw_lmul": [],
    "info_names": [
        {
            "if": "defined(__AVX2__)",
            "name": "x86_64 AVX2"
        },
        {
            "name": "x86_64 AVX"
        }
    ],
    "mipp_definitions": [
        "#define MIPP_64BIT",
        "#ifdef __AVX2__",
        "\t#define MIPP_AVX2",
        "#endif"
    ],
    "name": "avx",
    "prefix": "_mm256",
    "size": 256,
    "sub_isa": "sse",
    "sw_ldiv_type": "sub_isa",
    "sw_lmul": [
        1,
        2,
        4,
        8,
        -2
    ]
}

Fields

Field Type Description
ldiv_modes array of object Half-vector (d2) representations selected at compile time by a user macro (RVV). In each mode, the half-vector of the vl_datatypes is the register of LMUL 1 used with a vector length of N/2 ("by vl": lane-wise intrinsics, loads, stores and reductions process the N/2 lanes natively, with no mask), and the other datatypes keep the hardware fractional register (mf2). The d2 layer is generated once per mode under #if defined(<macro>); header_template selects the default mode. See Code Generation.
ldiv_modes[].name string Required. Short name of the mode (hw, vl, hybrid).
ldiv_modes[].macro string Required. Macro defined by the user to select the mode (e.g. MIPP_RVV_LDIV_VL).
ldiv_modes[].vl_datatypes string or array of string Required. Datatypes whose half-vector is the LMUL 1 register used with vl = N/2: a list of datatypes or aliases (all_64bit, all_datatypes), empty for the hardware fractional registers only.
name string Required. Identifier of the ISA; it must match the directory name. The generator defines MIPP_<NAME> when the ISA is selected, and adds <NAME> to the C++ mipp::ISA enum.
prefix string Prefix of the intrinsics, available in the templates as isa.prefix (e.g. _mm256).
size integer or string or array of integer Register size in bits (128, 256, 512), a macro for the sizes known at compile time only (MIPP_SCALAR_SIZE), or the list of supported sizes (SVE).
define string Preprocessor expression true when the compiler targets the ISA (e.g. defined(__AVX__)). It is the default condition of the native and emulated entries.
header_template string or array of string First lines of the generated common.h of the ISA (include guard, system headers), as a string or a list of lines. Jinja2 variables: name, name_upper.
hw_lmul array of integer LMUL factors with native registers: register groups on RVV ([1, 2, 4, 8, -2]), [1] or [] elsewhere. -2 enables the half-vectors (d2).
sw_lmul array of integer LMUL factors built in software: a register of LMUL 2 is a pair of registers of LMUL 1, and so on ([1, 2, 4, 8]). -2 builds the half-vectors as set by sw_ldiv_type.
sw_ldiv_type string Strategy for a -2 in sw_lmul. sub_isa: a half-vector is a full register of sub_isa (AVX d2 uses the SSE registers and functions). mask: a half-vector is a full register of the ISA itself, of which only the lower half of the lanes is meaningful (NEON, SVE, SSE d2): the lane-wise functions are those of LMUL 1, the others (loads, stores, reductions, tests) are specific (generic_ldiv_mask.json and <isa>_ldiv_mask.json). Values: native, sub_isa, mask. Default: "native".
sub_isa string Parent ISA (sse for avx, avx for avx512, neon for sve). It sets the detection precedence (an ISA is tested before its parent) and is added by --simd-ext. On its own, it does not make the implementations or the registers of the parent available.
is_scalar boolean true for the scalar fallback only (registry_scalar_isa.json).
info_names array of object Names printed by mipp_info(). The entries are tested in order and the first one whose if holds is used; the entry without if is the default and must be last. Omitted: the upper-cased name.
info_names[].if string Preprocessor condition of the entry.
info_names[].name string Required. Printed name (e.g. x86_64 AVX2).
mipp_definitions array of string Preprocessor lines emitted for the users when the ISA is selected: feature macros such as MIPP_AVX2, MIPP_BW, MIPP_64BIT.
hw_mask boolean true when the masks have their own registers (AVX-512 __mmask, SVE and RVV predicates). The scalar fallback then converts the masks with tovd / tovm instead of copying them.
hw_mask_requires_tovd boolean With hw_mask: the scalar fallback of a function with a mask argument or result depends on tovd and tovm, so that the resolver emits them first.
hw_mask_is_bitfield boolean With hw_mask: a mask is an integer with one bit per lane (AVX-512). The scalar fallback converts it bit by bit.
hw_mask_extract_via_store boolean With hw_mask: the scalar fallback also depends on store to read a mask (RVV).
scalar_fallback_attributes string Attributes (a macro defined by header_template) placed before inline on the Level 3 functions that copy their registers to the scalar ISA; the prototypes of the ISA are then written without inline, so that the attributes of a definition do not follow an inline declaration. RVV: MIPP_RVV_FALLBACK_ATTRIBUTES (noinline and no vectorization with GCC, nothing with the other compilers), against bugs of GCC 14.
layout object For the ISAs whose register size is only known at compile time (RVV, SVE): templates of the size macros, of the fixed-size typedefs and of the vd / vm structures, used instead of the default ones.
layout.size_symbol string Required. Macro that gives the register size in bits (__riscv_v_fixed_vlen).
layout.vlen_guard_template string Preprocessor condition (Jinja2: width, abs_lmul) under which the scalar fallback of a half-vector is valid.
layout.defines_template string Required. Template of the MIPP_<ISA>_N_* macros (number of lanes).
layout.vector_typedef_template string Required. Template of the fixed-size typedef of a data register.
layout.mask_typedef_template string Required. Template of the fixed-size typedef of a mask register.
layout.vd_struct_template string Required. Template of the vd_<isa>_<type>_t structure.
layout.vm_struct_template string Required. Template of the vm_<isa>_<type>_t structure.
datatypes map of object Required. Supported datatypes, with their types and intrinsic suffixes.
datatypes.<datatype> object A datatype. The string fields can contain placeholders such as {lsuffix}, replaced for each LMUL by the values of variables.
datatypes.<datatype>.data_ext string Suffix of the intrinsics for this datatype (ps, epi32, f32), available in the templates as isa_dt_par.data_ext.
datatypes.<datatype>.data_ext_logi string Suffix of the bitwise intrinsics, when it differs (si256 for integers).
datatypes.<datatype>.data_ext_msk string Suffix of the intrinsics on masks, when it differs.
datatypes.<datatype>.reg string Required. Type of a data register (__m256, float32x4_t, vfloat32m1_t).
datatypes.<datatype>.msk string Required. Type of a mask register (__m256, uint32x4_t, __mmask16, vbool32_t).
datatypes.<datatype>.to_ptr string Required. Element type for the pointer casts (float32_t).
datatypes.<datatype>.if string Preprocessor condition under which the datatype is available (defined(__aarch64__) for NEON float64). It is added to the condition of every implementation entry of the datatype.
datatypes.<datatype>.if_lmul object Condition per LMUL ({"-2": "0"}: no half-vector for this datatype), used instead of if for these LMUL values.
datatypes.<datatype>.variables object Extra fields of the datatype, merged into it when the file is loaded: constants ("width": "32") or maps from LMUL to value ("lsuffix": {"1": "m1", "2": "m2", "-2": "mf2"}) for the placeholders of the other fields. Also available in the templates.