1 /* Pentium __mpn_sub_n -- Subtract two limb vectors of the same length > 0
2 and store difference in a third limb vector.
3 Copyright (C) 1992,94,95,96,97,98,2000,2005 Free Software Foundation, Inc.
4 This file is part of the GNU MP Library.
6 The GNU MP Library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or (at your
9 option) any later version.
11 The GNU MP Library is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with the GNU MP Library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 MA 02111-1307, USA. */
22 #include "asm-syntax.h"
26 #define PARMS LINKAGE+16 /* space for 4 saved regs */
28 #define S1 RES+PTR_SIZE
29 #define S2 S1+PTR_SIZE
30 #define SIZE S2+PTR_SIZE
33 ENTRY (BP_SYM (__mpn_sub_n))
37 cfi_adjust_cfa_offset (4)
39 cfi_adjust_cfa_offset (4)
41 cfi_adjust_cfa_offset (4)
43 cfi_adjust_cfa_offset (4)
46 cfi_rel_offset (edi, 12)
48 cfi_rel_offset (esi, 8)
50 cfi_rel_offset (ebx, 0)
52 #if __BOUNDED_POINTERS__
53 shll $2, %ecx /* convert limbs to bytes */
54 CHECK_BOUNDS_BOTH_WIDE (%edi, RES(%esp), %ecx)
55 CHECK_BOUNDS_BOTH_WIDE (%esi, S1(%esp), %ecx)
56 CHECK_BOUNDS_BOTH_WIDE (%ebx, S2(%esp), %ecx)
60 cfi_rel_offset (ebp, 4)
66 testl %ecx,%ecx /* zero carry flag */
69 cfi_adjust_cfa_offset (4)
72 L(oop): movl 28(%edi),%eax /* fetch destination cache line */
75 L(1): movl (%esi),%eax
84 L(2): movl 8(%esi),%eax
93 L(3): movl 16(%esi),%eax
102 L(4): movl 24(%esi),%eax
117 cfi_adjust_cfa_offset (-4)
119 decl %edx /* test %edx w/o clobbering carry */
141 cfi_adjust_cfa_offset (-4)
144 cfi_adjust_cfa_offset (-4)
147 cfi_adjust_cfa_offset (-4)
150 cfi_adjust_cfa_offset (-4)
155 END (BP_SYM (__mpn_sub_n))