1dnl PowerPC-64 mpn_submul_1 -- Multiply a limb vector with a limb and subtract 2dnl the result from a second limb vector. 3 4dnl Copyright 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. 5 6dnl This file is part of the GNU MP Library. 7 8dnl The GNU MP Library is free software; you can redistribute it and/or modify 9dnl it under the terms of the GNU Lesser General Public License as published 10dnl by the Free Software Foundation; either version 3 of the License, or (at 11dnl your option) any later version. 12 13dnl The GNU MP Library is distributed in the hope that it will be useful, but 14dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 16dnl License for more details. 17 18dnl You should have received a copy of the GNU Lesser General Public License 19dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. 20 21include(`../config.m4') 22 23C cycles/limb 24C POWER3/PPC630: ? 25C POWER4/PPC970: 16 26 27C INPUT PARAMETERS 28C rp r3 29C up r4 30C n r5 31C v r6,r7 or r7,r8 32 33ASM_START() 34PROLOGUE(mpn_submul_1) 35 36ifdef(`BROKEN_LONGLONG_PARAM', 37` rldimi r8, r7, 32,0 C assemble vlimb from separate 32-bit arguments 38 mr r6, r8 39',` 40 rldimi r7, r6, 32,0 C assemble vlimb from separate 32-bit arguments 41 mr r6, r7 42') 43 li r7, 0 C cy_limb = 0 44 mtctr r5 45 addic r0, r0, 0 46 addi r3, r3, -8 47 addi r4, r4, -8 48 49L(oop): ldu r0, 8(r4) 50 mulld r9, r0, r6 51 adde r12, r9, r7 C add old high limb and new low limb 52 srdi r5, r9, 32 53 srdi r11, r7, 32 54 adde r5, r5, r11 C add high limb parts, set cy 55 mulhdu r7, r0, r6 56 addze r7, r7 57 ld r10, 8(r3) 58 subfc r9, r12, r10 59 srdi r5, r12, 32 60 srdi r11, r10, 32 61 subfe r5, r5, r11 C subtract high limb parts, set cy 62 stdu r9, 8(r3) 63 subfe r11, r11, r11 C invert ... 64 addic r11, r11, 1 C ... carry 65 bdnz L(oop) 66 67 addze r4, r7 68 srdi r3, r4, 32 69 blr 70EPILOGUE() 71 72