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 ifdef(`BMOD_1_TO_MOD_1_THRESHOLD',,
47 `define
(`BMOD_1_TO_MOD_1_THRESHOLD
',30)')
49 EXTERN_FUNC
(mpn_mod_1
)
50 EXTERN_FUNC
(mpn_modexact_1c_odd
)
53 PROLOGUE
(mpn_gcd_1
,toc
)
60 ld r7
, 0(up
) C U
low limb
65 cntlzd r31
, r6 C common twos
75 cmpdi r4
, BMOD_1_TO_MOD_1_THRESHOLD
81 CALL( mpn_modexact_1c_odd
)
84 define
(`
mask', `r0')dnl
89 define
(`cnt
', `r9')dnl
101 and a1
, r10
, mask C d
- a
102 andc a2
, r11
, mask C a
- d
104 andc d2
, r30
, mask C d
105 or r3
, a1
, a2 C new a
107 or r30
, d1
, d2 C new d
108 L
(mid
): srd r3
, r3
, cnt
109 sub. r10
, r30
, r3 C r10
= d
- a
110 subc r11
, r3
, r30 C r11
= a
- d
113 subfe
mask, mask, mask
117 L
(end): sld r3
, r30
, r31