1 dnl PowerPC
-64 mpn_gcd_1.
3 dnl Copyright
2000-2002, 2005, 2009, 2011-2013 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
')
39 C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
46 EXTERN_FUNC(mpn_mod_1)
47 EXTERN_FUNC(mpn_modexact_1c_odd)
50 PROLOGUE(mpn_gcd_1,toc)
57 ld r7, 0(up) C U low limb
62 cntlzd r31, r6 C common twos
72 cmpdi r4, BMOD_1_TO_MOD_1_THRESHOLD
78 CALL( mpn_modexact_1c_odd)
81 define(`cnt', `r9
')dnl
91 L(top): isel r30, r3, r30, 29 C y = min(x,y)
92 isel r3, r10, r11, 29 C x = |y - x|
93 L(mid): subf cnt, cnt, r12 C cnt = 63-cnt
95 subf r10, r3, r30 C r10 = y - x
96 subf r11, r30, r3 C r11 = x - y
98 and r8, r11, r10 C isolate lsb
102 L(end): sld r3, r30, r31