1 /* Add two limb vectors of the same length > 0 and store sum in a third
3 Copyright (C) 1992-2016 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,
18 see <http://www.gnu.org/licenses/>. */
21 #include "asm-syntax.h"
23 #define PARMS 4+8 /* space for 2 saved regs */
31 L(1): addl (%esp), %eax
37 cfi_adjust_cfa_offset (4)
39 cfi_adjust_cfa_offset (4)
42 cfi_rel_offset (edi, 4)
44 cfi_rel_offset (esi, 0)
48 shrl $3,%ecx /* compute count for unrolled loop */
50 andl $7,%eax /* get index where to start loop */
51 jz L(oop) /* necessary special case for 0 */
52 incl %ecx /* adjust loop count */
53 shll $2,%eax /* adjustment for pointers... */
54 subl %eax,%edi /* ... since they are offset ... */
55 subl %eax,%esi /* ... by a constant when we ... */
56 subl %eax,%edx /* ... enter the loop */
57 shrl $2,%eax /* restore previous value */
59 /* Calculate start address in loop for PIC. */
60 leal (L(oop)-L(0)-3)(%eax,%eax,8),%eax
64 /* Calculate start address in loop for non-PIC. */
65 leal (L(oop) - 3)(%eax,%eax,8),%eax
67 jmp *%eax /* jump into loop */
69 L(oop): movl (%esi),%eax
103 cfi_adjust_cfa_offset (-4)
106 cfi_adjust_cfa_offset (-4)