1 dnl x86-32 mpn_mod_1s_4p, requiring cmov.
3 dnl Contributed to the GNU project by Torbjorn Granlund.
5 dnl Copyright 2009 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 the GNU Lesser General Public License as published
11 dnl by the Free Software Foundation; either version 3 of the License, or (at
12 dnl your option) any later version.
14 dnl The GNU MP Library is distributed in the hope that it will be useful, but
15 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 dnl License for more details.
19 dnl You should have received a copy of the GNU Lesser General Public License
20 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
22 include(`../config.m4')
28 C P6 model 13 (Dothan) 6.0
29 C P4 model 0 (Willamette)
31 C P4 model 2 (Northwood) 15.5
32 C P4 model 3 (Prescott)
39 C Ths inner loop was manually written, it ought to be loopmixed.
40 C Presumably, we could get to 4 c/l for K7.
42 C The cps function was compiler generated. It can clearly be optimized.
49 PROLOGUE(mpn_mod_1s_4p)
55 mov 60(%esp), %edi C cps
66 mov 52(%esp), %eax C n
68 mov 48(%esp), %esi C up
69 lea -12(%esi,%eax,4), %esi
76 L(b3): mov 4(%esi), %eax
86 L(b0): mov (%esi), %eax
100 L(b1): mov 8(%esi), %ebp
104 L(b2): mov 8(%esi), %eax
111 L(top): mov (%esi), %eax
134 L(m0): add %eax, %ebp
136 L(m1): sub $4, 52(%esp)
139 L(end): mov 4(%esp), %eax
163 lea (%eax,%esi), %edx
179 PROLOGUE(mpn_mod_1s_4p_cps)
207 movzbl 24(%esp), %ecx
217 lea 1(%edx,%edi), %eax
220 lea (%ebp,%esi), %eax
225 lea 1(%ebp,%edx), %edi
238 lea 1(%edi,%edx), %eax
250 lea 1(%eax,%edx), %ecx
263 movzbl 24(%esp), %ecx