Skip to content

v2.2.0 – Half-Vectors, LMUL-Changing Functions & API Cleanup

Latest

Choose a tag to compare

@github-actions github-actions released this 18 Oct 08:39
· 166 commits to master since this release
74dc088

Summary

MIPP v2.2.0 adds half-vector (d2) support on every SIMD extension and a family of LMUL-changing functions (low, high, combine, wcvt, ncvt), makes the generator fully data-driven for ISA discovery, fixes a number of correctness issues, and completely rewrites the documentation. It also cleans up the v2 API names (breaking, see below).


Highlights

1. SVE and SVE2 support

  • Arm SVE and SVE2 are now supported with a vector length fixed at compile time (e.g. -march=armv9-a+sve -msve-vector-bits=128). SVE is detected before NEON (__ARM_NEON is also defined on SVE targets).
  • Native svbool_t masks and half-vectors (d2).
  • Many compilation and runtime fixes; unit tests, examples and documentation snippets are built and run in CI on armv9-sve and armv9-sve2 (gcc-15 is used there to work around a gcc-14 internal compiler error).

2. Half-vectors (d2, MIPP_LDIV_2)

  • New sw_ldiv_type: "mask" strategy: a d2 value lives in a full LMUL=1 register and its upper lanes are ignored. Enabled on NEON, SVE and SSE (AVX/AVX-512 keep their native sub_isa halves, scalar generates d2 types too).
  • Lane-wise d2 wrappers are generated from the LMUL=1 functions; special cases (load/store, gather/scatter, set, reductions, testz) come from overridable Jinja+C templates (generic_ldiv_mask.json, <isa>_ldiv_mask.json).
  • New functions that change the LMUL: low, high, combine, wcvt, ncvt, including native masked versions on RVV (low_k, high_k, combine_k).
  • Aliases without suffix (_m1) are now generated, and header sections are named (LMUL = 1 Aliases, Emulated LMUL > 1, Hardware LMUL > 1).
  • Gather/scatter tests for all APIs, all LMULs and d2.

3. Generator: add an ISA without touching Python

  • The ISA list, the C++ mipp::ISA enum and mipp_info() are derived from generator/simd_ext/ (new info_names field in <isa>_isa.json).
  • ISA descriptors are validated (sub_isa, sw_ldiv_type, sw_lmul, sizes).
  • SVE now declares NEON as sub_isa, so SVE is always detected before NEON.
  • Fixed mipp_info() always reporting 64-bit/BW support as "yes".

4. Performance and native instructions

  • RVV: native loadu/storeu/set and masked loads/stores (no more alignment test + memcpy through the stack).
  • SSE: native max/min for all types that have an instruction.
  • cvt: native float↔int on SSE, AVX-512 and RVV; same-width int↔uint pairs as reinterpretation.
  • AVX-512: native masked load/store for unsigned types, native unaligned masked loadu/storeu.
  • NEON: ARMv7 float64 half-vectors fall back to L3.

5. Fixes

  • Integer pow (base was never squared; masked variants ignored the mask).
  • SVE testz(m0, m1) ignored m1.
  • RVV loadu/storeu/set copied N bytes instead of N elements.
  • C interface: f(void) instead of f(); 0 warning with -Wall -Wextra -pedantic in C99 and C++11 (NEON, scalar, SSE4.2, AVX2, AVX-512).
  • Duplicate C typedefs (-Wtypedef-redefinition), including SVE masks.
  • Masked d2 C wrappers in coarse granularity.
  • Scalar: MIPP_LDIV_2, MIPP_64BIT, MIPP_BW defined; MIPP_SCALAR_SIZE must be a power of two ≥ 128.
  • SVE: testz(m0, m1) fix and C typedef fixes (see above).

Breaking changes

The v2 API is still in beta; these renames make it consistent.

Before After
toreg, tomsk, blend torvd, torvm, select
testz_2(m) none(m) (testz(m0, m1) is unchanged)
DSL variant modifier mk: v: (letters of mipp::VARIANT)
DSL scalar token %v<> %s<>
pow2(r0, v0) pow2(r0)
MIPP_ALIGNED_LOADS removed: load/store are always aligned, loadu/storeu accept any address
function category converts convert (old Explorer #cat=converts links are invalid)

Also: torvm now defines a lane as active iff at least one bit of the element is set, and returns a canonical mask (all bits set) on every ISA.


Documentation & API Explorer

  • User guide restructured; new Headers & Compile Time page with measured compile-time and memory gains.
  • Developer guide rebuilt, with generated CLI and registry references and a streamlined Add an ISA tutorial.
  • Equivalent C / Functional / Object tabs, generated tables, LMUL-mode figures, SIMD comparison refreshed.
  • All user-guide code examples are compiled and run in CI (examples/doc/).
  • The Explorer no longer hard-codes categories; it reads generated per-function traits.

Getting Started

git clone --recursive -b v2.2.0 https://github.com/aff3ct/MIPP.git
cd MIPP/generator
python3 gen_mipp_headers.py --granularity fine   # or: coarse

Full Changelog: v2.1.0...v2.2.0