aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S')
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S232
1 files changed, 116 insertions, 116 deletions
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S
index 55375c4..652b232 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S
@@ -1,116 +1,116 @@
1/* i80386 add_n -- Add two limb vectors of the same length > 0 and store 1/* i80386 add_n -- Add two limb vectors of the same length > 0 and store
2 * sum in a third limb vector. 2 * sum in a third limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1995, 1998, 4 * Copyright (C) 1992, 1994, 1995, 1998,
5 * 2001, 2002 Free Software Foundation, Inc. 5 * 2001, 2002 Free Software Foundation, Inc.
6 * 6 *
7 * This file is part of Libgcrypt. 7 * This file is part of Libgcrypt.
8 * 8 *
9 * Libgcrypt is free software; you can redistribute it and/or modify 9 * Libgcrypt is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as 10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation; either version 2.1 of 11 * published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version. 12 * the License, or (at your option) any later version.
13 * 13 *
14 * Libgcrypt is distributed in the hope that it will be useful, 14 * Libgcrypt is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details. 17 * GNU Lesser General Public License for more details.
18 * 18 *
19 * You should have received a copy of the GNU Lesser General Public 19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this program; if not, write to the Free Software 20 * License along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22 * 22 *
23 * Note: This code is heavily based on the GNU MP Library. 23 * Note: This code is heavily based on the GNU MP Library.
24 * Actually it's the same code with only minor changes in the 24 * Actually it's the same code with only minor changes in the
25 * way the data is stored; this is to support the abstraction 25 * way the data is stored; this is to support the abstraction
26 * of an optional secure memory allocation which may be used 26 * of an optional secure memory allocation which may be used
27 * to avoid revealing of sensitive data due to paging etc. 27 * to avoid revealing of sensitive data due to paging etc.
28 */ 28 */
29 29
30 30
31#include "sysdep.h" 31#include "sysdep.h"
32#include "asm-syntax.h" 32#include "asm-syntax.h"
33 33
34 34
35/******************* 35/*******************
36 * mpi_limb_t 36 * mpi_limb_t
37 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (sp + 4)
38 * mpi_ptr_t s1_ptr, (sp + 8) 38 * mpi_ptr_t s1_ptr, (sp + 8)
39 * mpi_ptr_t s2_ptr, (sp + 12) 39 * mpi_ptr_t s2_ptr, (sp + 12)
40 * mpi_size_t size) (sp + 16) 40 * mpi_size_t size) (sp + 16)
41 */ 41 */
42 42
43.text 43.text
44 ALIGN (3) 44 ALIGN (3)
45 .globl C_SYMBOL_NAME(_gcry_mpih_add_n) 45 .globl C_SYMBOL_NAME(_gcry_mpih_add_n)
46C_SYMBOL_NAME(_gcry_mpih_add_n:) 46C_SYMBOL_NAME(_gcry_mpih_add_n:)
47 pushl %edi 47 pushl %edi
48 pushl %esi 48 pushl %esi
49 49
50 movl 12(%esp),%edi /* res_ptr */ 50 movl 12(%esp),%edi /* res_ptr */
51 movl 16(%esp),%esi /* s1_ptr */ 51 movl 16(%esp),%esi /* s1_ptr */
52 movl 20(%esp),%edx /* s2_ptr */ 52 movl 20(%esp),%edx /* s2_ptr */
53 movl 24(%esp),%ecx /* size */ 53 movl 24(%esp),%ecx /* size */
54 54
55 movl %ecx,%eax 55 movl %ecx,%eax
56 shrl $3,%ecx /* compute count for unrolled loop */ 56 shrl $3,%ecx /* compute count for unrolled loop */
57 negl %eax 57 negl %eax
58 andl $7,%eax /* get index where to start loop */ 58 andl $7,%eax /* get index where to start loop */
59 jz Loop /* necessary special case for 0 */ 59 jz Loop /* necessary special case for 0 */
60 incl %ecx /* adjust loop count */ 60 incl %ecx /* adjust loop count */
61 shll $2,%eax /* adjustment for pointers... */ 61 shll $2,%eax /* adjustment for pointers... */
62 subl %eax,%edi /* ... since they are offset ... */ 62 subl %eax,%edi /* ... since they are offset ... */
63 subl %eax,%esi /* ... by a constant when we ... */ 63 subl %eax,%esi /* ... by a constant when we ... */
64 subl %eax,%edx /* ... enter the loop */ 64 subl %eax,%edx /* ... enter the loop */
65 shrl $2,%eax /* restore previous value */ 65 shrl $2,%eax /* restore previous value */
66#ifdef PIC 66#ifdef PIC
67/* Calculate start address in loop for PIC. Due to limitations in some 67/* Calculate start address in loop for PIC. Due to limitations in some
68 assemblers, Loop-L0-3 cannot be put into the leal */ 68 assemblers, Loop-L0-3 cannot be put into the leal */
69 call L0 69 call L0
70L0: leal (%eax,%eax,8),%eax 70L0: leal (%eax,%eax,8),%eax
71 addl (%esp),%eax 71 addl (%esp),%eax
72 addl $(Loop-L0-3),%eax 72 addl $(Loop-L0-3),%eax
73 addl $4,%esp 73 addl $4,%esp
74#else 74#else
75/* Calculate start address in loop for non-PIC. */ 75/* Calculate start address in loop for non-PIC. */
76 leal (Loop - 3)(%eax,%eax,8),%eax 76 leal (Loop - 3)(%eax,%eax,8),%eax
77#endif 77#endif
78 jmp *%eax /* jump into loop */ 78 jmp *%eax /* jump into loop */
79 ALIGN (3) 79 ALIGN (3)
80Loop: movl (%esi),%eax 80Loop: movl (%esi),%eax
81 adcl (%edx),%eax 81 adcl (%edx),%eax
82 movl %eax,(%edi) 82 movl %eax,(%edi)
83 movl 4(%esi),%eax 83 movl 4(%esi),%eax
84 adcl 4(%edx),%eax 84 adcl 4(%edx),%eax
85 movl %eax,4(%edi) 85 movl %eax,4(%edi)
86 movl 8(%esi),%eax 86 movl 8(%esi),%eax
87 adcl 8(%edx),%eax 87 adcl 8(%edx),%eax
88 movl %eax,8(%edi) 88 movl %eax,8(%edi)
89 movl 12(%esi),%eax 89 movl 12(%esi),%eax
90 adcl 12(%edx),%eax 90 adcl 12(%edx),%eax
91 movl %eax,12(%edi) 91 movl %eax,12(%edi)
92 movl 16(%esi),%eax 92 movl 16(%esi),%eax
93 adcl 16(%edx),%eax 93 adcl 16(%edx),%eax
94 movl %eax,16(%edi) 94 movl %eax,16(%edi)
95 movl 20(%esi),%eax 95 movl 20(%esi),%eax
96 adcl 20(%edx),%eax 96 adcl 20(%edx),%eax
97 movl %eax,20(%edi) 97 movl %eax,20(%edi)
98 movl 24(%esi),%eax 98 movl 24(%esi),%eax
99 adcl 24(%edx),%eax 99 adcl 24(%edx),%eax
100 movl %eax,24(%edi) 100 movl %eax,24(%edi)
101 movl 28(%esi),%eax 101 movl 28(%esi),%eax
102 adcl 28(%edx),%eax 102 adcl 28(%edx),%eax
103 movl %eax,28(%edi) 103 movl %eax,28(%edi)
104 leal 32(%edi),%edi 104 leal 32(%edi),%edi
105 leal 32(%esi),%esi 105 leal 32(%esi),%esi
106 leal 32(%edx),%edx 106 leal 32(%edx),%edx
107 decl %ecx 107 decl %ecx
108 jnz Loop 108 jnz Loop
109 109
110 sbbl %eax,%eax 110 sbbl %eax,%eax
111 negl %eax 111 negl %eax
112 112
113 popl %esi 113 popl %esi
114 popl %edi 114 popl %edi
115 ret 115 ret
116 116