1 dnl PowerPC-64 mpn_divrem_1 -- Divide an mpn number by an unnormalized limb.
3 dnl Copyright 2003, 2004, 2005, 2007, 2008 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 the GNU Lesser General Public License as published
9 dnl by the Free Software Foundation; either version 3 of the License, or (at
10 dnl your option) any later version.
12 dnl The GNU MP Library is distributed in the hope that it will be useful, but
13 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 dnl License for more details.
17 dnl You should have received a copy of the GNU Lesser General Public License
18 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
20 include(`../config.m4')
24 C POWER3/PPC630 16-34 16-34 ~11
35 C We use a not very predictable branch in the frac code, therefore the cycle
36 C count wobbles somewhat. With the alternative branch-free code, things run
37 C considerably slower on POWER4/PPC970 and POWER5.
39 C Add preinv entry point.
44 EXTERN_FUNC(mpn_invert_limb)
46 PROLOGUE(mpn_divrem_1)
96 CALL( mpn_invert_limb)
124 subfc r0, r0, r31 C r >= ql
125 subfe r0, r0, r0 C r0 = -(r >= ql)
127 add r10, r7, r10 C qh -= (r >= ql)
146 subfc r0, r0, r31 C r >= ql
147 subfe r0, r0, r0 C r0 = -(r >= ql)
149 add r8, r7, r8 C qh -= (r >= ql)
172 subfe r0, r0, r0 C r0 = -(r >= ql)
174 add r10, r7, r10 C qh -= (r >= ql)
221 CALL( mpn_invert_limb)
237 subf r31, r31, r8 C r = nl - qh * d
238 subfc r0, r7, r31 C r >= ql
239 subfe r0, r0, r0 C r0 = -(r >= ql)
241 add r10, r7, r10 C qh -= (r >= ql)
266 subfe r0, r0, r0 C r0 = -(r >= ql)
268 add r10, r7, r10 C qh -= (r >= ql)