_flint_mpn_mulhigh_n, _flint_mpn_mulhigh_basecase, _flint_mpn_mulhigh_n_recursive, _flint_mpn_mulhigh_n_mulders, _flint_mpn_mulhigh_n_mul, _flint_mpn_mulhigh_n_naive
Synopsis
#include <flint/mpn_extras.h>mp_limb_t _flint_mpn_mulhigh_n(mp_ptr res, mp_srcptr u, mp_srcptr v, mp_size_t n)sourcemp_limb_t _flint_mpn_mulhigh_basecase(mp_ptr res, mp_srcptr u, mp_srcptr v, mp_size_t n)sourcemp_limb_t _flint_mpn_mulhigh_n_recursive(mp_ptr r, mp_srcptr x, mp_srcptr y, mp_size_t n)sourcemp_limb_t _flint_mpn_mulhigh_n_mulders(mp_ptr res, mp_srcptr u, mp_srcptr v, mp_size_t n)sourcemp_limb_t _flint_mpn_mulhigh_n_mul(mp_ptr res, mp_srcptr u, mp_srcptr v, mp_size_t n)sourcemp_limb_t _flint_mpn_mulhigh_n_naive(mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)sourceThe algorithms behind flint_mpn_mulhigh_n, with its interface.
_flint_mpn_mulhigh_nis the dispatcher used beyond the hard-coded sizes: the basecase up toFLINT_MPN_MULHIGH_MULDERS_CUTOFF(40) limbs, Mulders' algorithm up toFLINT_MPN_MULHIGH_FFT_SMALL_CUTOFF(withfft_small) orFLINT_MPN_MULHIGH_MUL_CUTOFF(2000), and above, a middle product withfft_smallrespectively a full product._flint_mpn_mulhigh_basecaseis the quadratic algorithm (an assembly routine on x86-64 with ADX, which requires n \ge 6, and on ARM64, which requires n > 8). On x86-64 with ADX the basecase used by the dispatcher is_flint_mpn_mulhigh_n_recursiveup to 22 limbs: it splits off a block handled by the fastest hard-coded routine (FLINT_MPN_MULHIGH_BEST_TAB_Nlimbs) and recurses._flint_mpn_mulhigh_n_mulderscomputes a rough high product with one extra limb using_flint_mpn_mulhigh_n_mulders_recursive._flint_mpn_mulhigh_n_mulcomputes the full product; its result is the exact truncation._flint_mpn_mulhigh_n_naiveis a portable reference implementation of the basecase, against which the assembly routines are tested (they return identical results).
Cite this page
The FLINT team, “_flint_mpn_mulhigh_n, _flint_mpn_mulhigh_basecase, _flint_mpn_mulhigh_n_recursive, _flint_mpn_mulhigh_n_mulders, _flint_mpn_mulhigh_n_mul, _flint_mpn_mulhigh_n_naive (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/_flint_mpn_mulhigh_n.html (generated 2026-10-20).
@misc{flint-doc-mpn-extras-flint-mpn-mulhigh-n,
author = {{The FLINT team}},
title = {{\_flint\_mpn\_mulhigh\_n, \_flint\_mpn\_mulhigh\_basecase, \_flint\_mpn\_mulhigh\_n\_recursive, \_flint\_mpn\_mulhigh\_n\_mulders, \_flint\_mpn\_mulhigh\_n\_mul, \_flint\_mpn\_mulhigh\_n\_naive (mpn\_extras.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_extras/_flint_mpn_mulhigh_n.html},
note = {Generated 2026-10-20}
}