1 /* mpn_preinv_mod_1 (dividend_ptr, dividend_size, divisor_limb,
2 divisor_limb_inverted) --
3 Divide (DIVIDEND_PTR,,DIVIDEND_SIZE) by the normalized DIVISOR_LIMB.
4 DIVISOR_LIMB_INVERTED should be 2^(2*BITS_PER_MP_LIMB) / DIVISOR_LIMB +
6 Return the single-limb remainder.
8 Copyright (C) 1991, 1993, 1994, Free Software Foundation, Inc.
10 This file is part of the GNU MP Library.
12 The GNU MP Library is free software; you can redistribute it and/or modify
13 it under the terms of the GNU Library General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or (at your
15 option) any later version.
17 The GNU MP Library is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20 License for more details.
22 You should have received a copy of the GNU Library General Public License
23 along with the GNU MP Library; see the file COPYING.LIB. If not, write to
24 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 MA 02111-1307, USA. */
36 #define UDIV_TIME UMUL_TIME
41 mpn_preinv_mod_1 (mp_srcptr dividend_ptr, mp_size_t dividend_size,
42 mp_limb_t divisor_limb, mp_limb_t divisor_limb_inverted)
44 mpn_preinv_mod_1 (dividend_ptr, dividend_size, divisor_limb, divisor_limb_inverted)
45 mp_srcptr dividend_ptr;
46 mp_size_t dividend_size;
47 mp_limb_t divisor_limb;
48 mp_limb_t divisor_limb_inverted;
55 i = dividend_size - 1;
58 if (r >= divisor_limb)
66 udiv_qrnnd_preinv (dummy, r, r, n0, divisor_limb, divisor_limb_inverted);