]>
Commit | Line | Data |
---|---|---|
28f540f4 RM |
1 | /* i80386 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract |
2 | the result from a second limb vector. | |
6d7e8eda | 3 | Copyright (C) 1992-2023 Free Software Foundation, Inc. |
5929563f | 4 | This file is part of the GNU MP Library. |
28f540f4 | 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. |
28f540f4 | 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. |
28f540f4 | 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/>. */ |
28f540f4 | 19 | |
28f540f4 RM |
20 | #include "sysdep.h" |
21 | #include "asm-syntax.h" | |
3f02f778 | 22 | |
2366713d | 23 | #define PARMS 4+16 /* space for 4 saved regs */ |
3f02f778 | 24 | #define RES PARMS |
2366713d JM |
25 | #define S1 RES+4 |
26 | #define SIZE S1+4 | |
3f02f778 | 27 | #define S2LIMB SIZE+4 |
28f540f4 RM |
28 | |
29 | #define res_ptr edi | |
30 | #define s1_ptr esi | |
ce37fa88 | 31 | #define sizeP ecx |
f9e7bbce | 32 | #define s2_limb ebx |
28f540f4 | 33 | |
ae828bc6 | 34 | .text |
2366713d | 35 | ENTRY (__mpn_submul_1) |
28f540f4 | 36 | |
43c81906 | 37 | pushl %edi |
1ad9da69 | 38 | cfi_adjust_cfa_offset (4) |
43c81906 | 39 | pushl %esi |
1ad9da69 | 40 | cfi_adjust_cfa_offset (4) |
43c81906 | 41 | pushl %ebp |
1ad9da69 | 42 | cfi_adjust_cfa_offset (4) |
f9e7bbce | 43 | pushl %ebx |
1ad9da69 | 44 | cfi_adjust_cfa_offset (4) |
fee732e5 UD |
45 | cfi_rel_offset (edi, 12) |
46 | cfi_rel_offset (esi, 8) | |
47 | cfi_rel_offset (ebp, 4) | |
48 | cfi_rel_offset (ebx, 0) | |
28f540f4 | 49 | |
43c81906 GM |
50 | movl RES(%esp), %res_ptr |
51 | movl S1(%esp), %s1_ptr | |
52 | movl SIZE(%esp), %sizeP | |
53 | movl S2LIMB(%esp), %s2_limb | |
43c81906 GM |
54 | leal (%res_ptr,%sizeP,4), %res_ptr |
55 | leal (%s1_ptr,%sizeP,4), %s1_ptr | |
56 | negl %sizeP | |
f9e7bbce | 57 | xorl %ebp, %ebp |
28f540f4 | 58 | ALIGN (3) |
5929563f | 59 | L(oop): |
43c81906 GM |
60 | movl (%s1_ptr,%sizeP,4), %eax |
61 | mull %s2_limb | |
f9e7bbce | 62 | addl %ebp, %eax |
43c81906 GM |
63 | adcl $0, %edx |
64 | subl %eax, (%res_ptr,%sizeP,4) | |
65 | adcl $0, %edx | |
f9e7bbce | 66 | movl %edx, %ebp |
28f540f4 | 67 | |
43c81906 GM |
68 | incl %sizeP |
69 | jnz L(oop) | |
f9e7bbce | 70 | movl %ebp, %eax |
28f540f4 | 71 | |
43c81906 | 72 | popl %ebx |
1ad9da69 UD |
73 | cfi_adjust_cfa_offset (-4) |
74 | cfi_restore (ebx) | |
f9e7bbce | 75 | popl %ebp |
1ad9da69 UD |
76 | cfi_adjust_cfa_offset (-4) |
77 | cfi_restore (ebp) | |
43c81906 | 78 | popl %esi |
1ad9da69 UD |
79 | cfi_adjust_cfa_offset (-4) |
80 | cfi_restore (esi) | |
43c81906 | 81 | popl %edi |
1ad9da69 UD |
82 | cfi_adjust_cfa_offset (-4) |
83 | cfi_restore (edi) | |
3f02f778 | 84 | |
28f540f4 | 85 | ret |
2366713d | 86 | END (__mpn_submul_1) |