dnl Intel Pentium MMX mpn_mul_1 -- mpn by limb multiplication. dnl Copyright 2000, 2001, 2002 Free Software Foundation, Inc. dnl dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Lesser General Public License as dnl published by the Free Software Foundation; either version 2.1 of the dnl License, or (at your option) any later version. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public dnl License along with the GNU MP Library; see the file COPYING.LIB. If dnl not, write to the Free Software Foundation, Inc., 51 Franklin Street, dnl Fifth Floor, Boston, MA 02110-1301, USA. include(`../config.m4') C cycles/limb C P5: 12.0 for 32-bit multiplier C 7.0 for 16-bit multiplier C mp_limb_t mpn_mul_1 (mp_ptr dst, mp_srcptr src, mp_size_t size, C mp_limb_t multiplier); C C When the multiplier is 16 bits some special case MMX code is used. Small C multipliers might arise reasonably often from mpz_mul_ui etc. If the size C is odd there's roughly a 5 cycle penalty, so times for say size==7 and C size==8 end up being quite close. If src isn't aligned to an 8 byte C boundary then one limb is processed separately with roughly a 5 cycle C penalty, so in that case it's say size==8 and size==9 which are close. C C Alternatives: C C MMX is not believed to be of any use for 32-bit multipliers, since for C instance the current method would just have to be more or less duplicated C for the high and low halves of the multiplier, and would probably C therefore run at about 14 cycles, which is slower than the plain integer C at 12. C C Adding the high and low MMX products using integer code seems best. An C attempt at using paddd and carry bit propagation with pcmpgtd didn't give C any joy. Perhaps something could be done keeping the values signed and C thereby avoiding adjustments to make pcmpgtd into an unsigned compare, or C perhaps not. C C Future: C C An mpn_mul_1c entrypoint would need a double carry out of the low result C limb in the 16-bit code, unless it could be assumed the carry fits in 16 C bits, possibly as carry