1 dnl PowerPC
-64 mpn_addmul_1
and mpn_submul_1.
3 dnl Copyright
1999-2001, 2003-2006, 2010-2012 Free Software Foundation
, Inc.
5 dnl
This file is part of the GNU MP Library.
7 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
8 dnl it under the terms of
either:
10 dnl
* the GNU Lesser General
Public License as published by the Free
11 dnl Software Foundation
; either version 3 of the License, or (at your
12 dnl option
) any later version.
16 dnl
* the GNU General
Public License as published by the Free Software
17 dnl Foundation
; either version 2 of the License, or (at your option) any
20 dnl
or both
in parallel
, as here.
22 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
23 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
24 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
27 dnl You should have received copies of the GNU General
Public License
and the
28 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
29 dnl see
https://www.gnu.
org/licenses
/.
31 include(`..
/config.m4
')
33 C mpn_addmul_1 mpn_submul_1
34 C cycles/limb cycles/limb
35 C POWER3/PPC630 6-18 6-18
42 C * Try to reduce the number of needed live registers
43 C * Add support for _1c entry points
51 ifdef(`OPERATION_addmul_1',`
54 define
(func
, mpn_addmul_1
)
55 define
(func_nc
, mpn_addmul_1c
) C
FIXME: not really supported
58 ifdef
(`OPERATION_submul_1
',`
59 define(ADDSUBC, subfe)
61 define(func, mpn_submul_1)
62 define(func_nc, mpn_submul_1c) C FIXME: not really supported
66 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
71 rldicl. r0, n, 0,62 C r0 = n & 3, set cr0
75 addi n, n, 3 C compute count...
77 srdi n, n, 2 C ...for ctr
79 mtctr n C copy count into ctr
94 SM(` subfe r11, r11, r11 ')
116 SM
(` subfe r11
, r11
, r11
')
127 SM(` subfe r11, r11, r11 ')
128 SM
(` addic r11
, r11
, 1 ')
150 ADDSUBC r11, r11, r30
156 SM(` subfe r11, r11, r11 ')
159 L
(b10
): addic r0
, r0
, 0
160 li r12
, 0 C cy_limb
= 0
167 L
(top
): mulld r0
, r9
, r6
168 mulhdu r5
, r9
, r6 C
9
170 mulhdu r8
, r27
, r6 C
27
175 adde r0
, r0
, r12 C
0 12
176 adde r7
, r7
, r5 C
5 7
178 mulhdu r10
, r9
, r6 C
9
180 mulhdu r12
, r27
, r6 C
27
185 adde r5
, r5
, r8 C
8 5
186 adde r11
, r11
, r10 C
10 11
188 ADDSUB r0
, r0
, r28 C
0 28
190 ADDSUBC r7
, r7
, r29 C
7 29
192 ADDSUBC r5
, r5
, r30 C
5 30
194 ADDSUBC r11
, r11
, r31 C
11 31
197 SM
(` subfe r11
, r11
, r11
')
200 SM(` addic r11, r11, 1 ')
203 L
(end): mulld r0
, r9
, r6
216 SM
(` subfe r11
, r11
, r11
')
217 SM(` addic r11, r11, 1 ')