1 dnl x86 mpn_divrem_2
-- Divide an mpn number by a normalized
2-limb number.
3 dnl Copyright
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
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
')
47 C A star means numbers not updated for the latest version of the code.
51 C * Perhaps keep ecx or esi in stack slot, freeing up a reg for q0.
52 C * The loop has not been carefully tuned. We should at the very least do
53 C some local insn swapping.
54 C * The code outside the main loop is what gcc generated. Clean up!
55 C * Clean up stack slot usage.
65 C eax ebx ecx edx esi edi ebp
71 PROLOGUE(mpn_divrem_2)
77 mov 68(%esp), %ecx C un
78 mov 72(%esp), %esi C dp
81 add 64(%esp), %edi C up
95 orb %dl, %al C "orb" form to placate Sun tools
98 mov 60(%esp), %esi C fn
99 lea -3(%esi,%ecx), %edi
125 mov %esi, 16(%esp) C di
127 mov 12(%esp), %esi C up
130 mov %eax, 4(%esp) C -d1
134 C eax ebx ecx edx esi edi ebp 0 4 8 12 16 20 24 28 32 56 60
135 C n2 un up n1 q0 -d1 di d0 d1 msl qp fn
138 mov 16(%esp), %eax C di
141 mov %eax, (%esp) C q0
146 lea (%edx, %ebp), %ebx C n1 -= ...
153 L(19): sub 20(%esp), %ebp
157 mov 20(%esp), %eax C d1
163 and %edx, %eax C d0 or 0
164 and 24(%esp), %edx C d1 or 0
169 L(bck): mov 56(%esp), %edx
170 mov %edi, (%edx, %ecx, 4)
174 L(9): mov 64(%esp), %esi C up
188 orb %dl, %al C "orb" form to placate Sun tools
195 L(35): sub 20(%esp), %ebp