1 /* mpn_add_n -- Add equal length limb vectors.
3 Copyright 1992, 1993, 1994, 1996, 2000, 2002, 2009 Free Software Foundation,
6 This file is part of the GNU MP Library.
8 The GNU MP Library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
13 The GNU MP Library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
25 #if GMP_NAIL_BITS == 0
28 mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
30 mp_limb_t ul, vl, sl, rl, cy, cy1, cy2;
33 ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
34 ASSERT (MPN_SAME_OR_INCR_P (rp, vp, n));
55 #if GMP_NAIL_BITS >= 1
58 mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
60 mp_limb_t ul, vl, rl, cy;
63 ASSERT (MPN_SAME_OR_INCR_P (rp, up, n));
64 ASSERT (MPN_SAME_OR_INCR_P (rp, vp, n));
72 cy = rl >> GMP_NUMB_BITS;
73 *rp++ = rl & GMP_NUMB_MASK;