1 dnl PowerPC-64 mpn_addmul_1 -- Multiply a limb vector with a limb and add
2 dnl the result to a second limb vector.
4 dnl Copyright 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free Software
7 dnl This file is part of the GNU MP Library.
9 dnl The GNU MP Library is free software; you can redistribute it and/or modify
10 dnl it under the terms of the GNU Lesser General Public License as published
11 dnl by the Free Software Foundation; either version 3 of the License, or (at
12 dnl your option) any later version.
14 dnl The GNU MP Library is distributed in the hope that it will be useful, but
15 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 dnl License for more details.
19 dnl You should have received a copy of the GNU Lesser General Public License
20 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
22 include(`../config.m4')
30 C * Reduce the number of registers used. Some mul destination registers could
32 C * Delay std for preserving registers, and suppress them for n=1.
33 C * Write faster feed-in code. If nothing else, avoid one or two up updates.
42 PROLOGUE(mpn_addmul_1)
50 rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
52 addi n, n, 3 C compute count...
53 srdi n, n, 2 C ...for ctr
54 mtctr n C copy count into ctr
122 L(b10): addic r0, r0, 0
123 li r12, 0 C cy_limb = 0
124 L(fic): ld r26, 0(up)
129 L(top): mulld r0, r26, r6 C
130 mulhdu r5, r26, r6 C 26
134 mulhdu r8, r27, r6 C 27
137 adde r0, r0, r12 C 0 12
138 adde r7, r7, r5 C 5 7
140 mulhdu r10, r26, r6 C 26
144 mulhdu r12, r27, r6 C 27
147 adde r9, r9, r8 C 8 9
148 adde r11, r11, r10 C 10 11
150 addc r0, r0, r28 C 0 28
152 adde r7, r7, r29 C 7 29
154 adde r9, r9, r30 C 9 30
156 adde r11, r11, r31 C 11 31
162 L(end): mulld r0, r26, r6