FLINT3.7.0-dev

nmod_mat_mul_u32

Synopsis#include <flint/nmod_mat.h>
int nmod_mat_mul_u32(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B)source

Sets C = AB for a modulus n < 2^{32} with an integer SIMD kernel (AVX-512, AVX2, NEON, or portable C), and returns 1. Returns 0 if n \ge 2^{32} or on 32-bit machines. C may be aliased with A or B. Uses several threads when available.

The entries are lifted to signed 32-bit integers |x| \le n/2, and their products are accumulated exactly in signed 64-bit lanes with widening 32 \times 32 \to 64-bit multiplications. When an accumulator could overflow, it is folded: writing it as h 2^{32} + l, it is replaced by h c + l with c = 2^{32} \bmod n. For n below about 2^{28.5} no fold is needed within a block of 256 products, and a single pass serves any n < 2^{32}.

AlgorithmMatrix multiplication kernels modulo nThe blocked SIMD kernels nmod_mat_mul_u32, _u52, _k52 and _fp50, which multiply matrices modulo moduli up to 2^{52} in one pass with delayed reduction, and the floating-point route of nmod_mat_mul_blas with Chinese remaindering.
Cite this page

The FLINT team, “nmod_mat_mul_u32 (nmod_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_mat/nmod_mat_mul_u32.html (generated 2026-10-20).