1 dnl x86-32 mpn_addmul_1 and mpn_submul_1 optimised for Intel Atom.
3 dnl Contributed to the GNU project by Torbjorn Granlund and Marco Bodrato.
5 dnl Copyright 2011 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')
27 C P6 model 0-8,10-12 -
29 C P6 model 13 (Dothan)
30 C P4 model 0 (Willamette)
32 C P4 model 2 (Northwood)
33 C P4 model 3 (Prescott)
45 ifdef(`OPERATION_addmul_1',`
47 define(func_1, mpn_addmul_1)
48 define(func_1c, mpn_addmul_1c)')
49 ifdef(`OPERATION_submul_1',`
51 define(func_1, mpn_submul_1)
52 define(func_1c, mpn_submul_1c)')
54 MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
74 L(fi3): lea -8(up), up
79 add $1, n C increment and clear carry
82 L(fi1): movd %mm0, %ebx
100 L(fi2): lea 4(up), up
101 add $1, n C increment and clear carry
106 C ALIGN(16) C alignment seems irrelevant
107 L(top): movd 4(up), %mm1
113 L(lo1): psrlq $32, %mm0
121 L(lo0): psrlq $32, %mm1
129 L(lo3): psrlq $32, %mm0
137 L(lo2): psrlq $32, %mm1
144 L(end): adc n, %edx C n is zero here
148 L(wd1): psrlq $32, %mm0
161 mov 20(%esp), %edx C carry