187984Snon/* mpn_submul_1 for Cray PVP. 287984Snon 387984SnonCopyright 1996, 2000, 2001 Free Software Foundation, Inc. 487984Snon 587984SnonThis file is part of the GNU MP Library. 687984Snon 7150636SmlaierThe GNU MP Library is free software; you can redistribute it and/or modify 887984Snonit under the terms of either: 987984Snon 1087984Snon * the GNU Lesser General Public License as published by the Free 11 Software Foundation; either version 3 of the License, or (at your 12 option) any later version. 13 14or 15 16 * the GNU General Public License as published by the Free Software 17 Foundation; either version 2 of the License, or (at your option) any 18 later version. 19 20or both in parallel, as here. 21 22The GNU MP Library is distributed in the hope that it will be useful, but 23WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25for more details. 26 27You should have received copies of the GNU General Public License and the 28GNU Lesser General Public License along with the GNU MP Library. If not, 29see https://www.gnu.org/licenses/. */ 30 31 32#include "gmp-impl.h" 33 34mp_limb_t 35mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t limb) 36{ 37 mp_limb_t p0[n], p1[n], tp[n]; 38 mp_limb_t cy_limb; 39 40 GMPN_MULWW (p1, p0, up, &n, &limb); 41 cy_limb = mpn_sub_n (tp, rp, p0, n); 42 rp[0] = tp[0]; 43 if (n != 1) 44 cy_limb += mpn_sub_n (rp + 1, tp + 1, p1, n - 1); 45 cy_limb += p1[n - 1]; 46 47 return cy_limb; 48} 49