1 dnl x86
-64 mpn_div_qr_2n_pi1
2 dnl
-- Divide an mpn number by a normalized
2-limb number
,
3 dnl using a single
-limb inverse.
5 dnl Copyright
2007, 2008, 2010-2012 Free Software Foundation
, Inc.
7 dnl
This file is part of the GNU MP Library.
9 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
10 dnl it under the terms of
either:
12 dnl
* the GNU Lesser General
Public License as published by the Free
13 dnl Software Foundation
; either version 3 of the License, or (at your
14 dnl option
) any later version.
18 dnl
* the GNU General
Public License as published by the Free Software
19 dnl Foundation
; either version 2 of the License, or (at your option) any
22 dnl
or both
in parallel
, as here.
24 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
25 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
26 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
29 dnl You should have received copies of the GNU General
Public License
and the
30 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
31 dnl see
https://www.gnu.
org/licenses
/.
33 include(`..
/config.m4
')
40 define(`up_param', `
%rdx
')
44 define(`di_param', `
8(%rsp
)')
55 C * Store qh in the same stack slot as di_param, instead of pushing
56 C it. (we could put it in register %rbp, but then we would need to
57 C save and restore that instead, which doesn't seem like a win
).
65 PROLOGUE
(mpn_div_qr_2n_pi1
)
67 IFDOS
(`
mov 56(%rsp
), %r8
')
68 IFDOS(` mov 64(%rsp), %r9 ')
69 IFDOS
(`define
(`di_param
', `72(%rsp)')')
78 mov -16(up, un, 8), u1
87 C push qh which is !carry
99 C udiv_qr_3by2 (q,u2,u1,u2,u1,n0, d1,d0,di)
100 C Based on the optimized divrem_2.asm code.
105 add %rax, t0 C q0 in t0
107 mov %rdx, t1 C q in t1
117 xor R32(%rax), R32(%rax)
118 xor R32(%rdx), R32(%rdx)
148 L(fix): C Unlikely update. u2 >= d1
152 orb %dl, %al C "orb" form to placate Sun tools