1 dnl PowerPC
-64 mpn_divrem_1
-- Divide an mpn number by an unnormalized limb.
3 dnl Copyright
2003-2005, 2007, 2008, 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
')
35 C POWER3/PPC630 16-34 16-34 ~11 outdated figures
36 C POWER4/PPC970 28 28 19
48 C We use a not very predictable branch in the frac code, therefore the cycle
49 C count wobbles somewhat. With the alternative branch-free code, things run
50 C considerably slower on POWER4/PPC970 and POWER5.
52 C Add preinv entry point.
57 EXTERN_FUNC(mpn_invert_limb)
59 PROLOGUE(mpn_divrem_1,toc)
109 CALL( mpn_invert_limb)
137 subfc r0, r31, r0 C r <= ql
138 subfe r0, r0, r0 C r0 = -(r <= ql)
141 add r10, r0, r10 C qh -= (r >= ql)
158 subfc r0, r0, r31 C r >= ql
159 subfe r0, r0, r0 C r0 = -(r >= ql)
161 add r8, r7, r8 C qh -= (r >= ql)
184 subfe r0, r0, r0 C r0 = -(r >= ql)
186 add r10, r7, r10 C qh -= (r >= ql)
232 CALL( mpn_invert_limb)
248 subf r31, r31, r8 C r = nl - qh * d
249 subfc r0, r31, r0 C r <= ql
250 subfe r0, r0, r0 C r0 = -(r <= ql)
253 add r10, r0, r10 C qh -= (r >= ql)