]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/i386/i586/addmul_1.S
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / i386 / i586 / addmul_1.S
CommitLineData
8f5ca04b
RM
1/* Pentium __mpn_addmul_1 -- Multiply a limb vector with a limb and add
2 the result to a second limb vector.
04277e02 3 Copyright (C) 1992-2019 Free Software Foundation, Inc.
5929563f 4 This file is part of the GNU MP Library.
8f5ca04b 5
5929563f 6 The GNU MP Library is free software; you can redistribute it and/or modify
6d84f89a
AJ
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
5929563f 9 option) any later version.
8f5ca04b 10
5929563f
UD
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
6d84f89a 13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
5929563f 14 License for more details.
8f5ca04b 15
6d84f89a 16 You should have received a copy of the GNU Lesser General Public License
59ba27a6 17 along with the GNU MP Library; see the file COPYING.LIB. If not,
5a82c748 18 see <https://www.gnu.org/licenses/>. */
8f5ca04b 19
8f5ca04b
RM
20#include "sysdep.h"
21#include "asm-syntax.h"
43c81906 22
2366713d 23#define PARMS 4+16 /* space for 4 saved regs */
43c81906 24#define RES PARMS
2366713d
JM
25#define S1 RES+4
26#define SIZE S1+4
43c81906 27#define S2LIMB SIZE+4
8f5ca04b
RM
28
29#define res_ptr edi
30#define s1_ptr esi
6b628d36 31#define size ecx
f9e7bbce 32#define s2_limb ebx
8f5ca04b 33
ae828bc6 34 .text
2366713d 35ENTRY (__mpn_addmul_1)
43c81906 36
fee732e5 37 pushl %res_ptr
1ad9da69 38 cfi_adjust_cfa_offset (4)
fee732e5 39 pushl %s1_ptr
1ad9da69 40 cfi_adjust_cfa_offset (4)
43c81906 41 pushl %ebp
1ad9da69 42 cfi_adjust_cfa_offset (4)
fee732e5 43 pushl %s2_limb
1ad9da69 44 cfi_adjust_cfa_offset (4)
43c81906
GM
45
46 movl RES(%esp), %res_ptr
1ad9da69 47 cfi_rel_offset (res_ptr, 12)
43c81906 48 movl S1(%esp), %s1_ptr
1ad9da69 49 cfi_rel_offset (s1_ptr, 8)
43c81906
GM
50 movl SIZE(%esp), %size
51 movl S2LIMB(%esp), %s2_limb
1ad9da69 52 cfi_rel_offset (s2_limb, 0)
43c81906
GM
53 leal (%res_ptr,%size,4), %res_ptr
54 leal (%s1_ptr,%size,4), %s1_ptr
55 negl %size
f9e7bbce 56 xorl %ebp, %ebp
1ad9da69 57 cfi_rel_offset (ebp, 4)
8f5ca04b 58 ALIGN (3)
6b628d36 59
f9e7bbce 60L(oop): adcl $0, %ebp
43c81906
GM
61 movl (%s1_ptr,%size,4), %eax
62
63 mull %s2_limb
8f5ca04b 64
f9e7bbce
GM
65 addl %ebp, %eax
66 movl (%res_ptr,%size,4), %ebp
8f5ca04b 67
43c81906 68 adcl $0, %edx
f9e7bbce 69 addl %eax, %ebp
8f5ca04b 70
f9e7bbce 71 movl %ebp, (%res_ptr,%size,4)
43c81906 72 incl %size
8f5ca04b 73
f9e7bbce 74 movl %edx, %ebp
43c81906 75 jnz L(oop)
8f5ca04b 76
f9e7bbce
GM
77 adcl $0, %ebp
78 movl %ebp, %eax
fee732e5 79 popl %s2_limb
1ad9da69 80 cfi_adjust_cfa_offset (-4)
fee732e5 81 cfi_restore (s2_limb)
f9e7bbce 82 popl %ebp
1ad9da69
UD
83 cfi_adjust_cfa_offset (-4)
84 cfi_restore (ebp)
fee732e5 85 popl %s1_ptr
1ad9da69 86 cfi_adjust_cfa_offset (-4)
fee732e5
UD
87 cfi_restore (s1_ptr)
88 popl %res_ptr
1ad9da69 89 cfi_adjust_cfa_offset (-4)
fee732e5 90 cfi_restore (res_ptr)
8f5ca04b 91
8f5ca04b 92 ret
ae828bc6 93#undef size
2366713d 94END (__mpn_addmul_1)