aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/libgcrypt/libgcrypt-1.2.2/mpi')
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/ChangeLog1210
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.am382
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.in1314
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Manifest82
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/README106
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/distfiles22
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-add1.S248
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-lshift.S244
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul1.S180
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul2.S194
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul3.S190
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-rshift.S236
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-sub1.S248
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/udiv-qrnnd.S318
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/config.links700
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/Manifest58
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/distfiles22
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpi-asm-defs.h20
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-add1.c130
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-lshift.c136
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul1.c124
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul2.c136
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul3.c136
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-rshift.c134
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-sub1.c132
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/udiv-w-sdiv.c266
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/README168
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/distfiles14
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-add1.S140
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-lshift.S154
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-rshift.S146
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-sub1.S156
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/udiv-qrnnd.S594
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/distfiles10
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul1.S226
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul2.S230
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul3.S250
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/udiv-qrnnd.S180
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/Manifest56
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/distfiles20
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-add1.S232
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-lshift.S188
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul1.S168
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul2.S172
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul3.S172
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-rshift.S194
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-sub1.S234
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/syntax.h136
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/Manifest54
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/README52
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/distfiles20
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-add1.S270
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-lshift.S458
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul1.S178
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul2.S186
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul3.S186
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-rshift.S456
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-sub1.S284
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/longlong.h3122
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/Manifest50
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/distfiles18
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/Manifest46
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/distfiles8
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul1.S208
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul2.S188
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul3.S194
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-add1.S184
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-lshift.S328
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-rshift.S324
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-sub1.S182
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/syntax.h370
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/Manifest56
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/README46
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/distfiles22
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpi-asm-defs.h20
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-add1.S248
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-lshift.S194
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul1.S178
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul2.S202
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul3.S202
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-rshift.S190
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-sub1.S250
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-add.c472
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-bit.c514
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-cmp.c148
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-div.c728
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-gcd.c108
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.c72
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.h308
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-internal.h550
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inv.c550
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mpow.c448
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mul.c440
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-pow.c604
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-scan.c264
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpicoder.c1300
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-div.c1070
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-mul.c1060
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpiutil.c856
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/Manifest44
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/distfiles8
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-lshift.S192
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-rshift.S184
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest54
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/distfiles16
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-add1.S174
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-lshift.S128
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul1.S230
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul2.S260
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul3.S270
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-rshift.S128
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-sub1.S176
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/Manifest56
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/distfiles20
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-add1.S272
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-lshift.S396
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul1.S240
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul2.S254
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul3.S260
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-rshift.S262
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S266
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/syntax.h150
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc64/distfiles0
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/Manifest48
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/distfiles12
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-add1.S478
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-lshift.S194
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-rshift.S186
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S390
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/Manifest46
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/distfiles10
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul1.S218
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul2.S264
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul3.S134
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/Manifest42
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/distfiles6
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/udiv.S236
137 files changed, 17789 insertions, 17789 deletions
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/ChangeLog b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/ChangeLog
index 2e43f32..2ee4981 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/ChangeLog
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/ChangeLog
@@ -1,605 +1,605 @@
12005-09-14 Werner Koch <wk@g10code.com> 12005-09-14 Werner Koch <wk@g10code.com>
2 2
3 * Makefile.am (AM_CCASFLAGS): Add AM_CCASFLAGS. 3 * Makefile.am (AM_CCASFLAGS): Add AM_CCASFLAGS.
4 4
52005-06-16 Werner Koch <wk@g10code.com> 52005-06-16 Werner Koch <wk@g10code.com>
6 6
7 * mpiutil.c (gcry_mpi_randomize): Made P unsigned. 7 * mpiutil.c (gcry_mpi_randomize): Made P unsigned.
8 * mpicoder.c (gcry_mpi_scan): Changed arg BUFFER to void*. 8 * mpicoder.c (gcry_mpi_scan): Changed arg BUFFER to void*.
9 (mpi_read_from_buffer): Made BUFFER arg const. 9 (mpi_read_from_buffer): Made BUFFER arg const.
10 (gcry_mpi_scan): Removed now needless cast. Add cast for arg to 10 (gcry_mpi_scan): Removed now needless cast. Add cast for arg to
11 mpi_fromstr. 11 mpi_fromstr.
12 (gcry_mpi_print): Made TMP unsigned. 12 (gcry_mpi_print): Made TMP unsigned.
13 13
142005-05-29 Moritz Schulte <moritz@g10code.com> 142005-05-29 Moritz Schulte <moritz@g10code.com>
15 15
16 * mpiutil.c (gcry_mpi_randomize): Store random data in secure 16 * mpiutil.c (gcry_mpi_randomize): Store random data in secure
17 memory if the given MPI is secure - not the other way around (argl). 17 memory if the given MPI is secure - not the other way around (argl).
18 18
192005-02-16 Moritz Schulte <moritz@g10code.com> 192005-02-16 Moritz Schulte <moritz@g10code.com>
20 20
21 * mpiutil.c (_gcry_mpi_alloc_limb_space): Rewritten, fixed memory 21 * mpiutil.c (_gcry_mpi_alloc_limb_space): Rewritten, fixed memory
22 corruption. 22 corruption.
23 23
242005-01-05 Werner Koch <wk@g10code.com> 242005-01-05 Werner Koch <wk@g10code.com>
25 25
26 * hppa1.1/udiv-qrnnd.S: Reverted change of 2004-03-02 but kept the 26 * hppa1.1/udiv-qrnnd.S: Reverted change of 2004-03-02 but kept the
27 .align directive. 27 .align directive.
28 28
292004-12-16 Werner Koch <wk@g10code.com> 292004-12-16 Werner Koch <wk@g10code.com>
30 30
31 * config.links (mpi_optional_modules): Move entry for powerpc64 31 * config.links (mpi_optional_modules): Move entry for powerpc64
32 before generic powerpc. Suggested by Rafael Ávila de Espíndola. 32 before generic powerpc. Suggested by Rafael Ávila de Espíndola.
33 33
342004-03-02 Werner Koch <wk@gnupg.org> 342004-03-02 Werner Koch <wk@gnupg.org>
35 35
36 * hppa1.1/udiv-qrnnd.S: Alignment fix from Lamont Jones for 36 * hppa1.1/udiv-qrnnd.S: Alignment fix from Lamont Jones for
37 Debian. Taken from gnupg-1.3. 37 Debian. Taken from gnupg-1.3.
38 38
39 * longlong.h: Added PowerPC 64 bit code from GPM-4.1.2 but didn't 39 * longlong.h: Added PowerPC 64 bit code from GPM-4.1.2 but didn't
40 enable it yet. Some whitespace changes in HPPA to fix assembler 40 enable it yet. Some whitespace changes in HPPA to fix assembler
41 problems on HP-UX. From gnupg 1.3 41 problems on HP-UX. From gnupg 1.3
42 42
43 * mpiutil.c (_gcry_mpi_alloc_limb_space): Better allocate 43 * mpiutil.c (_gcry_mpi_alloc_limb_space): Better allocate
44 something even if NLIMBS is passed as 0. 44 something even if NLIMBS is passed as 0.
45 45
46 * config.links: Updated system list to match gnupg 1.3. 46 * config.links: Updated system list to match gnupg 1.3.
47 47
482003-12-19 Werner Koch <wk@gnupg.org> 482003-12-19 Werner Koch <wk@gnupg.org>
49 49
50 * mpi-internal.h [M_DEBUG]: Removed this unused code. 50 * mpi-internal.h [M_DEBUG]: Removed this unused code.
51 (struct karatsuba_ctx): Added TSPACE_NLIMBS and TP_NLIMBS. 51 (struct karatsuba_ctx): Added TSPACE_NLIMBS and TP_NLIMBS.
52 * mpiutil.c (_gcry_mpi_free_limb_space): Add arg NLIMBS and wipe 52 * mpiutil.c (_gcry_mpi_free_limb_space): Add arg NLIMBS and wipe
53 out the memory. Changed all callers. 53 out the memory. Changed all callers.
54 * mpih-mul.c (_gcry_mpih_mul_karatsuba_case): Keep track of 54 * mpih-mul.c (_gcry_mpih_mul_karatsuba_case): Keep track of
55 allocated limbs. 55 allocated limbs.
56 * mpi-div.c (_gcry_mpi_tdiv_qr): Keep track of allocated limbs. 56 * mpi-div.c (_gcry_mpi_tdiv_qr): Keep track of allocated limbs.
57 * mpi-mul.c (gcry_mpi_mul): Ditto. 57 * mpi-mul.c (gcry_mpi_mul): Ditto.
58 * mpi-pow.c (gcry_mpi_powm): Ditto. 58 * mpi-pow.c (gcry_mpi_powm): Ditto.
59 59
60 * Manifest: Empty new file. Also add Manifest files to all CPU 60 * Manifest: Empty new file. Also add Manifest files to all CPU
61 specific directories. 61 specific directories.
62 * Makefile.am: Added. 62 * Makefile.am: Added.
63 63
64 * mpiutil.c (gcry_mpi_randomize): Use gcry_create_nonce if WEAK 64 * mpiutil.c (gcry_mpi_randomize): Use gcry_create_nonce if WEAK
65 random has been requested. 65 random has been requested.
66 66
672003-10-31 Werner Koch <wk@gnupg.org> 672003-10-31 Werner Koch <wk@gnupg.org>
68 68
69 * i386/mpih-rshift.S, i386/mpih-lshift.S: Use %dl and not %edx for 69 * i386/mpih-rshift.S, i386/mpih-lshift.S: Use %dl and not %edx for
70 testb; this avoids an assembler warning. 70 testb; this avoids an assembler warning.
71 71
72 * mpi-pow.c (gcry_mpi_powm): s/exp/expo/ to avoid shadowing warning. 72 * mpi-pow.c (gcry_mpi_powm): s/exp/expo/ to avoid shadowing warning.
73 73
742003-08-19 Marcus Brinkmann <marcus@g10code.de> 742003-08-19 Marcus Brinkmann <marcus@g10code.de>
75 75
76 * Makefile.am (SUFFIXES): New variable. 76 * Makefile.am (SUFFIXES): New variable.
77 (.S.o, .S.lo, .S.obj): Rewritten. 77 (.S.o, .S.lo, .S.obj): Rewritten.
78 78
792003-07-30 Moritz Schulte <moritz@g10code.com> 792003-07-30 Moritz Schulte <moritz@g10code.com>
80 80
81 * longlong.h (__clz_tab): Renamed to _gcry_clz_tab. 81 * longlong.h (__clz_tab): Renamed to _gcry_clz_tab.
82 * mpi-bit.c (__clz_tab): Likewise. 82 * mpi-bit.c (__clz_tab): Likewise.
83 83
842003-07-27 Werner Koch <wk@gnupg.org> 842003-07-27 Werner Koch <wk@gnupg.org>
85 85
86 * mpicoder.c (gcry_mpi_scan): New argument BUFLEN to replace the 86 * mpicoder.c (gcry_mpi_scan): New argument BUFLEN to replace the
87 use of the intial value of NBYTES. Changed BUFFER to unsigned. 87 use of the intial value of NBYTES. Changed BUFFER to unsigned.
88 (gcry_mpi_print): Likewise. 88 (gcry_mpi_print): Likewise.
89 (gcry_mpi_dump): New. 89 (gcry_mpi_dump): New.
90 (_gcry_log_mpidump): Make use of gcry_mpi_dump. 90 (_gcry_log_mpidump): Make use of gcry_mpi_dump.
91 (mpi_print): Removed. 91 (mpi_print): Removed.
92 (gcry_mpi_scan): Allocated mpi in secure memory when required. 92 (gcry_mpi_scan): Allocated mpi in secure memory when required.
93 (gcry_mpi_aprint): Changed BUFFER to unsigned char*. 93 (gcry_mpi_aprint): Changed BUFFER to unsigned char*.
94 94
952003-07-14 Moritz Schulte <moritz@g10code.com> 952003-07-14 Moritz Schulte <moritz@g10code.com>
96 96
97 * mpicoder.c: Used gcry_err* wrappers for libgpg-error symbols. 97 * mpicoder.c: Used gcry_err* wrappers for libgpg-error symbols.
98 98
992003-06-16 Moritz Schulte <moritz@g10code.com> 992003-06-16 Moritz Schulte <moritz@g10code.com>
100 100
101 * mpi-add.c: Replace last occurences of old type names with newer 101 * mpi-add.c: Replace last occurences of old type names with newer
102 names (i.e. replace MPI with gcry_mpi_t). 102 names (i.e. replace MPI with gcry_mpi_t).
103 * mpi-bit.c: Likewise. 103 * mpi-bit.c: Likewise.
104 * mpi-cmp.c: Likewise. 104 * mpi-cmp.c: Likewise.
105 * mpi-div.c: Likewise. 105 * mpi-div.c: Likewise.
106 * mpi-gcd.c: Likewise. 106 * mpi-gcd.c: Likewise.
107 * mpi-internal.h: Likewise. 107 * mpi-internal.h: Likewise.
108 * mpi-inv.c: Likewise. 108 * mpi-inv.c: Likewise.
109 * mpi-mpow.c: Likewise. 109 * mpi-mpow.c: Likewise.
110 * mpi-mul.c: Likewise. 110 * mpi-mul.c: Likewise.
111 * mpi-pow.c: Likewise. 111 * mpi-pow.c: Likewise.
112 * mpi-scan.c: Likewise. 112 * mpi-scan.c: Likewise.
113 * mpicoder.c: Likewise. 113 * mpicoder.c: Likewise.
114 * mpiutil.c: Likewise. 114 * mpiutil.c: Likewise.
115 115
1162003-06-09 Moritz Schulte <moritz@g10code.com> 1162003-06-09 Moritz Schulte <moritz@g10code.com>
117 117
118 * mpicoder.c (gcry_mpi_scan): Adjust for libgpg-error. 118 * mpicoder.c (gcry_mpi_scan): Adjust for libgpg-error.
119 (gcry_mpi_print): Likewise. 119 (gcry_mpi_print): Likewise.
120 (gcry_mpi_aprint): Likewise. 120 (gcry_mpi_aprint): Likewise.
121 121
1222003-06-07 Moritz Schulte <moritz@g10code.com> 1222003-06-07 Moritz Schulte <moritz@g10code.com>
123 123
124 * longlong.h, mpi-add.c, mpi-bit.c, mpi-cmp.c, mpi-div.c, 124 * longlong.h, mpi-add.c, mpi-bit.c, mpi-cmp.c, mpi-div.c,
125 mpi-gcd.c, mpi-inline.c, mpi-inline.h, mpi-internal.h, mpi-inv.c, 125 mpi-gcd.c, mpi-inline.c, mpi-inline.h, mpi-internal.h, mpi-inv.c,
126 mpi-mpow.c, mpi-mul.c, mpi-pow.c, mpi-scan.c, mpicoder.c, 126 mpi-mpow.c, mpi-mul.c, mpi-pow.c, mpi-scan.c, mpicoder.c,
127 mpih-div.c, mpih-mul.c, mpiutil.c, generic/mpi-asm-defs.h, 127 mpih-div.c, mpih-mul.c, mpiutil.c, generic/mpi-asm-defs.h,
128 generic/mpih-add1.c, generic/mpih-lshift.c, generic/mpih-mul1.c, 128 generic/mpih-add1.c, generic/mpih-lshift.c, generic/mpih-mul1.c,
129 generic/mpih-mul2.c, generic/mpih-mul3.c, generic/mpih-rshift.c, 129 generic/mpih-mul2.c, generic/mpih-mul3.c, generic/mpih-rshift.c,
130 generic/mpih-sub1.c, generic/udiv-w-sdiv.c, i386/syntax.h, 130 generic/mpih-sub1.c, generic/udiv-w-sdiv.c, i386/syntax.h,
131 m68k/syntax.h, mips3/mpi-asm-defs.h, powerpc32/syntax.h: Edited 131 m68k/syntax.h, mips3/mpi-asm-defs.h, powerpc32/syntax.h: Edited
132 all preprocessor instructions to remove whitespace before the '#'. 132 all preprocessor instructions to remove whitespace before the '#'.
133 This is not required by C89, but there are some compilers out 133 This is not required by C89, but there are some compilers out
134 there that don't like it. Replaced any occurence of the now 134 there that don't like it. Replaced any occurence of the now
135 deprecated type names with the new ones. 135 deprecated type names with the new ones.
136 136
1372003-05-21 Moritz Schulte <moritz@g10code.com> 1372003-05-21 Moritz Schulte <moritz@g10code.com>
138 138
139 * mpiutil.c (_gcry_mpi_alloc_limb_space): Only try to allocate 139 * mpiutil.c (_gcry_mpi_alloc_limb_space): Only try to allocate
140 memory in case the amount of bytes to allocate is non-zero. 140 memory in case the amount of bytes to allocate is non-zero.
141 141
1422003-04-27 Moritz Schulte <moritz@g10code.com> 1422003-04-27 Moritz Schulte <moritz@g10code.com>
143 143
144 * mpiutil.c (_gcry_mpi_resize): Allocate secure memory, in case 144 * mpiutil.c (_gcry_mpi_resize): Allocate secure memory, in case
145 bit zero of `flags' is set. 145 bit zero of `flags' is set.
146 146
147 * mpi-add.c (gcry_mpi_sub): Simplify function; always use a 147 * mpi-add.c (gcry_mpi_sub): Simplify function; always use a
148 temporary variable now. 148 temporary variable now.
149 149
1502003-04-15 Werner Koch <wk@gnupg.org> 1502003-04-15 Werner Koch <wk@gnupg.org>
151 151
152 * longlong.h (umul_ppmm): Support SH3 and SH4. Thanks to 152 * longlong.h (umul_ppmm): Support SH3 and SH4. Thanks to
153 kazuya.s@jp.yokogawa.com. 153 kazuya.s@jp.yokogawa.com.
154 154
1552003-04-02 Werner Koch <wk@gnupg.org> 1552003-04-02 Werner Koch <wk@gnupg.org>
156 156
157 * mpicoder.c (gcry_mpi_print): Fixed testing against possible 157 * mpicoder.c (gcry_mpi_print): Fixed testing against possible
158 uninitialized LEN. Valgrinded by Nikos Mavroyanopoulos. 158 uninitialized LEN. Valgrinded by Nikos Mavroyanopoulos.
159 159
1602003-01-15 Werner Koch <wk@gnupg.org> 1602003-01-15 Werner Koch <wk@gnupg.org>
161 161
162 * longlong.h: Removed some spaces between backslashes and newlines. 162 * longlong.h: Removed some spaces between backslashes and newlines.
163 163
1642002-09-20 Werner Koch <wk@gnupg.org> 1642002-09-20 Werner Koch <wk@gnupg.org>
165 165
166 * mpi-mul.c (gcry_mpi_mul_2exp): New. This was declared in 166 * mpi-mul.c (gcry_mpi_mul_2exp): New. This was declared in
167 gcrypt.h but only implemented as internal function. Noted by Timo 167 gcrypt.h but only implemented as internal function. Noted by Timo
168 but a few minutes to late for today's release. 168 but a few minutes to late for today's release.
169 169
170 * Makefile.am (DISTCLEANFILES): Include mpi-asm-defs.h 170 * Makefile.am (DISTCLEANFILES): Include mpi-asm-defs.h
171 171
1722002-09-18 Werner Koch <wk@gnupg.org> 1722002-09-18 Werner Koch <wk@gnupg.org>
173 173
174 * Makefile.am (.S.lo): Pass -DPIC. i386, PPC and Sparc code 174 * Makefile.am (.S.lo): Pass -DPIC. i386, PPC and Sparc code
175 require it. It worked for me because I am using the i586 code. 175 require it. It worked for me because I am using the i586 code.
176 176
1772002-08-23 Werner Koch <wk@gnupg.org> 1772002-08-23 Werner Koch <wk@gnupg.org>
178 178
179 * Makefile.am (.S.lo): Fixed for libtool build with --disable-shared. 179 * Makefile.am (.S.lo): Fixed for libtool build with --disable-shared.
180 180
1812002-07-24 Werner Koch <wk@gnupg.org> 1812002-07-24 Werner Koch <wk@gnupg.org>
182 182
183 * longlong.h: Replaced all K&R multiline strings by ISO ones for 183 * longlong.h: Replaced all K&R multiline strings by ISO ones for
184 the sake of modern compilers. Suggested by Marco Parrone. 184 the sake of modern compilers. Suggested by Marco Parrone.
185 185
1862002-06-24 Werner Koch <wk@gnupg.org> 1862002-06-24 Werner Koch <wk@gnupg.org>
187 187
188 * mpiutil.c (gcry_mpi_swap): New. 188 * mpiutil.c (gcry_mpi_swap): New.
189 189
190 * mpi-div.c (gcry_mpi_div): New. 190 * mpi-div.c (gcry_mpi_div): New.
191 (gcry_mpi_mod): New. 191 (gcry_mpi_mod): New.
192 * mpi-inv.c (gcry_mpi_invm): New. 192 * mpi-inv.c (gcry_mpi_invm): New.
193 193
194 * mpicoder.c (do_get_buffer): Make sure that we allocate at least 194 * mpicoder.c (do_get_buffer): Make sure that we allocate at least
195 one byte. 195 one byte.
196 196
1972002-06-12 Werner Koch <wk@gnupg.org> 1972002-06-12 Werner Koch <wk@gnupg.org>
198 198
199 * hppa1.1/udiv-qrnnd.S: Changes for PIC by Randolph Chung. 199 * hppa1.1/udiv-qrnnd.S: Changes for PIC by Randolph Chung.
200 200
2012002-05-15 Werner Koch <wk@gnupg.org> 2012002-05-15 Werner Koch <wk@gnupg.org>
202 202
203 * config.links: Chnage the way the mpi modules are determined. 203 * config.links: Chnage the way the mpi modules are determined.
204 * Makefile.am: Revamped to better handle modules 204 * Makefile.am: Revamped to better handle modules
205 205
2062002-05-14 Werner Koch <wk@gnupg.org> 2062002-05-14 Werner Koch <wk@gnupg.org>
207 207
208 Changed license of all files to the LGPL. 208 Changed license of all files to the LGPL.
209 209
2102002-04-18 Werner Koch <wk@gnupg.org> 2102002-04-18 Werner Koch <wk@gnupg.org>
211 211
212 * mpicoder.c (gcry_mpi_scan): Don't use normalize on a NULL MPI. 212 * mpicoder.c (gcry_mpi_scan): Don't use normalize on a NULL MPI.
213 213
2142002-03-20 Werner Koch <wk@gnupg.org> 2142002-03-20 Werner Koch <wk@gnupg.org>
215 215
216 * mpicoder.c (mpi_read_from_buffer): Bail out on a zero length 216 * mpicoder.c (mpi_read_from_buffer): Bail out on a zero length
217 buffer because we can't eventually do an malloc of this size. 217 buffer because we can't eventually do an malloc of this size.
218 Reported by Timo. 218 Reported by Timo.
219 219
2202002-01-14 Werner Koch <wk@gnupg.org> 2202002-01-14 Werner Koch <wk@gnupg.org>
221 221
222 * mpi-inv.c (_gcry_mpi_invm): Typo fixes, noted by Carlo Perassi. 222 * mpi-inv.c (_gcry_mpi_invm): Typo fixes, noted by Carlo Perassi.
223 223
2242001-11-01 Werner Koch <wk@gnupg.org> 2242001-11-01 Werner Koch <wk@gnupg.org>
225 225
226 * mpicoder.c (gcry_mpi_scan): Allow to pass a nbytes as NULL or 226 * mpicoder.c (gcry_mpi_scan): Allow to pass a nbytes as NULL or
227 with value 0 for format GCRY_FMT_SSH, so that the length is not 227 with value 0 for format GCRY_FMT_SSH, so that the length is not
228 used for any checks, only the length stored in the bufer is used. 228 used for any checks, only the length stored in the bufer is used.
229 This is a nice format becuase we can just pass a buffer around and 229 This is a nice format becuase we can just pass a buffer around and
230 don't need to care about its length. 230 don't need to care about its length.
231 231
2322001-08-03 Werner Koch <wk@gnupg.org> 2322001-08-03 Werner Koch <wk@gnupg.org>
233 233
234 * config.links: Changed the way the list of files to be 234 * config.links: Changed the way the list of files to be
235 symlinked is returned. 235 symlinked is returned.
236 236
2372001-05-31 Werner Koch <wk@gnupg.org> 2372001-05-31 Werner Koch <wk@gnupg.org>
238 238
239 * mpih-cmp.c: Removed and moved mpihelp_cmp to .. 239 * mpih-cmp.c: Removed and moved mpihelp_cmp to ..
240 * mpi-inline.h: .. here. 240 * mpi-inline.h: .. here.
241 241
242 Major function renaming. All global functions are now prefixed 242 Major function renaming. All global functions are now prefixed
243 with _gcry_ or gcry_. Renamed also all mpihelp_ to just mpih_ so 243 with _gcry_ or gcry_. Renamed also all mpihelp_ to just mpih_ so
244 that functions names are not getting to long an unreadable and for 244 that functions names are not getting to long an unreadable and for
245 better matching with the filenames. 245 better matching with the filenames.
246 246
2472001-05-28 Werner Koch <wk@gnupg.org> 2472001-05-28 Werner Koch <wk@gnupg.org>
248 248
249 * mpicoder.c (mpi_fromstr): Made static and assume that all input 249 * mpicoder.c (mpi_fromstr): Made static and assume that all input
250 is in hexformat. 250 is in hexformat.
251 251
252 Updated all CPU specific code with the one from GnuPG-1.0.5. This 252 Updated all CPU specific code with the one from GnuPG-1.0.5. This
253 is just a change of text formatting and the use of .label 253 is just a change of text formatting and the use of .label
254 instead of labels for hppa and pa7100. 254 instead of labels for hppa and pa7100.
255 255
256 * longlong.h: Fixes for ARM by Phil Blundell. 256 * longlong.h: Fixes for ARM by Phil Blundell.
257 257
2582001-03-29 Werner Koch <wk@gnupg.org> 2582001-03-29 Werner Koch <wk@gnupg.org>
259 259
260 * mpi-mul.c (mpi_mul): Make sure that secret temporary results are 260 * mpi-mul.c (mpi_mul): Make sure that secret temporary results are
261 not stored in w. Suggested by Florian Weimer. 261 not stored in w. Suggested by Florian Weimer.
262 262
263 * config.links: Use i386 code for i386. According to tests by 263 * config.links: Use i386 code for i386. According to tests by
264 Kevin Ryde the i586 code runs slow on i386 CPUs. Ditto for i786. 264 Kevin Ryde the i586 code runs slow on i386 CPUs. Ditto for i786.
265 265
2662001-01-11 Werner Koch <wk@gnupg.org> 2662001-01-11 Werner Koch <wk@gnupg.org>
267 267
268 * Makefile.am: Removed mpi.h. 268 * Makefile.am: Removed mpi.h.
269 269
2702000-12-19 Werner Koch <wk@gnupg.org> 2702000-12-19 Werner Koch <wk@gnupg.org>
271 271
272 * mpi-internal.h: Put limb_t definition in an ifdef. 272 * mpi-internal.h: Put limb_t definition in an ifdef.
273 273
274 Major change: 274 Major change:
275 Removed all GnuPG stuff and renamed this piece of software 275 Removed all GnuPG stuff and renamed this piece of software
276 to gcrypt. 276 to gcrypt.
277 277
2782000-11-14 Werner Koch <wk@gnupg.org> 2782000-11-14 Werner Koch <wk@gnupg.org>
279 279
280 * mpi-internal.h, mpi.h: Changed the way they are called and 280 * mpi-internal.h, mpi.h: Changed the way they are called and
281 introduced DID_MPI_LIMP_TYPEDEF hack. Very ugly, should all be 281 introduced DID_MPI_LIMP_TYPEDEF hack. Very ugly, should all be
282 revamped. 282 revamped.
283 283
284 * Makefile.am (OMIT_DEPENDENCIES): Hack to work around dependency 284 * Makefile.am (OMIT_DEPENDENCIES): Hack to work around dependency
285 problems. 285 problems.
286 286
2872000-10-11 Werner Koch <wk@gnupg.org> 2872000-10-11 Werner Koch <wk@gnupg.org>
288 288
289 * generic/mpi-asm-defs.h: New. 289 * generic/mpi-asm-defs.h: New.
290 * mips3/mpi-asm-defs.h: New. 290 * mips3/mpi-asm-defs.h: New.
291 * config.links: Create a link to one of the above files. 291 * config.links: Create a link to one of the above files.
292 292
293Fri Jul 28 18:19:11 CEST 2000 Werner Koch <wk@openit.de> 293Fri Jul 28 18:19:11 CEST 2000 Werner Koch <wk@openit.de>
294 294
295 * mpicoder.c (gcry_mpi_scan): Normalize the returned MPI. 295 * mpicoder.c (gcry_mpi_scan): Normalize the returned MPI.
296 296
297Tue Jul 25 17:44:15 CEST 2000 Werner Koch <wk@openit.de> 297Tue Jul 25 17:44:15 CEST 2000 Werner Koch <wk@openit.de>
298 298
299 * config.links: Support for powerpc--netbsd by Gabriel Rosenkoetter. 299 * config.links: Support for powerpc--netbsd by Gabriel Rosenkoetter.
300 300
301Mon Jul 17 16:35:47 CEST 2000 Werner Koch <wk@> 301Mon Jul 17 16:35:47 CEST 2000 Werner Koch <wk@>
302 302
303 * power/: Add all files from GMP for this CPU. Converted comments to 303 * power/: Add all files from GMP for this CPU. Converted comments to
304 CPP comments because some ASes complain about ' in comments. 304 CPP comments because some ASes complain about ' in comments.
305 305
306 * config.links: Support for BSDI 4.x; by Wayne Chapeskie. Add support 306 * config.links: Support for BSDI 4.x; by Wayne Chapeskie. Add support
307 for FreeBSD 5 and made the case stmt looking nicer; by Jun Kuriyama. 307 for FreeBSD 5 and made the case stmt looking nicer; by Jun Kuriyama.
308 Add support for NetBSD. 308 Add support for NetBSD.
309 (sparc8): Made the search path the same as sparc9 309 (sparc8): Made the search path the same as sparc9
310 (sparc64-unknown-linux-gnu): use udiv module; by Adam Mitchell. 310 (sparc64-unknown-linux-gnu): use udiv module; by Adam Mitchell.
311 311
312 * Makefile.am: c/SFLAGS/ASFLAGS/. This has only been used by the 312 * Makefile.am: c/SFLAGS/ASFLAGS/. This has only been used by the
313 powerpc and actually never passed the -Wa,foo to the cc. 313 powerpc and actually never passed the -Wa,foo to the cc.
314 314
315 * mpih-div.c (mpihelp_divrem): The MPN_COPY_DECR copied one element 315 * mpih-div.c (mpihelp_divrem): The MPN_COPY_DECR copied one element
316 too many. This is a gmp2.0.2p9.txt patch. 316 too many. This is a gmp2.0.2p9.txt patch.
317 317
318 * longlong.h (umul_ppmm): Fixes for ARM-4. By Sean MacLennan. 318 * longlong.h (umul_ppmm): Fixes for ARM-4. By Sean MacLennan.
319 319
320 * mpi-internal.h (karatsuba_ctx): New. 320 * mpi-internal.h (karatsuba_ctx): New.
321 * mpih-mul.c (mpihelp_release_karatsuba_ctx): New. 321 * mpih-mul.c (mpihelp_release_karatsuba_ctx): New.
322 (mpihelp_mul_karatsuba_case): New. 322 (mpihelp_mul_karatsuba_case): New.
323 (mpihelp_mul): Splitted to make use of the new functions. 323 (mpihelp_mul): Splitted to make use of the new functions.
324 * mpi-pow.c (mpi_powm): Make use of the new splitted function to avoid 324 * mpi-pow.c (mpi_powm): Make use of the new splitted function to avoid
325 multiple allocation of temporary memory during the karatsuba operations. 325 multiple allocation of temporary memory during the karatsuba operations.
326 * mpi_mpow.c: Removed the unused Barrett code. 326 * mpi_mpow.c: Removed the unused Barrett code.
327 327
3282000-03-21 16:17:30 Werner Koch (wk@habibti.openit.de) 3282000-03-21 16:17:30 Werner Koch (wk@habibti.openit.de)
329 329
330 * config.links: Add support for FreeBSD 5. 330 * config.links: Add support for FreeBSD 5.
331 331
332Mon Jan 24 22:24:38 CET 2000 Werner Koch <wk@gnupg.de> 332Mon Jan 24 22:24:38 CET 2000 Werner Koch <wk@gnupg.de>
333 333
334 * mpicoder.c (gcry_mpi_aprint): Now really returns the length. 334 * mpicoder.c (gcry_mpi_aprint): Now really returns the length.
335 335
336Mon Jan 24 13:04:28 CET 2000 Werner Koch <wk@gnupg.de> 336Mon Jan 24 13:04:28 CET 2000 Werner Koch <wk@gnupg.de>
337 337
338 * mpiutil.c: Removed all memory debugging code. 338 * mpiutil.c: Removed all memory debugging code.
339 339
340 * mpicoder.c (gcry_mpi_aprint): New. 340 * mpicoder.c (gcry_mpi_aprint): New.
341 341
342 * Replaced all m_ memory functions by g10_ ones. 342 * Replaced all m_ memory functions by g10_ ones.
343 343
344Fri Dec 31 14:06:56 CET 1999 Werner Koch <wk@gnupg.de> 344Fri Dec 31 14:06:56 CET 1999 Werner Koch <wk@gnupg.de>
345 345
346 * mpi-bit.c (gcry_mpi_get_nbits): New. 346 * mpi-bit.c (gcry_mpi_get_nbits): New.
347 347
348 * mpiutil.c (mpi_set_secure): made static. 348 * mpiutil.c (mpi_set_secure): made static.
349 (gcry_mpi_get_flag): New. 349 (gcry_mpi_get_flag): New.
350 (gcry_mpi_set_flag): New. 350 (gcry_mpi_set_flag): New.
351 (gcry_mpi_clear_flag): New. 351 (gcry_mpi_clear_flag): New.
352 (mpi_set_opaque): renamed to gcry_mpi_set_opaque. 352 (mpi_set_opaque): renamed to gcry_mpi_set_opaque.
353 (mpi_get_opaque): renamed to gcry_mpi_get_opaque. 353 (mpi_get_opaque): renamed to gcry_mpi_get_opaque.
354 354
355Fri Dec 31 12:48:31 CET 1999 Werner Koch <wk@gnupg.de> 355Fri Dec 31 12:48:31 CET 1999 Werner Koch <wk@gnupg.de>
356 356
357 * mpicoder.c (mpi_read_from_buffer): Made static. 357 * mpicoder.c (mpi_read_from_buffer): Made static.
358 (gcry_mpi_print): A buffer of NULL is now allowed to get the required 358 (gcry_mpi_print): A buffer of NULL is now allowed to get the required
359 length back. 359 length back.
360 (mpi_get_keyid): Removed. 360 (mpi_get_keyid): Removed.
361 (mpi_print): Made static - should be removed. 361 (mpi_print): Made static - should be removed.
362 362
363Wed Dec 8 21:58:32 CET 1999 Werner Koch <wk@gnupg.de> 363Wed Dec 8 21:58:32 CET 1999 Werner Koch <wk@gnupg.de>
364 364
365 * Makefile.am (INCLUDES): Add ../gcrypt. 365 * Makefile.am (INCLUDES): Add ../gcrypt.
366 366
367 * g10m.c : Removed. 367 * g10m.c : Removed.
368 368
369 * mpicoder.c (mpi_write): Removed. 369 * mpicoder.c (mpi_write): Removed.
370 (mpi_read): Removed. 370 (mpi_read): Removed.
371 (gcry_mpi_scan): New. Taken from ../gcrypt/mpiapi.c. 371 (gcry_mpi_scan): New. Taken from ../gcrypt/mpiapi.c.
372 (gcry_mpi_print): Ditto. 372 (gcry_mpi_print): Ditto.
373 373
374 * mpi-pow.c (mpi_powm): Renamed to ... 374 * mpi-pow.c (mpi_powm): Renamed to ...
375 (gcry_mpi_powm): ... this. 375 (gcry_mpi_powm): ... this.
376 376
377 * mpiutil.c (gcry_mpi_new): New as a wrapper around the old function. 377 * mpiutil.c (gcry_mpi_new): New as a wrapper around the old function.
378 Taken from ../gcrypt/mpiapi.c. 378 Taken from ../gcrypt/mpiapi.c.
379 (gcry_mpi_snew): Ditto. 379 (gcry_mpi_snew): Ditto.
380 (gcry_mpi_release): Ditto. 380 (gcry_mpi_release): Ditto.
381 (gcry_mpi_copy): Ditto. 381 (gcry_mpi_copy): Ditto.
382 (gcry_mpi_set): Ditto. 382 (gcry_mpi_set): Ditto.
383 (gcry_mpi_set_ui): Ditto. 383 (gcry_mpi_set_ui): Ditto.
384 (gcry_mpi_cmp): Ditto. 384 (gcry_mpi_cmp): Ditto.
385 (gcry_mpi_cmp_ui): Ditto. 385 (gcry_mpi_cmp_ui): Ditto.
386 (gcry_mpi_randomize): Ditto. 386 (gcry_mpi_randomize): Ditto.
387 387
388 * mpicoder.c (mpi_print): Removed the nbit_info kludge. 388 * mpicoder.c (mpi_print): Removed the nbit_info kludge.
389 * mpi-bits.c (mpi_get_nbits): Replaced the is_protected stuff by 389 * mpi-bits.c (mpi_get_nbits): Replaced the is_protected stuff by
390 checking whether it is an opaque mpi and then returns it's length 390 checking whether it is an opaque mpi and then returns it's length
391 in bits. 391 in bits.
392 * mpiutil.c (mpi_set_opaque): Changed the interface to take a number 392 * mpiutil.c (mpi_set_opaque): Changed the interface to take a number
393 of bits for the length. Adjusted all users. 393 of bits for the length. Adjusted all users.
394 (mpi_get_opaque): Ditto. 394 (mpi_get_opaque): Ditto.
395 395
396Fri Nov 19 17:15:20 CET 1999 Werner Koch <wk@gnupg.de> 396Fri Nov 19 17:15:20 CET 1999 Werner Koch <wk@gnupg.de>
397 397
398 * mpicoder.c (g10_log_mpidump): Add a temporary workaround 398 * mpicoder.c (g10_log_mpidump): Add a temporary workaround
399 399
400 * mpih-mul.c (mpihelp_mul_n): s/m_is_ecure/g10_is_secure/ 400 * mpih-mul.c (mpihelp_mul_n): s/m_is_ecure/g10_is_secure/
401 401
402 * mpiutil.c (mpi_alloc): Remved the debug mode because it has turned 402 * mpiutil.c (mpi_alloc): Remved the debug mode because it has turned
403 out, that this feature was not very useful in the past. Use the 403 out, that this feature was not very useful in the past. Use the
404 new alloc functions. 404 new alloc functions.
405 (mpi_alloc_secure): Ditto. 405 (mpi_alloc_secure): Ditto.
406 (mpi_alloc_limb_space): Ditto. 406 (mpi_alloc_limb_space): Ditto.
407 (mpi_free_limb_space): Ditto. 407 (mpi_free_limb_space): Ditto.
408 (mpi_resize): Ditto. 408 (mpi_resize): Ditto.
409 (mpi_free): Ditto. 409 (mpi_free): Ditto.
410 (mpi_set_secure): Removed the debug stuff. 410 (mpi_set_secure): Removed the debug stuff.
411 (mpi_set_opaque): Ditto. 411 (mpi_set_opaque): Ditto.
412 (mpi_copy): Ditto. 412 (mpi_copy): Ditto.
413 (mpi_alloc_set_ui): Ditto. 413 (mpi_alloc_set_ui): Ditto.
414 (mpi_m_check): Use g10_ wrapper. 414 (mpi_m_check): Use g10_ wrapper.
415 415
416Mon Aug 30 20:38:33 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 416Mon Aug 30 20:38:33 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
417 417
418 418
419 * config.links: Add case label for DJGPP 419 * config.links: Add case label for DJGPP
420 420
421Wed Jul 14 19:42:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 421Wed Jul 14 19:42:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
422 422
423 423
424 * Makefile.am: Use .s files as temporaries, disabled other .S rules. 424 * Makefile.am: Use .s files as temporaries, disabled other .S rules.
425 425
426Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 426Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
427 427
428 428
429 * mpicoder.c (g10_log_mpidump): New. 429 * mpicoder.c (g10_log_mpidump): New.
430 430
431 * Makefile.am: Support for libtool. 431 * Makefile.am: Support for libtool.
432 432
433Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 433Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
434 434
435 435
436 * mpi-bit.c (mpi_lshift_limbs,mpi_rshift_limbs): New. 436 * mpi-bit.c (mpi_lshift_limbs,mpi_rshift_limbs): New.
437 * mpi-mpow.c (barrett_mulm): New but diabled. 437 * mpi-mpow.c (barrett_mulm): New but diabled.
438 438
439Tue Jun 1 16:01:46 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 439Tue Jun 1 16:01:46 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
440 440
441 * config.links (i[56]86*-*-freebsdelf*): New. 441 * config.links (i[56]86*-*-freebsdelf*): New.
442 442
443Sun May 23 14:20:22 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 443Sun May 23 14:20:22 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
444 444
445 * config.links (sysdep.h): Not any more conditionally created. 445 * config.links (sysdep.h): Not any more conditionally created.
446 446
447Tue May 4 15:47:53 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 447Tue May 4 15:47:53 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
448 448
449 * mpiutil.c (mpi_alloc_like): New. 449 * mpiutil.c (mpi_alloc_like): New.
450 450
451Mon Apr 26 17:48:15 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 451Mon Apr 26 17:48:15 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
452 452
453 * mpih-add.c, mpih-sub.c: Removed 453 * mpih-add.c, mpih-sub.c: Removed
454 * mpi-inline.c: New. 454 * mpi-inline.c: New.
455 * mpi-inline.h: Make it usable by mpi-inline.c. 455 * mpi-inline.h: Make it usable by mpi-inline.c.
456 456
457Sun Apr 18 10:11:28 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 457Sun Apr 18 10:11:28 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
458 458
459 * mpih-mul.c (mpihelp_mul_n): Fixed use of memory region. 459 * mpih-mul.c (mpihelp_mul_n): Fixed use of memory region.
460 (mpihelp_mul): Ditto. 460 (mpihelp_mul): Ditto.
461 461
462Wed Apr 7 20:51:39 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> 462Wed Apr 7 20:51:39 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
463 463
464 * Makefile.am: Explicit rules to invoke cpp on *.S 464 * Makefile.am: Explicit rules to invoke cpp on *.S
465 465
466Mon Mar 8 20:47:17 CET 1999 Werner Koch <wk@isil.d.shuttle.de> 466Mon Mar 8 20:47:17 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
467 467
468 * config.links: Take advantage of the with_symbol_underscore macro. 468 * config.links: Take advantage of the with_symbol_underscore macro.
469 Add support for freebsd 4. 469 Add support for freebsd 4.
470 470
471Wed Feb 24 11:07:27 CET 1999 Werner Koch <wk@isil.d.shuttle.de> 471Wed Feb 24 11:07:27 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
472 472
473 * mips3/mpih-sub1.S: Removed left over junk in last line. (Should I 473 * mips3/mpih-sub1.S: Removed left over junk in last line. (Should I
474 blame me or my editor?). 474 blame me or my editor?).
475 475
476Sat Feb 13 12:04:43 CET 1999 Werner Koch <wk@isil.d.shuttle.de> 476Sat Feb 13 12:04:43 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
477 477
478 * Makefile.am: Removed the +=. Add MPI_OPT_FLAGS. 478 * Makefile.am: Removed the +=. Add MPI_OPT_FLAGS.
479 479
480Sat Jan 9 16:02:23 CET 1999 Werner Koch <wk@isil.d.shuttle.de> 480Sat Jan 9 16:02:23 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
481 481
482 * mpi-cmp.c (mpi_cmp_ui): Normalized the arg. 482 * mpi-cmp.c (mpi_cmp_ui): Normalized the arg.
483 483
484Thu Jan 7 18:00:58 CET 1999 Werner Koch <wk@isil.d.shuttle.de> 484Thu Jan 7 18:00:58 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
485 485
486 * mpi-bit.c (mpi_normalize): New. 486 * mpi-bit.c (mpi_normalize): New.
487 (mpi_get_nbits): Normalize the MPI. 487 (mpi_get_nbits): Normalize the MPI.
488 * mpi-bit.c (mpi_cmp): Normalize the MPI before the compare. 488 * mpi-bit.c (mpi_cmp): Normalize the MPI before the compare.
489 489
490 490
491Tue Dec 8 13:15:16 CET 1998 Werner Koch <wk@isil.d.shuttle.de> 491Tue Dec 8 13:15:16 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
492 492
493 * config.links: Moved the case for powerpc*linux 493 * config.links: Moved the case for powerpc*linux
494 * powerpcp32/*.S: Removed some underscores. 494 * powerpcp32/*.S: Removed some underscores.
495 495
496Thu Nov 26 07:27:52 1998 Werner Koch <werner.koch@guug.de> 496Thu Nov 26 07:27:52 1998 Werner Koch <werner.koch@guug.de>
497 497
498 * config.links: Support for ppc with ELF 498 * config.links: Support for ppc with ELF
499 * powerpc32/syntax.h: New. 499 * powerpc32/syntax.h: New.
500 * powerpc32/*.S: Applied ELF patches (glibc patches) 500 * powerpc32/*.S: Applied ELF patches (glibc patches)
501 501
502Tue Nov 10 19:31:37 1998 Werner Koch (wk@isil.d.shuttle.de) 502Tue Nov 10 19:31:37 1998 Werner Koch (wk@isil.d.shuttle.de)
503 503
504 * power*/ : Started with stuff for PPC 504 * power*/ : Started with stuff for PPC
505 * config.links: Some stuff for PPC. 505 * config.links: Some stuff for PPC.
506 * generic/udiv-w-sdiv.c: New but disabled. 506 * generic/udiv-w-sdiv.c: New but disabled.
507 507
508Tue Oct 27 12:37:46 1998 Werner Koch (wk@isil.d.shuttle.de) 508Tue Oct 27 12:37:46 1998 Werner Koch (wk@isil.d.shuttle.de)
509 509
510 * config.links (freebsd): Fixes for FreeBSD 3.0 510 * config.links (freebsd): Fixes for FreeBSD 3.0
511 511
512Wed Oct 14 09:59:30 1998 Werner Koch (wk@isil.d.shuttle.de) 512Wed Oct 14 09:59:30 1998 Werner Koch (wk@isil.d.shuttle.de)
513 513
514 * config.links (freebsd): ELF patches from Jun Kuriyama. 514 * config.links (freebsd): ELF patches from Jun Kuriyama.
515 515
516Thu Oct 8 13:28:17 1998 Werner Koch (wk@isil.d.shuttle.de) 516Thu Oct 8 13:28:17 1998 Werner Koch (wk@isil.d.shuttle.de)
517 517
518 * mpi-mpow.c (mpi_mulpowm): Fixed mem leak (m_free/mpi_free). 518 * mpi-mpow.c (mpi_mulpowm): Fixed mem leak (m_free/mpi_free).
519 519
520Thu Sep 17 18:08:50 1998 Werner Koch (wk@(none)) 520Thu Sep 17 18:08:50 1998 Werner Koch (wk@(none))
521 521
522 * hppa1.1/udiv-qrnnd.S: Fix from Steffen Zahn for HPUX 10.20 522 * hppa1.1/udiv-qrnnd.S: Fix from Steffen Zahn for HPUX 10.20
523 523
524Thu Aug 6 16:39:28 1998 Werner Koch,mobil,,, (wk@tobold) 524Thu Aug 6 16:39:28 1998 Werner Koch,mobil,,, (wk@tobold)
525 525
526 * mpi-bit.c (mpi_set_bytes): Removed. 526 * mpi-bit.c (mpi_set_bytes): Removed.
527 527
528Wed Aug 5 15:11:12 1998 Werner Koch (wk@(none)) 528Wed Aug 5 15:11:12 1998 Werner Koch (wk@(none))
529 529
530 * mpicoder.c (mpi_read_from_buffer): New. 530 * mpicoder.c (mpi_read_from_buffer): New.
531 531
532 * mpiutil.c (mpi_set_opaque): New. 532 * mpiutil.c (mpi_set_opaque): New.
533 (mpi_get_opaque): New. 533 (mpi_get_opaque): New.
534 (mpi_copy): Changed to support opauqe flag 534 (mpi_copy): Changed to support opauqe flag
535 (mpi_free): Ditto. 535 (mpi_free): Ditto.
536 536
537Sat Jul 4 10:11:11 1998 Werner Koch (wk@isil.d.shuttle.de) 537Sat Jul 4 10:11:11 1998 Werner Koch (wk@isil.d.shuttle.de)
538 538
539 * mpiutil.c (mpi_clear): Reset flags. 539 * mpiutil.c (mpi_clear): Reset flags.
540 (mpi_set): Ditto. 540 (mpi_set): Ditto.
541 (mpi_alloc_secure): Set flag to 1 and not ored the 1 in, tsss.. 541 (mpi_alloc_secure): Set flag to 1 and not ored the 1 in, tsss..
542 542
543Fri Jun 26 11:19:06 1998 Werner Koch (wk@isil.d.shuttle.de) 543Fri Jun 26 11:19:06 1998 Werner Koch (wk@isil.d.shuttle.de)
544 544
545 * mpiutil.c (mpi_alloc): set nbits to 0. 545 * mpiutil.c (mpi_alloc): set nbits to 0.
546 (mpi_alloc_secure): Ditto. 546 (mpi_alloc_secure): Ditto.
547 (mpi_clear): Ditto. 547 (mpi_clear): Ditto.
548 548
549Thu Jun 25 11:50:01 1998 Werner Koch (wk@isil.d.shuttle.de) 549Thu Jun 25 11:50:01 1998 Werner Koch (wk@isil.d.shuttle.de)
550 550
551 * mips3/*.S: New 551 * mips3/*.S: New
552 552
553Mon May 18 13:47:06 1998 Werner Koch (wk@isil.d.shuttle.de) 553Mon May 18 13:47:06 1998 Werner Koch (wk@isil.d.shuttle.de)
554 554
555 * config.links: split mpih-shift into mpih-[lr]shift and 555 * config.links: split mpih-shift into mpih-[lr]shift and
556 changed all implementations. 556 changed all implementations.
557 * mpi/alpha: add some new assembler stuff. 557 * mpi/alpha: add some new assembler stuff.
558 558
559Wed May 13 11:04:29 1998 Werner Koch (wk@isil.d.shuttle.de) 559Wed May 13 11:04:29 1998 Werner Koch (wk@isil.d.shuttle.de)
560 560
561 * config.links: Add support for MIPS 561 * config.links: Add support for MIPS
562 562
563Thu Apr 9 11:31:36 1998 Werner Koch (wk@isil.d.shuttle.de) 563Thu Apr 9 11:31:36 1998 Werner Koch (wk@isil.d.shuttle.de)
564 564
565 * mpicoder.c (mpi_get_secure_buffer): New. 565 * mpicoder.c (mpi_get_secure_buffer): New.
566 566
567Wed Apr 8 09:44:33 1998 Werner Koch (wk@isil.d.shuttle.de) 567Wed Apr 8 09:44:33 1998 Werner Koch (wk@isil.d.shuttle.de)
568 568
569 * config.links: Applied small fix from Ulf Möller. 569 * config.links: Applied small fix from Ulf Möller.
570 570
571Mon Apr 6 12:38:52 1998 Werner Koch (wk@isil.d.shuttle.de) 571Mon Apr 6 12:38:52 1998 Werner Koch (wk@isil.d.shuttle.de)
572 572
573 * mpicoder.c (mpi_get_buffer): Removed returned leading zeroes 573 * mpicoder.c (mpi_get_buffer): Removed returned leading zeroes
574 and changed all callers. 574 and changed all callers.
575 575
576Tue Mar 10 13:40:34 1998 Werner Koch (wk@isil.d.shuttle.de) 576Tue Mar 10 13:40:34 1998 Werner Koch (wk@isil.d.shuttle.de)
577 577
578 * mpi-bit.c (mpi_clear_highbit): New. 578 * mpi-bit.c (mpi_clear_highbit): New.
579 579
580Mon Mar 2 19:29:00 1998 Werner Koch (wk@isil.d.shuttle.de) 580Mon Mar 2 19:29:00 1998 Werner Koch (wk@isil.d.shuttle.de)
581 581
582 * Makefile.am (DISTCLEANFILES): New 582 * Makefile.am (DISTCLEANFILES): New
583 583
584Thu Feb 26 06:48:54 1998 Werner Koch (wk@isil.d.shuttle.de) 584Thu Feb 26 06:48:54 1998 Werner Koch (wk@isil.d.shuttle.de)
585 585
586 * config.links (X86_BROKEN_ALIGN): Added for some systems. 586 * config.links (X86_BROKEN_ALIGN): Added for some systems.
587 587
588Mon Feb 23 12:21:40 1998 Werner Koch (wk@isil.d.shuttle.de) 588Mon Feb 23 12:21:40 1998 Werner Koch (wk@isil.d.shuttle.de)
589 589
590 * mpi/m68k/mpih-shift.S (Lspecial): Changed duplicate symbol. 590 * mpi/m68k/mpih-shift.S (Lspecial): Changed duplicate symbol.
591 591
592Mon Feb 16 13:00:27 1998 Werner Koch (wk@isil.d.shuttle.de) 592Mon Feb 16 13:00:27 1998 Werner Koch (wk@isil.d.shuttle.de)
593 593
594 * config.links : Add detection of m68k cpus 594 * config.links : Add detection of m68k cpus
595 595
596 596
597 Copyright 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc. 597 Copyright 1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc.
598 598
599 This file is free software; as a special exception the author gives 599 This file is free software; as a special exception the author gives
600 unlimited permission to copy and/or distribute it, with or without 600 unlimited permission to copy and/or distribute it, with or without
601 modifications, as long as this notice is preserved. 601 modifications, as long as this notice is preserved.
602 602
603 This file is distributed in the hope that it will be useful, but 603 This file is distributed in the hope that it will be useful, but
604 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the 604 WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
605 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 605 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.am b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.am
index 49b941e..1205957 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.am
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.am
@@ -1,191 +1,191 @@
1## Process this file with automake to produce Makefile.in 1## Process this file with automake to produce Makefile.in
2# Copyright (C) 1992, 1999, 2000, 2002 Free Software Foundation, Inc. 2# Copyright (C) 1992, 1999, 2000, 2002 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20# 1.5 leads to a combinatorial explosion due to all the conditionals 20# 1.5 leads to a combinatorial explosion due to all the conditionals
21# I was not able to build it with 64Megs - 1.6 fixes this. 21# I was not able to build it with 64Megs - 1.6 fixes this.
22# not anymore required: AUTOMAKE_OPTIONS = 1.6 22# not anymore required: AUTOMAKE_OPTIONS = 1.6
23 23
24INCLUDES = -I$(top_srcdir)/src 24INCLUDES = -I$(top_srcdir)/src
25ASFLAGS = @MPI_SFLAGS@ 25ASFLAGS = @MPI_SFLAGS@
26AM_CCASFLAGS = $(NOEXECSTACK_FLAGS) 26AM_CCASFLAGS = $(NOEXECSTACK_FLAGS)
27 27
28# We don't have .S sources listed, so automake does not autocreate these 28# We don't have .S sources listed, so automake does not autocreate these
29CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) 29CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
30LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) 30LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
31 31
32 32
33EXTRA_DIST = Manifest config.links 33EXTRA_DIST = Manifest config.links
34DISTCLEANFILES = mpi-asm-defs.h \ 34DISTCLEANFILES = mpi-asm-defs.h \
35 mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S \ 35 mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S \
36 mpih-lshift.S mpih-rshift.S mpih-sub1.S asm-syntax.h sysdep.h 36 mpih-lshift.S mpih-rshift.S mpih-sub1.S asm-syntax.h sysdep.h
37# Note: we only use .S files so we should delete all left over .s 37# Note: we only use .S files so we should delete all left over .s
38CLEANFILES = _*.s __*.s 38CLEANFILES = _*.s __*.s
39 39
40# Beware: The following list is not a comment but grepped by 40# Beware: The following list is not a comment but grepped by
41# config.links to get the list of symlinked modules 41# config.links to get the list of symlinked modules
42# Optional modules are marked with a 0 in the second column. 42# Optional modules are marked with a 0 in the second column.
43#BEGIN_ASM_LIST 43#BEGIN_ASM_LIST
44# mpih-add1 C 44# mpih-add1 C
45# mpih-sub1 C 45# mpih-sub1 C
46# mpih-mul1 C 46# mpih-mul1 C
47# mpih-mul2 C 47# mpih-mul2 C
48# mpih-mul3 C 48# mpih-mul3 C
49# mpih-lshift C 49# mpih-lshift C
50# mpih-rshift C 50# mpih-rshift C
51# udiv O 51# udiv O
52# udiv-qrnnd O 52# udiv-qrnnd O
53#END_ASM_LIST 53#END_ASM_LIST
54 54
55# Note: This function has not yet been implemented. There is only a dummy in 55# Note: This function has not yet been implemented. There is only a dummy in
56# generic/ 56# generic/
57# udiv-w-sdiv O 57# udiv-w-sdiv O
58 58
59# And we need to have conditionals for all modules because 59# And we need to have conditionals for all modules because
60# we don't know whether they are .c or .S. Very ugly; I know. 60# we don't know whether they are .c or .S. Very ugly; I know.
61# Remember to define them all in configure.ac 61# Remember to define them all in configure.ac
62# if MPI_MOD_ASM_MPIH_ADD1 62# if MPI_MOD_ASM_MPIH_ADD1
63# mpih_add1 = mpih-add1.S 63# mpih_add1 = mpih-add1.S
64# else 64# else
65# if MPI_MOD_C_MPIH_ADD1 65# if MPI_MOD_C_MPIH_ADD1
66# mpih_add1 = mpih-add1.c 66# mpih_add1 = mpih-add1.c
67# else 67# else
68# mpih_add1 = 68# mpih_add1 =
69# endif 69# endif
70# endif 70# endif
71# 71#
72# if MPI_MOD_ASM_MPIH_SUB1 72# if MPI_MOD_ASM_MPIH_SUB1
73# mpih_sub1 = mpih-sub1.S 73# mpih_sub1 = mpih-sub1.S
74# else 74# else
75# if MPI_MOD_C_MPIH_SUB1 75# if MPI_MOD_C_MPIH_SUB1
76# mpih_sub1 = mpih-sub1.c 76# mpih_sub1 = mpih-sub1.c
77# else 77# else
78# mpih_sub1 = 78# mpih_sub1 =
79# endif 79# endif
80# endif 80# endif
81# 81#
82# if MPI_MOD_ASM_MPIH_MUL1 82# if MPI_MOD_ASM_MPIH_MUL1
83# mpih_mul1 = mpih-mul1.S 83# mpih_mul1 = mpih-mul1.S
84# else 84# else
85# if MPI_MOD_C_MPIH_MUL1 85# if MPI_MOD_C_MPIH_MUL1
86# mpih_mul1 = mpih-mul1.c 86# mpih_mul1 = mpih-mul1.c
87# else 87# else
88# mpih_mul1 = 88# mpih_mul1 =
89# endif 89# endif
90# endif 90# endif
91# 91#
92# if MPI_MOD_ASM_MPIH_MUL2 92# if MPI_MOD_ASM_MPIH_MUL2
93# mpih_mul2 = mpih-mul2.S 93# mpih_mul2 = mpih-mul2.S
94# else 94# else
95# if MPI_MOD_C_MPIH_MUL2 95# if MPI_MOD_C_MPIH_MUL2
96# mpih_mul2 = mpih-mul2.c 96# mpih_mul2 = mpih-mul2.c
97# else 97# else
98# mpih_mul2 = 98# mpih_mul2 =
99# endif 99# endif
100# endif 100# endif
101# 101#
102# if MPI_MOD_ASM_MPIH_MUL3 102# if MPI_MOD_ASM_MPIH_MUL3
103# mpih_mul3 = mpih-mul3.S 103# mpih_mul3 = mpih-mul3.S
104# else 104# else
105# if MPI_MOD_C_MPIH_MUL3 105# if MPI_MOD_C_MPIH_MUL3
106# mpih_mul3 = mpih-mul3.c 106# mpih_mul3 = mpih-mul3.c
107# else 107# else
108# mpih_mul3 = 108# mpih_mul3 =
109# endif 109# endif
110# endif 110# endif
111# 111#
112# if MPI_MOD_ASM_MPIH_LSHIFT 112# if MPI_MOD_ASM_MPIH_LSHIFT
113# mpih_lshift = mpih-lshift.S 113# mpih_lshift = mpih-lshift.S
114# else 114# else
115# if MPI_MOD_C_MPIH_LSHIFT 115# if MPI_MOD_C_MPIH_LSHIFT
116# mpih_lshift = mpih-lshift.c 116# mpih_lshift = mpih-lshift.c
117# else 117# else
118# mpih_lshift = 118# mpih_lshift =
119# endif 119# endif
120# endif 120# endif
121# 121#
122# if MPI_MOD_ASM_MPIH_RSHIFT 122# if MPI_MOD_ASM_MPIH_RSHIFT
123# mpih_rshift = mpih-rshift.S 123# mpih_rshift = mpih-rshift.S
124# else 124# else
125# if MPI_MOD_C_MPIH_RSHIFT 125# if MPI_MOD_C_MPIH_RSHIFT
126# mpih_rshift = mpih-rshift.c 126# mpih_rshift = mpih-rshift.c
127# else 127# else
128# mpih_rshift = 128# mpih_rshift =
129# endif 129# endif
130# endif 130# endif
131# 131#
132# if MPI_MOD_ASM_UDIV 132# if MPI_MOD_ASM_UDIV
133# udiv = udiv.S 133# udiv = udiv.S
134# else 134# else
135# if MPI_MOD_C_UDIV 135# if MPI_MOD_C_UDIV
136# udiv = udiv.c 136# udiv = udiv.c
137# else 137# else
138# udiv = 138# udiv =
139# endif 139# endif
140# endif 140# endif
141# 141#
142# if MPI_MOD_ASM_UDIV_QRNND 142# if MPI_MOD_ASM_UDIV_QRNND
143# udiv_qrnnd = udiv-qrnnd.S 143# udiv_qrnnd = udiv-qrnnd.S
144# else 144# else
145# if MPI_MOD_C_UDIV_QRNND 145# if MPI_MOD_C_UDIV_QRNND
146# udiv_qrnnd = udiv-qrnnd.c 146# udiv_qrnnd = udiv-qrnnd.c
147# else 147# else
148# udiv_qrnnd = 148# udiv_qrnnd =
149# endif 149# endif
150# endif 150# endif
151 151
152noinst_LTLIBRARIES = libmpi.la 152noinst_LTLIBRARIES = libmpi.la
153 153
154AM_CFLAGS = @GPG_ERROR_CFLAGS@ 154AM_CFLAGS = @GPG_ERROR_CFLAGS@
155libmpi_la_LDFLAGS = 155libmpi_la_LDFLAGS =
156libmpi_la_SOURCES = longlong.h \ 156libmpi_la_SOURCES = longlong.h \
157 mpi-add.c \ 157 mpi-add.c \
158 mpi-bit.c \ 158 mpi-bit.c \
159 mpi-cmp.c \ 159 mpi-cmp.c \
160 mpi-div.c \ 160 mpi-div.c \
161 mpi-gcd.c \ 161 mpi-gcd.c \
162 mpi-internal.h \ 162 mpi-internal.h \
163 mpi-inline.h \ 163 mpi-inline.h \
164 mpi-inline.c \ 164 mpi-inline.c \
165 mpi-inv.c \ 165 mpi-inv.c \
166 mpi-mul.c \ 166 mpi-mul.c \
167 mpi-pow.c \ 167 mpi-pow.c \
168 mpi-mpow.c \ 168 mpi-mpow.c \
169 mpi-scan.c \ 169 mpi-scan.c \
170 mpicoder.c \ 170 mpicoder.c \
171 mpih-div.c \ 171 mpih-div.c \
172 mpih-mul.c \ 172 mpih-mul.c \
173 mpiutil.c 173 mpiutil.c
174 174
175libmpi_la_LIBADD = @MPI_MOD_LIST_LO@ 175libmpi_la_LIBADD = @MPI_MOD_LIST_LO@
176libmpi_la_DEPENDENCIES = @MPI_MOD_LIST_LO@ 176libmpi_la_DEPENDENCIES = @MPI_MOD_LIST_LO@
177 177
178 178
179# Because we are circumventing automake with regards to assembler 179# Because we are circumventing automake with regards to assembler
180# files, we have to define our own rules. 180# files, we have to define our own rules.
181 181
182SUFFIXES = .S .o .obj .lo 182SUFFIXES = .S .o .obj .lo
183 183
184.S.o: 184.S.o:
185 $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< 185 $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
186 186
187.S.obj: 187.S.obj:
188 $(CCASCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` 188 $(CCASCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
189 189
190.S.lo: 190.S.lo:
191 $(LTCCASCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< 191 $(LTCCASCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.in b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.in
index 503fda6..792be1a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.in
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Makefile.in
@@ -1,657 +1,657 @@
1# Makefile.in generated by automake 1.9.4 from Makefile.am. 1# Makefile.in generated by automake 1.9.4 from Makefile.am.
2# @configure_input@ 2# @configure_input@
3 3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004 Free Software Foundation, Inc. 5# 2003, 2004 Free Software Foundation, Inc.
6# This Makefile.in is free software; the Free Software Foundation 6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved. 8# with or without modifications, as long as this notice is preserved.
9 9
10# This program is distributed in the hope that it will be useful, 10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE. 13# PARTICULAR PURPOSE.
14 14
15@SET_MAKE@ 15@SET_MAKE@
16 16
17# Copyright (C) 1992, 1999, 2000, 2002 Free Software Foundation, Inc. 17# Copyright (C) 1992, 1999, 2000, 2002 Free Software Foundation, Inc.
18# 18#
19# This file is part of Libgcrypt. 19# This file is part of Libgcrypt.
20# 20#
21# Libgcrypt is free software; you can redistribute it and/or modify 21# Libgcrypt is free software; you can redistribute it and/or modify
22# it under the terms of the GNU Lesser General Public License as 22# it under the terms of the GNU Lesser General Public License as
23# published by the Free Software Foundation; either version 2.1 of 23# published by the Free Software Foundation; either version 2.1 of
24# the License, or (at your option) any later version. 24# the License, or (at your option) any later version.
25# 25#
26# Libgcrypt is distributed in the hope that it will be useful, 26# Libgcrypt is distributed in the hope that it will be useful,
27# but WITHOUT ANY WARRANTY; without even the implied warranty of 27# but WITHOUT ANY WARRANTY; without even the implied warranty of
28# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29# GNU Lesser General Public License for more details. 29# GNU Lesser General Public License for more details.
30# 30#
31# You should have received a copy of the GNU Lesser General Public 31# You should have received a copy of the GNU Lesser General Public
32# License along with this program; if not, write to the Free Software 32# License along with this program; if not, write to the Free Software
33# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 33# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
34 34
35# 1.5 leads to a combinatorial explosion due to all the conditionals 35# 1.5 leads to a combinatorial explosion due to all the conditionals
36# I was not able to build it with 64Megs - 1.6 fixes this. 36# I was not able to build it with 64Megs - 1.6 fixes this.
37# not anymore required: AUTOMAKE_OPTIONS = 1.6 37# not anymore required: AUTOMAKE_OPTIONS = 1.6
38 38
39SOURCES = $(libmpi_la_SOURCES) 39SOURCES = $(libmpi_la_SOURCES)
40 40
41srcdir = @srcdir@ 41srcdir = @srcdir@
42top_srcdir = @top_srcdir@ 42top_srcdir = @top_srcdir@
43VPATH = @srcdir@ 43VPATH = @srcdir@
44pkgdatadir = $(datadir)/@PACKAGE@ 44pkgdatadir = $(datadir)/@PACKAGE@
45pkglibdir = $(libdir)/@PACKAGE@ 45pkglibdir = $(libdir)/@PACKAGE@
46pkgincludedir = $(includedir)/@PACKAGE@ 46pkgincludedir = $(includedir)/@PACKAGE@
47top_builddir = .. 47top_builddir = ..
48am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 48am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
49INSTALL = @INSTALL@ 49INSTALL = @INSTALL@
50install_sh_DATA = $(install_sh) -c -m 644 50install_sh_DATA = $(install_sh) -c -m 644
51install_sh_PROGRAM = $(install_sh) -c 51install_sh_PROGRAM = $(install_sh) -c
52install_sh_SCRIPT = $(install_sh) -c 52install_sh_SCRIPT = $(install_sh) -c
53INSTALL_HEADER = $(INSTALL_DATA) 53INSTALL_HEADER = $(INSTALL_DATA)
54transform = $(program_transform_name) 54transform = $(program_transform_name)
55NORMAL_INSTALL = : 55NORMAL_INSTALL = :
56PRE_INSTALL = : 56PRE_INSTALL = :
57POST_INSTALL = : 57POST_INSTALL = :
58NORMAL_UNINSTALL = : 58NORMAL_UNINSTALL = :
59PRE_UNINSTALL = : 59PRE_UNINSTALL = :
60POST_UNINSTALL = : 60POST_UNINSTALL = :
61build_triplet = @build@ 61build_triplet = @build@
62host_triplet = @host@ 62host_triplet = @host@
63target_triplet = @target@ 63target_triplet = @target@
64subdir = mpi 64subdir = mpi
65DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog 65DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
66ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 66ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
67am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ 67am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
68 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac 68 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
69am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 69am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
70 $(ACLOCAL_M4) 70 $(ACLOCAL_M4)
71mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 71mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
72CONFIG_HEADER = $(top_builddir)/config.h 72CONFIG_HEADER = $(top_builddir)/config.h
73CONFIG_CLEAN_FILES = 73CONFIG_CLEAN_FILES =
74LTLIBRARIES = $(noinst_LTLIBRARIES) 74LTLIBRARIES = $(noinst_LTLIBRARIES)
75am_libmpi_la_OBJECTS = mpi-add.lo mpi-bit.lo mpi-cmp.lo mpi-div.lo \ 75am_libmpi_la_OBJECTS = mpi-add.lo mpi-bit.lo mpi-cmp.lo mpi-div.lo \
76 mpi-gcd.lo mpi-inline.lo mpi-inv.lo mpi-mul.lo mpi-pow.lo \ 76 mpi-gcd.lo mpi-inline.lo mpi-inv.lo mpi-mul.lo mpi-pow.lo \
77 mpi-mpow.lo mpi-scan.lo mpicoder.lo mpih-div.lo mpih-mul.lo \ 77 mpi-mpow.lo mpi-scan.lo mpicoder.lo mpih-div.lo mpih-mul.lo \
78 mpiutil.lo 78 mpiutil.lo
79libmpi_la_OBJECTS = $(am_libmpi_la_OBJECTS) 79libmpi_la_OBJECTS = $(am_libmpi_la_OBJECTS)
80DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) 80DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
81depcomp = $(SHELL) $(top_srcdir)/depcomp 81depcomp = $(SHELL) $(top_srcdir)/depcomp
82am__depfiles_maybe = depfiles 82am__depfiles_maybe = depfiles
83COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 83COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
84 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 84 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
85LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ 85LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
86 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ 86 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
87 $(AM_CFLAGS) $(CFLAGS) 87 $(AM_CFLAGS) $(CFLAGS)
88CCLD = $(CC) 88CCLD = $(CC)
89LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ 89LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
90 $(AM_LDFLAGS) $(LDFLAGS) -o $@ 90 $(AM_LDFLAGS) $(LDFLAGS) -o $@
91SOURCES = $(libmpi_la_SOURCES) 91SOURCES = $(libmpi_la_SOURCES)
92DIST_SOURCES = $(libmpi_la_SOURCES) 92DIST_SOURCES = $(libmpi_la_SOURCES)
93ETAGS = etags 93ETAGS = etags
94CTAGS = ctags 94CTAGS = ctags
95DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 95DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
96ACLOCAL = @ACLOCAL@ 96ACLOCAL = @ACLOCAL@
97AMDEP_FALSE = @AMDEP_FALSE@ 97AMDEP_FALSE = @AMDEP_FALSE@
98AMDEP_TRUE = @AMDEP_TRUE@ 98AMDEP_TRUE = @AMDEP_TRUE@
99AMTAR = @AMTAR@ 99AMTAR = @AMTAR@
100AR = @AR@ 100AR = @AR@
101AUTOCONF = @AUTOCONF@ 101AUTOCONF = @AUTOCONF@
102AUTOHEADER = @AUTOHEADER@ 102AUTOHEADER = @AUTOHEADER@
103AUTOMAKE = @AUTOMAKE@ 103AUTOMAKE = @AUTOMAKE@
104AWK = @AWK@ 104AWK = @AWK@
105CC = @CC@ 105CC = @CC@
106CCAS = @CCAS@ 106CCAS = @CCAS@
107CCASFLAGS = @CCASFLAGS@ 107CCASFLAGS = @CCASFLAGS@
108CCDEPMODE = @CCDEPMODE@ 108CCDEPMODE = @CCDEPMODE@
109CFLAGS = @CFLAGS@ 109CFLAGS = @CFLAGS@
110CPP = @CPP@ 110CPP = @CPP@
111CPPFLAGS = @CPPFLAGS@ 111CPPFLAGS = @CPPFLAGS@
112CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@ 112CROSS_COMPILING_FALSE = @CROSS_COMPILING_FALSE@
113CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@ 113CROSS_COMPILING_TRUE = @CROSS_COMPILING_TRUE@
114CXX = @CXX@ 114CXX = @CXX@
115CXXCPP = @CXXCPP@ 115CXXCPP = @CXXCPP@
116CXXDEPMODE = @CXXDEPMODE@ 116CXXDEPMODE = @CXXDEPMODE@
117CXXFLAGS = @CXXFLAGS@ 117CXXFLAGS = @CXXFLAGS@
118CYGPATH_W = @CYGPATH_W@ 118CYGPATH_W = @CYGPATH_W@
119DEFS = @DEFS@ 119DEFS = @DEFS@
120DEPDIR = @DEPDIR@ 120DEPDIR = @DEPDIR@
121ECHO = @ECHO@ 121ECHO = @ECHO@
122ECHO_C = @ECHO_C@ 122ECHO_C = @ECHO_C@
123ECHO_N = @ECHO_N@ 123ECHO_N = @ECHO_N@
124ECHO_T = @ECHO_T@ 124ECHO_T = @ECHO_T@
125EGREP = @EGREP@ 125EGREP = @EGREP@
126EXEEXT = @EXEEXT@ 126EXEEXT = @EXEEXT@
127F77 = @F77@ 127F77 = @F77@
128FFLAGS = @FFLAGS@ 128FFLAGS = @FFLAGS@
129GCRYPT_CIPHERS = @GCRYPT_CIPHERS@ 129GCRYPT_CIPHERS = @GCRYPT_CIPHERS@
130GCRYPT_DIGESTS = @GCRYPT_DIGESTS@ 130GCRYPT_DIGESTS = @GCRYPT_DIGESTS@
131GCRYPT_PUBKEY_CIPHERS = @GCRYPT_PUBKEY_CIPHERS@ 131GCRYPT_PUBKEY_CIPHERS = @GCRYPT_PUBKEY_CIPHERS@
132GCRYPT_RANDOM = @GCRYPT_RANDOM@ 132GCRYPT_RANDOM = @GCRYPT_RANDOM@
133GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ 133GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@
134GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ 134GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@
135GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ 135GPG_ERROR_LIBS = @GPG_ERROR_LIBS@
136HAVE_LD_VERSION_SCRIPT_FALSE = @HAVE_LD_VERSION_SCRIPT_FALSE@ 136HAVE_LD_VERSION_SCRIPT_FALSE = @HAVE_LD_VERSION_SCRIPT_FALSE@
137HAVE_LD_VERSION_SCRIPT_TRUE = @HAVE_LD_VERSION_SCRIPT_TRUE@ 137HAVE_LD_VERSION_SCRIPT_TRUE = @HAVE_LD_VERSION_SCRIPT_TRUE@
138INSTALL_DATA = @INSTALL_DATA@ 138INSTALL_DATA = @INSTALL_DATA@
139INSTALL_PROGRAM = @INSTALL_PROGRAM@ 139INSTALL_PROGRAM = @INSTALL_PROGRAM@
140INSTALL_SCRIPT = @INSTALL_SCRIPT@ 140INSTALL_SCRIPT = @INSTALL_SCRIPT@
141INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 141INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
142LDFLAGS = @LDFLAGS@ 142LDFLAGS = @LDFLAGS@
143LIBGCRYPT_CIPHERS = @LIBGCRYPT_CIPHERS@ 143LIBGCRYPT_CIPHERS = @LIBGCRYPT_CIPHERS@
144LIBGCRYPT_CONFIG_API_VERSION = @LIBGCRYPT_CONFIG_API_VERSION@ 144LIBGCRYPT_CONFIG_API_VERSION = @LIBGCRYPT_CONFIG_API_VERSION@
145LIBGCRYPT_CONFIG_CFLAGS = @LIBGCRYPT_CONFIG_CFLAGS@ 145LIBGCRYPT_CONFIG_CFLAGS = @LIBGCRYPT_CONFIG_CFLAGS@
146LIBGCRYPT_CONFIG_LIBS = @LIBGCRYPT_CONFIG_LIBS@ 146LIBGCRYPT_CONFIG_LIBS = @LIBGCRYPT_CONFIG_LIBS@
147LIBGCRYPT_DIGESTS = @LIBGCRYPT_DIGESTS@ 147LIBGCRYPT_DIGESTS = @LIBGCRYPT_DIGESTS@
148LIBGCRYPT_LT_AGE = @LIBGCRYPT_LT_AGE@ 148LIBGCRYPT_LT_AGE = @LIBGCRYPT_LT_AGE@
149LIBGCRYPT_LT_CURRENT = @LIBGCRYPT_LT_CURRENT@ 149LIBGCRYPT_LT_CURRENT = @LIBGCRYPT_LT_CURRENT@
150LIBGCRYPT_LT_REVISION = @LIBGCRYPT_LT_REVISION@ 150LIBGCRYPT_LT_REVISION = @LIBGCRYPT_LT_REVISION@
151LIBGCRYPT_PUBKEY_CIPHERS = @LIBGCRYPT_PUBKEY_CIPHERS@ 151LIBGCRYPT_PUBKEY_CIPHERS = @LIBGCRYPT_PUBKEY_CIPHERS@
152LIBGCRYPT_THREAD_MODULES = @LIBGCRYPT_THREAD_MODULES@ 152LIBGCRYPT_THREAD_MODULES = @LIBGCRYPT_THREAD_MODULES@
153LIBOBJS = @LIBOBJS@ 153LIBOBJS = @LIBOBJS@
154LIBS = @LIBS@ 154LIBS = @LIBS@
155LIBTOOL = @LIBTOOL@ 155LIBTOOL = @LIBTOOL@
156LN_S = @LN_S@ 156LN_S = @LN_S@
157LTLIBOBJS = @LTLIBOBJS@ 157LTLIBOBJS = @LTLIBOBJS@
158MAINT = @MAINT@ 158MAINT = @MAINT@
159MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ 159MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
160MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ 160MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
161MAKEINFO = @MAKEINFO@ 161MAKEINFO = @MAKEINFO@
162MPI_MOD_LIST_LO = @MPI_MOD_LIST_LO@ 162MPI_MOD_LIST_LO = @MPI_MOD_LIST_LO@
163MPI_MOD_LIST_O = @MPI_MOD_LIST_O@ 163MPI_MOD_LIST_O = @MPI_MOD_LIST_O@
164MPI_SFLAGS = @MPI_SFLAGS@ 164MPI_SFLAGS = @MPI_SFLAGS@
165NOEXECSTACK_FLAGS = @NOEXECSTACK_FLAGS@ 165NOEXECSTACK_FLAGS = @NOEXECSTACK_FLAGS@
166OBJEXT = @OBJEXT@ 166OBJEXT = @OBJEXT@
167PACKAGE = @PACKAGE@ 167PACKAGE = @PACKAGE@
168PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 168PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
169PACKAGE_NAME = @PACKAGE_NAME@ 169PACKAGE_NAME = @PACKAGE_NAME@
170PACKAGE_STRING = @PACKAGE_STRING@ 170PACKAGE_STRING = @PACKAGE_STRING@
171PACKAGE_TARNAME = @PACKAGE_TARNAME@ 171PACKAGE_TARNAME = @PACKAGE_TARNAME@
172PACKAGE_VERSION = @PACKAGE_VERSION@ 172PACKAGE_VERSION = @PACKAGE_VERSION@
173PATH_SEPARATOR = @PATH_SEPARATOR@ 173PATH_SEPARATOR = @PATH_SEPARATOR@
174RANLIB = @RANLIB@ 174RANLIB = @RANLIB@
175SET_MAKE = @SET_MAKE@ 175SET_MAKE = @SET_MAKE@
176SHELL = @SHELL@ 176SHELL = @SHELL@
177STRIP = @STRIP@ 177STRIP = @STRIP@
178VERSION = @VERSION@ 178VERSION = @VERSION@
179ac_ct_AR = @ac_ct_AR@ 179ac_ct_AR = @ac_ct_AR@
180ac_ct_CC = @ac_ct_CC@ 180ac_ct_CC = @ac_ct_CC@
181ac_ct_CXX = @ac_ct_CXX@ 181ac_ct_CXX = @ac_ct_CXX@
182ac_ct_F77 = @ac_ct_F77@ 182ac_ct_F77 = @ac_ct_F77@
183ac_ct_RANLIB = @ac_ct_RANLIB@ 183ac_ct_RANLIB = @ac_ct_RANLIB@
184ac_ct_STRIP = @ac_ct_STRIP@ 184ac_ct_STRIP = @ac_ct_STRIP@
185am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ 185am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
186am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ 186am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
187am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ 187am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
188am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 188am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
189am__include = @am__include@ 189am__include = @am__include@
190am__leading_dot = @am__leading_dot@ 190am__leading_dot = @am__leading_dot@
191am__quote = @am__quote@ 191am__quote = @am__quote@
192am__tar = @am__tar@ 192am__tar = @am__tar@
193am__untar = @am__untar@ 193am__untar = @am__untar@
194bindir = @bindir@ 194bindir = @bindir@
195build = @build@ 195build = @build@
196build_alias = @build_alias@ 196build_alias = @build_alias@
197build_cpu = @build_cpu@ 197build_cpu = @build_cpu@
198build_os = @build_os@ 198build_os = @build_os@
199build_vendor = @build_vendor@ 199build_vendor = @build_vendor@
200datadir = @datadir@ 200datadir = @datadir@
201exec_prefix = @exec_prefix@ 201exec_prefix = @exec_prefix@
202host = @host@ 202host = @host@
203host_alias = @host_alias@ 203host_alias = @host_alias@
204host_cpu = @host_cpu@ 204host_cpu = @host_cpu@
205host_os = @host_os@ 205host_os = @host_os@
206host_vendor = @host_vendor@ 206host_vendor = @host_vendor@
207includedir = @includedir@ 207includedir = @includedir@
208infodir = @infodir@ 208infodir = @infodir@
209install_sh = @install_sh@ 209install_sh = @install_sh@
210libdir = @libdir@ 210libdir = @libdir@
211libexecdir = @libexecdir@ 211libexecdir = @libexecdir@
212localstatedir = @localstatedir@ 212localstatedir = @localstatedir@
213mandir = @mandir@ 213mandir = @mandir@
214mkdir_p = @mkdir_p@ 214mkdir_p = @mkdir_p@
215oldincludedir = @oldincludedir@ 215oldincludedir = @oldincludedir@
216prefix = @prefix@ 216prefix = @prefix@
217program_transform_name = @program_transform_name@ 217program_transform_name = @program_transform_name@
218sbindir = @sbindir@ 218sbindir = @sbindir@
219sharedstatedir = @sharedstatedir@ 219sharedstatedir = @sharedstatedir@
220sysconfdir = @sysconfdir@ 220sysconfdir = @sysconfdir@
221target = @target@ 221target = @target@
222target_alias = @target_alias@ 222target_alias = @target_alias@
223target_cpu = @target_cpu@ 223target_cpu = @target_cpu@
224target_os = @target_os@ 224target_os = @target_os@
225target_vendor = @target_vendor@ 225target_vendor = @target_vendor@
226INCLUDES = -I$(top_srcdir)/src 226INCLUDES = -I$(top_srcdir)/src
227ASFLAGS = @MPI_SFLAGS@ 227ASFLAGS = @MPI_SFLAGS@
228AM_CCASFLAGS = $(NOEXECSTACK_FLAGS) 228AM_CCASFLAGS = $(NOEXECSTACK_FLAGS)
229 229
230# We don't have .S sources listed, so automake does not autocreate these 230# We don't have .S sources listed, so automake does not autocreate these
231CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) 231CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
232LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) 232LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)
233EXTRA_DIST = Manifest config.links 233EXTRA_DIST = Manifest config.links
234DISTCLEANFILES = mpi-asm-defs.h \ 234DISTCLEANFILES = mpi-asm-defs.h \
235 mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S \ 235 mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S \
236 mpih-lshift.S mpih-rshift.S mpih-sub1.S asm-syntax.h sysdep.h 236 mpih-lshift.S mpih-rshift.S mpih-sub1.S asm-syntax.h sysdep.h
237 237
238# Note: we only use .S files so we should delete all left over .s 238# Note: we only use .S files so we should delete all left over .s
239CLEANFILES = _*.s __*.s 239CLEANFILES = _*.s __*.s
240 240
241# Beware: The following list is not a comment but grepped by 241# Beware: The following list is not a comment but grepped by
242# config.links to get the list of symlinked modules 242# config.links to get the list of symlinked modules
243# Optional modules are marked with a 0 in the second column. 243# Optional modules are marked with a 0 in the second column.
244#BEGIN_ASM_LIST 244#BEGIN_ASM_LIST
245# mpih-add1 C 245# mpih-add1 C
246# mpih-sub1 C 246# mpih-sub1 C
247# mpih-mul1 C 247# mpih-mul1 C
248# mpih-mul2 C 248# mpih-mul2 C
249# mpih-mul3 C 249# mpih-mul3 C
250# mpih-lshift C 250# mpih-lshift C
251# mpih-rshift C 251# mpih-rshift C
252# udiv O 252# udiv O
253# udiv-qrnnd O 253# udiv-qrnnd O
254#END_ASM_LIST 254#END_ASM_LIST
255 255
256# Note: This function has not yet been implemented. There is only a dummy in 256# Note: This function has not yet been implemented. There is only a dummy in
257# generic/ 257# generic/
258# udiv-w-sdiv O 258# udiv-w-sdiv O
259 259
260# And we need to have conditionals for all modules because 260# And we need to have conditionals for all modules because
261# we don't know whether they are .c or .S. Very ugly; I know. 261# we don't know whether they are .c or .S. Very ugly; I know.
262# Remember to define them all in configure.ac 262# Remember to define them all in configure.ac
263# if MPI_MOD_ASM_MPIH_ADD1 263# if MPI_MOD_ASM_MPIH_ADD1
264# mpih_add1 = mpih-add1.S 264# mpih_add1 = mpih-add1.S
265# else 265# else
266# if MPI_MOD_C_MPIH_ADD1 266# if MPI_MOD_C_MPIH_ADD1
267# mpih_add1 = mpih-add1.c 267# mpih_add1 = mpih-add1.c
268# else 268# else
269# mpih_add1 = 269# mpih_add1 =
270# endif 270# endif
271# endif 271# endif
272# 272#
273# if MPI_MOD_ASM_MPIH_SUB1 273# if MPI_MOD_ASM_MPIH_SUB1
274# mpih_sub1 = mpih-sub1.S 274# mpih_sub1 = mpih-sub1.S
275# else 275# else
276# if MPI_MOD_C_MPIH_SUB1 276# if MPI_MOD_C_MPIH_SUB1
277# mpih_sub1 = mpih-sub1.c 277# mpih_sub1 = mpih-sub1.c
278# else 278# else
279# mpih_sub1 = 279# mpih_sub1 =
280# endif 280# endif
281# endif 281# endif
282# 282#
283# if MPI_MOD_ASM_MPIH_MUL1 283# if MPI_MOD_ASM_MPIH_MUL1
284# mpih_mul1 = mpih-mul1.S 284# mpih_mul1 = mpih-mul1.S
285# else 285# else
286# if MPI_MOD_C_MPIH_MUL1 286# if MPI_MOD_C_MPIH_MUL1
287# mpih_mul1 = mpih-mul1.c 287# mpih_mul1 = mpih-mul1.c
288# else 288# else
289# mpih_mul1 = 289# mpih_mul1 =
290# endif 290# endif
291# endif 291# endif
292# 292#
293# if MPI_MOD_ASM_MPIH_MUL2 293# if MPI_MOD_ASM_MPIH_MUL2
294# mpih_mul2 = mpih-mul2.S 294# mpih_mul2 = mpih-mul2.S
295# else 295# else
296# if MPI_MOD_C_MPIH_MUL2 296# if MPI_MOD_C_MPIH_MUL2
297# mpih_mul2 = mpih-mul2.c 297# mpih_mul2 = mpih-mul2.c
298# else 298# else
299# mpih_mul2 = 299# mpih_mul2 =
300# endif 300# endif
301# endif 301# endif
302# 302#
303# if MPI_MOD_ASM_MPIH_MUL3 303# if MPI_MOD_ASM_MPIH_MUL3
304# mpih_mul3 = mpih-mul3.S 304# mpih_mul3 = mpih-mul3.S
305# else 305# else
306# if MPI_MOD_C_MPIH_MUL3 306# if MPI_MOD_C_MPIH_MUL3
307# mpih_mul3 = mpih-mul3.c 307# mpih_mul3 = mpih-mul3.c
308# else 308# else
309# mpih_mul3 = 309# mpih_mul3 =
310# endif 310# endif
311# endif 311# endif
312# 312#
313# if MPI_MOD_ASM_MPIH_LSHIFT 313# if MPI_MOD_ASM_MPIH_LSHIFT
314# mpih_lshift = mpih-lshift.S 314# mpih_lshift = mpih-lshift.S
315# else 315# else
316# if MPI_MOD_C_MPIH_LSHIFT 316# if MPI_MOD_C_MPIH_LSHIFT
317# mpih_lshift = mpih-lshift.c 317# mpih_lshift = mpih-lshift.c
318# else 318# else
319# mpih_lshift = 319# mpih_lshift =
320# endif 320# endif
321# endif 321# endif
322# 322#
323# if MPI_MOD_ASM_MPIH_RSHIFT 323# if MPI_MOD_ASM_MPIH_RSHIFT
324# mpih_rshift = mpih-rshift.S 324# mpih_rshift = mpih-rshift.S
325# else 325# else
326# if MPI_MOD_C_MPIH_RSHIFT 326# if MPI_MOD_C_MPIH_RSHIFT
327# mpih_rshift = mpih-rshift.c 327# mpih_rshift = mpih-rshift.c
328# else 328# else
329# mpih_rshift = 329# mpih_rshift =
330# endif 330# endif
331# endif 331# endif
332# 332#
333# if MPI_MOD_ASM_UDIV 333# if MPI_MOD_ASM_UDIV
334# udiv = udiv.S 334# udiv = udiv.S
335# else 335# else
336# if MPI_MOD_C_UDIV 336# if MPI_MOD_C_UDIV
337# udiv = udiv.c 337# udiv = udiv.c
338# else 338# else
339# udiv = 339# udiv =
340# endif 340# endif
341# endif 341# endif
342# 342#
343# if MPI_MOD_ASM_UDIV_QRNND 343# if MPI_MOD_ASM_UDIV_QRNND
344# udiv_qrnnd = udiv-qrnnd.S 344# udiv_qrnnd = udiv-qrnnd.S
345# else 345# else
346# if MPI_MOD_C_UDIV_QRNND 346# if MPI_MOD_C_UDIV_QRNND
347# udiv_qrnnd = udiv-qrnnd.c 347# udiv_qrnnd = udiv-qrnnd.c
348# else 348# else
349# udiv_qrnnd = 349# udiv_qrnnd =
350# endif 350# endif
351# endif 351# endif
352noinst_LTLIBRARIES = libmpi.la 352noinst_LTLIBRARIES = libmpi.la
353AM_CFLAGS = @GPG_ERROR_CFLAGS@ 353AM_CFLAGS = @GPG_ERROR_CFLAGS@
354libmpi_la_LDFLAGS = 354libmpi_la_LDFLAGS =
355libmpi_la_SOURCES = longlong.h \ 355libmpi_la_SOURCES = longlong.h \
356 mpi-add.c \ 356 mpi-add.c \
357 mpi-bit.c \ 357 mpi-bit.c \
358 mpi-cmp.c \ 358 mpi-cmp.c \
359 mpi-div.c \ 359 mpi-div.c \
360 mpi-gcd.c \ 360 mpi-gcd.c \
361 mpi-internal.h \ 361 mpi-internal.h \
362 mpi-inline.h \ 362 mpi-inline.h \
363 mpi-inline.c \ 363 mpi-inline.c \
364 mpi-inv.c \ 364 mpi-inv.c \
365 mpi-mul.c \ 365 mpi-mul.c \
366 mpi-pow.c \ 366 mpi-pow.c \
367 mpi-mpow.c \ 367 mpi-mpow.c \
368 mpi-scan.c \ 368 mpi-scan.c \
369 mpicoder.c \ 369 mpicoder.c \
370 mpih-div.c \ 370 mpih-div.c \
371 mpih-mul.c \ 371 mpih-mul.c \
372 mpiutil.c 372 mpiutil.c
373 373
374libmpi_la_LIBADD = @MPI_MOD_LIST_LO@ 374libmpi_la_LIBADD = @MPI_MOD_LIST_LO@
375libmpi_la_DEPENDENCIES = @MPI_MOD_LIST_LO@ 375libmpi_la_DEPENDENCIES = @MPI_MOD_LIST_LO@
376 376
377# Because we are circumventing automake with regards to assembler 377# Because we are circumventing automake with regards to assembler
378# files, we have to define our own rules. 378# files, we have to define our own rules.
379SUFFIXES = .S .o .obj .lo 379SUFFIXES = .S .o .obj .lo
380all: all-am 380all: all-am
381 381
382.SUFFIXES: 382.SUFFIXES:
383.SUFFIXES: .S .o .obj .lo .c 383.SUFFIXES: .S .o .obj .lo .c
384$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) 384$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
385 @for dep in $?; do \ 385 @for dep in $?; do \
386 case '$(am__configure_deps)' in \ 386 case '$(am__configure_deps)' in \
387 *$$dep*) \ 387 *$$dep*) \
388 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ 388 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
389 && exit 0; \ 389 && exit 0; \
390 exit 1;; \ 390 exit 1;; \
391 esac; \ 391 esac; \
392 done; \ 392 done; \
393 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu mpi/Makefile'; \ 393 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu mpi/Makefile'; \
394 cd $(top_srcdir) && \ 394 cd $(top_srcdir) && \
395 $(AUTOMAKE) --gnu mpi/Makefile 395 $(AUTOMAKE) --gnu mpi/Makefile
396.PRECIOUS: Makefile 396.PRECIOUS: Makefile
397Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 397Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
398 @case '$?' in \ 398 @case '$?' in \
399 *config.status*) \ 399 *config.status*) \
400 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ 400 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
401 *) \ 401 *) \
402 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ 402 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
403 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 403 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
404 esac; 404 esac;
405 405
406$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 406$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
407 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 407 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
408 408
409$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 409$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
410 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 410 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
411$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) 411$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
412 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 412 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
413 413
414clean-noinstLTLIBRARIES: 414clean-noinstLTLIBRARIES:
415 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) 415 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
416 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ 416 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
417 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ 417 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
418 test "$$dir" != "$$p" || dir=.; \ 418 test "$$dir" != "$$p" || dir=.; \
419 echo "rm -f \"$${dir}/so_locations\""; \ 419 echo "rm -f \"$${dir}/so_locations\""; \
420 rm -f "$${dir}/so_locations"; \ 420 rm -f "$${dir}/so_locations"; \
421 done 421 done
422libmpi.la: $(libmpi_la_OBJECTS) $(libmpi_la_DEPENDENCIES) 422libmpi.la: $(libmpi_la_OBJECTS) $(libmpi_la_DEPENDENCIES)
423 $(LINK) $(libmpi_la_LDFLAGS) $(libmpi_la_OBJECTS) $(libmpi_la_LIBADD) $(LIBS) 423 $(LINK) $(libmpi_la_LDFLAGS) $(libmpi_la_OBJECTS) $(libmpi_la_LIBADD) $(LIBS)
424 424
425mostlyclean-compile: 425mostlyclean-compile:
426 -rm -f *.$(OBJEXT) 426 -rm -f *.$(OBJEXT)
427 427
428distclean-compile: 428distclean-compile:
429 -rm -f *.tab.c 429 -rm -f *.tab.c
430 430
431@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-add.Plo@am__quote@ 431@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-add.Plo@am__quote@
432@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-bit.Plo@am__quote@ 432@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-bit.Plo@am__quote@
433@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-cmp.Plo@am__quote@ 433@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-cmp.Plo@am__quote@
434@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-div.Plo@am__quote@ 434@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-div.Plo@am__quote@
435@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-gcd.Plo@am__quote@ 435@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-gcd.Plo@am__quote@
436@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-inline.Plo@am__quote@ 436@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-inline.Plo@am__quote@
437@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-inv.Plo@am__quote@ 437@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-inv.Plo@am__quote@
438@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-mpow.Plo@am__quote@ 438@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-mpow.Plo@am__quote@
439@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-mul.Plo@am__quote@ 439@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-mul.Plo@am__quote@
440@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-pow.Plo@am__quote@ 440@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-pow.Plo@am__quote@
441@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-scan.Plo@am__quote@ 441@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi-scan.Plo@am__quote@
442@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpicoder.Plo@am__quote@ 442@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpicoder.Plo@am__quote@
443@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpih-div.Plo@am__quote@ 443@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpih-div.Plo@am__quote@
444@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpih-mul.Plo@am__quote@ 444@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpih-mul.Plo@am__quote@
445@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpiutil.Plo@am__quote@ 445@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpiutil.Plo@am__quote@
446 446
447.c.o: 447.c.o:
448@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ 448@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
449@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 449@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
450@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 450@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
451@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 451@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
452@am__fastdepCC_FALSE@ $(COMPILE) -c $< 452@am__fastdepCC_FALSE@ $(COMPILE) -c $<
453 453
454.c.obj: 454.c.obj:
455@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ 455@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
456@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 456@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
457@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 457@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
458@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 458@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
459@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 459@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
460 460
461.c.lo: 461.c.lo:
462@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ 462@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
463@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi 463@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
464@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 464@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
465@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 465@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
466@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< 466@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
467 467
468mostlyclean-libtool: 468mostlyclean-libtool:
469 -rm -f *.lo 469 -rm -f *.lo
470 470
471clean-libtool: 471clean-libtool:
472 -rm -rf .libs _libs 472 -rm -rf .libs _libs
473 473
474distclean-libtool: 474distclean-libtool:
475 -rm -f libtool 475 -rm -f libtool
476uninstall-info-am: 476uninstall-info-am:
477 477
478ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 478ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
479 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 479 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
480 unique=`for i in $$list; do \ 480 unique=`for i in $$list; do \
481 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 481 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
482 done | \ 482 done | \
483 $(AWK) ' { files[$$0] = 1; } \ 483 $(AWK) ' { files[$$0] = 1; } \
484 END { for (i in files) print i; }'`; \ 484 END { for (i in files) print i; }'`; \
485 mkid -fID $$unique 485 mkid -fID $$unique
486tags: TAGS 486tags: TAGS
487 487
488TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 488TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
489 $(TAGS_FILES) $(LISP) 489 $(TAGS_FILES) $(LISP)
490 tags=; \ 490 tags=; \
491 here=`pwd`; \ 491 here=`pwd`; \
492 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 492 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
493 unique=`for i in $$list; do \ 493 unique=`for i in $$list; do \
494 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 494 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
495 done | \ 495 done | \
496 $(AWK) ' { files[$$0] = 1; } \ 496 $(AWK) ' { files[$$0] = 1; } \
497 END { for (i in files) print i; }'`; \ 497 END { for (i in files) print i; }'`; \
498 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ 498 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
499 test -n "$$unique" || unique=$$empty_fix; \ 499 test -n "$$unique" || unique=$$empty_fix; \
500 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 500 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
501 $$tags $$unique; \ 501 $$tags $$unique; \
502 fi 502 fi
503ctags: CTAGS 503ctags: CTAGS
504CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ 504CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
505 $(TAGS_FILES) $(LISP) 505 $(TAGS_FILES) $(LISP)
506 tags=; \ 506 tags=; \
507 here=`pwd`; \ 507 here=`pwd`; \
508 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 508 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
509 unique=`for i in $$list; do \ 509 unique=`for i in $$list; do \
510 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 510 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
511 done | \ 511 done | \
512 $(AWK) ' { files[$$0] = 1; } \ 512 $(AWK) ' { files[$$0] = 1; } \
513 END { for (i in files) print i; }'`; \ 513 END { for (i in files) print i; }'`; \
514 test -z "$(CTAGS_ARGS)$$tags$$unique" \ 514 test -z "$(CTAGS_ARGS)$$tags$$unique" \
515 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 515 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
516 $$tags $$unique 516 $$tags $$unique
517 517
518GTAGS: 518GTAGS:
519 here=`$(am__cd) $(top_builddir) && pwd` \ 519 here=`$(am__cd) $(top_builddir) && pwd` \
520 && cd $(top_srcdir) \ 520 && cd $(top_srcdir) \
521 && gtags -i $(GTAGS_ARGS) $$here 521 && gtags -i $(GTAGS_ARGS) $$here
522 522
523distclean-tags: 523distclean-tags:
524 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 524 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
525 525
526distdir: $(DISTFILES) 526distdir: $(DISTFILES)
527 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 527 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
528 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ 528 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
529 list='$(DISTFILES)'; for file in $$list; do \ 529 list='$(DISTFILES)'; for file in $$list; do \
530 case $$file in \ 530 case $$file in \
531 $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ 531 $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
532 $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ 532 $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
533 esac; \ 533 esac; \
534 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 534 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
535 dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ 535 dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
536 if test "$$dir" != "$$file" && test "$$dir" != "."; then \ 536 if test "$$dir" != "$$file" && test "$$dir" != "."; then \
537 dir="/$$dir"; \ 537 dir="/$$dir"; \
538 $(mkdir_p) "$(distdir)$$dir"; \ 538 $(mkdir_p) "$(distdir)$$dir"; \
539 else \ 539 else \
540 dir=''; \ 540 dir=''; \
541 fi; \ 541 fi; \
542 if test -d $$d/$$file; then \ 542 if test -d $$d/$$file; then \
543 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 543 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
544 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ 544 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
545 fi; \ 545 fi; \
546 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ 546 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
547 else \ 547 else \
548 test -f $(distdir)/$$file \ 548 test -f $(distdir)/$$file \
549 || cp -p $$d/$$file $(distdir)/$$file \ 549 || cp -p $$d/$$file $(distdir)/$$file \
550 || exit 1; \ 550 || exit 1; \
551 fi; \ 551 fi; \
552 done 552 done
553check-am: all-am 553check-am: all-am
554check: check-am 554check: check-am
555all-am: Makefile $(LTLIBRARIES) 555all-am: Makefile $(LTLIBRARIES)
556installdirs: 556installdirs:
557install: install-am 557install: install-am
558install-exec: install-exec-am 558install-exec: install-exec-am
559install-data: install-data-am 559install-data: install-data-am
560uninstall: uninstall-am 560uninstall: uninstall-am
561 561
562install-am: all-am 562install-am: all-am
563 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 563 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
564 564
565installcheck: installcheck-am 565installcheck: installcheck-am
566install-strip: 566install-strip:
567 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 567 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
568 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 568 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
569 `test -z '$(STRIP)' || \ 569 `test -z '$(STRIP)' || \
570 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 570 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
571mostlyclean-generic: 571mostlyclean-generic:
572 572
573clean-generic: 573clean-generic:
574 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 574 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
575 575
576distclean-generic: 576distclean-generic:
577 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 577 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
578 -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 578 -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
579 579
580maintainer-clean-generic: 580maintainer-clean-generic:
581 @echo "This command is intended for maintainers to use" 581 @echo "This command is intended for maintainers to use"
582 @echo "it deletes files that may require special tools to rebuild." 582 @echo "it deletes files that may require special tools to rebuild."
583clean: clean-am 583clean: clean-am
584 584
585clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ 585clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
586 mostlyclean-am 586 mostlyclean-am
587 587
588distclean: distclean-am 588distclean: distclean-am
589 -rm -rf ./$(DEPDIR) 589 -rm -rf ./$(DEPDIR)
590 -rm -f Makefile 590 -rm -f Makefile
591distclean-am: clean-am distclean-compile distclean-generic \ 591distclean-am: clean-am distclean-compile distclean-generic \
592 distclean-libtool distclean-tags 592 distclean-libtool distclean-tags
593 593
594dvi: dvi-am 594dvi: dvi-am
595 595
596dvi-am: 596dvi-am:
597 597
598html: html-am 598html: html-am
599 599
600info: info-am 600info: info-am
601 601
602info-am: 602info-am:
603 603
604install-data-am: 604install-data-am:
605 605
606install-exec-am: 606install-exec-am:
607 607
608install-info: install-info-am 608install-info: install-info-am
609 609
610install-man: 610install-man:
611 611
612installcheck-am: 612installcheck-am:
613 613
614maintainer-clean: maintainer-clean-am 614maintainer-clean: maintainer-clean-am
615 -rm -rf ./$(DEPDIR) 615 -rm -rf ./$(DEPDIR)
616 -rm -f Makefile 616 -rm -f Makefile
617maintainer-clean-am: distclean-am maintainer-clean-generic 617maintainer-clean-am: distclean-am maintainer-clean-generic
618 618
619mostlyclean: mostlyclean-am 619mostlyclean: mostlyclean-am
620 620
621mostlyclean-am: mostlyclean-compile mostlyclean-generic \ 621mostlyclean-am: mostlyclean-compile mostlyclean-generic \
622 mostlyclean-libtool 622 mostlyclean-libtool
623 623
624pdf: pdf-am 624pdf: pdf-am
625 625
626pdf-am: 626pdf-am:
627 627
628ps: ps-am 628ps: ps-am
629 629
630ps-am: 630ps-am:
631 631
632uninstall-am: uninstall-info-am 632uninstall-am: uninstall-info-am
633 633
634.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ 634.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
635 clean-libtool clean-noinstLTLIBRARIES ctags distclean \ 635 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
636 distclean-compile distclean-generic distclean-libtool \ 636 distclean-compile distclean-generic distclean-libtool \
637 distclean-tags distdir dvi dvi-am html html-am info info-am \ 637 distclean-tags distdir dvi dvi-am html html-am info info-am \
638 install install-am install-data install-data-am install-exec \ 638 install install-am install-data install-data-am install-exec \
639 install-exec-am install-info install-info-am install-man \ 639 install-exec-am install-info install-info-am install-man \
640 install-strip installcheck installcheck-am installdirs \ 640 install-strip installcheck installcheck-am installdirs \
641 maintainer-clean maintainer-clean-generic mostlyclean \ 641 maintainer-clean maintainer-clean-generic mostlyclean \
642 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ 642 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
643 pdf pdf-am ps ps-am tags uninstall uninstall-am \ 643 pdf pdf-am ps ps-am tags uninstall uninstall-am \
644 uninstall-info-am 644 uninstall-info-am
645 645
646 646
647.S.o: 647.S.o:
648 $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< 648 $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
649 649
650.S.obj: 650.S.obj:
651 $(CCASCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` 651 $(CCASCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
652 652
653.S.lo: 653.S.lo:
654 $(LTCCASCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< 654 $(LTCCASCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
655# Tell versions [3.59,3.63) of GNU make to not export all variables. 655# Tell versions [3.59,3.63) of GNU make to not export all variables.
656# Otherwise a system limit (for SysV at least) may be exceeded. 656# Otherwise a system limit (for SysV at least) may be exceeded.
657.NOEXPORT: 657.NOEXPORT:
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Manifest
index b68883e..3b0d673 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/Manifest
@@ -1,41 +1,41 @@
1# Manifest - checksums of the mpi directory 1# Manifest - checksums of the mpi directory
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser general Public License as 7# it under the terms of the GNU Lesser general Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20Makefile.am 20Makefile.am
21config.links 21config.links
22longlong.h 22longlong.h
23mpi-add.c 23mpi-add.c
24mpi-bit.c 24mpi-bit.c
25mpi-cmp.c 25mpi-cmp.c
26mpi-div.c 26mpi-div.c
27mpi-gcd.c 27mpi-gcd.c
28mpi-inline.c 28mpi-inline.c
29mpi-inline.h 29mpi-inline.h
30mpi-internal.h 30mpi-internal.h
31mpi-inv.c 31mpi-inv.c
32mpi-mpow.c 32mpi-mpow.c
33mpi-mul.c 33mpi-mul.c
34mpi-pow.c 34mpi-pow.c
35mpi-scan.c 35mpi-scan.c
36mpicoder.c 36mpicoder.c
37mpih-div.c 37mpih-div.c
38mpih-mul.c 38mpih-mul.c
39mpiutil.c 39mpiutil.c
40$names$ iQCVAwUAP+LmfDEAnp832S/7AQKZJQQAkR/gQITUM+6Ygy9WAOAO17btyKAlCtGTXp5XSZ+J3X0o/rYneRdSCW89IJvwFRJjAOcFJd52MXs6ZVFF/RQBC8MvJzuQChbEzvihK8o2VgK34YWjU+6XH9sFgRMIgzkHs/51ZZxeQUOPy1XF7TyKB0WE7YBUVisFiRaqB1qGIOs==Z3qB 40$names$ iQCVAwUAP+LmfDEAnp832S/7AQKZJQQAkR/gQITUM+6Ygy9WAOAO17btyKAlCtGTXp5XSZ+J3X0o/rYneRdSCW89IJvwFRJjAOcFJd52MXs6ZVFF/RQBC8MvJzuQChbEzvihK8o2VgK34YWjU+6XH9sFgRMIgzkHs/51ZZxeQUOPy1XF7TyKB0WE7YBUVisFiRaqB1qGIOs==Z3qB
41 41
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/README b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/README
index 93d433c..55c0a29 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/README
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/README
@@ -1,53 +1,53 @@
1This directory contains mpn functions optimized for DEC Alpha processors. 1This directory contains mpn functions optimized for DEC Alpha processors.
2 2
3RELEVANT OPTIMIZATION ISSUES 3RELEVANT OPTIMIZATION ISSUES
4 4
5EV4 5EV4
6 6
71. This chip has very limited store bandwidth. The on-chip L1 cache is 71. This chip has very limited store bandwidth. The on-chip L1 cache is
8write-through, and a cache line is transfered from the store buffer to the 8write-through, and a cache line is transfered from the store buffer to the
9off-chip L2 in as much 15 cycles on most systems. This delay hurts 9off-chip L2 in as much 15 cycles on most systems. This delay hurts
10mpn_add_n, mpn_sub_n, mpn_lshift, and mpn_rshift. 10mpn_add_n, mpn_sub_n, mpn_lshift, and mpn_rshift.
11 11
122. Pairing is possible between memory instructions and integer arithmetic 122. Pairing is possible between memory instructions and integer arithmetic
13instructions. 13instructions.
14 14
153. mulq and umulh is documented to have a latency of 23 cycles, but 2 of 153. mulq and umulh is documented to have a latency of 23 cycles, but 2 of
16these cycles are pipelined. Thus, multiply instructions can be issued at a 16these cycles are pipelined. Thus, multiply instructions can be issued at a
17rate of one each 21nd cycle. 17rate of one each 21nd cycle.
18 18
19EV5 19EV5
20 20
211. The memory bandwidth of this chip seems excellent, both for loads and 211. The memory bandwidth of this chip seems excellent, both for loads and
22stores. Even when the working set is larger than the on-chip L1 and L2 22stores. Even when the working set is larger than the on-chip L1 and L2
23caches, the perfromance remain almost unaffected. 23caches, the perfromance remain almost unaffected.
24 24
252. mulq has a measured latency of 13 cycles and an issue rate of 1 each 8th 252. mulq has a measured latency of 13 cycles and an issue rate of 1 each 8th
26cycle. umulh has a measured latency of 15 cycles and an issue rate of 1 26cycle. umulh has a measured latency of 15 cycles and an issue rate of 1
27each 10th cycle. But the exact timing is somewhat confusing. 27each 10th cycle. But the exact timing is somewhat confusing.
28 28
293. mpn_add_n. With 4-fold unrolling, we need 37 instructions, whereof 12 293. mpn_add_n. With 4-fold unrolling, we need 37 instructions, whereof 12
30 are memory operations. This will take at least 30 are memory operations. This will take at least
31 ceil(37/2) [dual issue] + 1 [taken branch] = 20 cycles 31 ceil(37/2) [dual issue] + 1 [taken branch] = 20 cycles
32 We have 12 memory cycles, plus 4 after-store conflict cycles, or 16 data 32 We have 12 memory cycles, plus 4 after-store conflict cycles, or 16 data
33 cache cycles, which should be completely hidden in the 20 issue cycles. 33 cache cycles, which should be completely hidden in the 20 issue cycles.
34 The computation is inherently serial, with these dependencies: 34 The computation is inherently serial, with these dependencies:
35 addq 35 addq
36 / \ 36 / \
37 addq cmpult 37 addq cmpult
38 | | 38 | |
39 cmpult | 39 cmpult |
40 \ / 40 \ /
41 or 41 or
42 I.e., there is a 4 cycle path for each limb, making 16 cycles the absolute 42 I.e., there is a 4 cycle path for each limb, making 16 cycles the absolute
43 minimum. We could replace the `or' with a cmoveq/cmovne, which would save 43 minimum. We could replace the `or' with a cmoveq/cmovne, which would save
44 a cycle on EV5, but that might waste a cycle on EV4. Also, cmov takes 2 44 a cycle on EV5, but that might waste a cycle on EV4. Also, cmov takes 2
45 cycles. 45 cycles.
46 addq 46 addq
47 / \ 47 / \
48 addq cmpult 48 addq cmpult
49 | \ 49 | \
50 cmpult -> cmovne 50 cmpult -> cmovne
51 51
52STATUS 52STATUS
53 53
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/distfiles
index e03e462..f2ab9fc 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/distfiles
@@ -1,11 +1,11 @@
1README 1README
2mpih-add1.S 2mpih-add1.S
3mpih-sub1.S 3mpih-sub1.S
4mpih-mul1.S 4mpih-mul1.S
5mpih-mul2.S 5mpih-mul2.S
6mpih-mul3.S 6mpih-mul3.S
7mpih-lshift.S 7mpih-lshift.S
8mpih-rshift.S 8mpih-rshift.S
9 9
10udiv-qrnnd.S 10udiv-qrnnd.S
11 11
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-add1.S
index 070340d..50dbb2b 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-add1.S
@@ -1,124 +1,124 @@
1/* alpha add_n -- Add two limb vectors of the same length > 0 and store 1/* alpha 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 * Copyright (C) 1995, 1998, 2001, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1995, 1998, 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */ 20 */
21 21
22 22
23 23
24/******************* 24/*******************
25 * mpi_limb_t 25 * mpi_limb_t
26 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, ($16) 26 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, ($16)
27 * mpi_ptr_t s1_ptr, ($17) 27 * mpi_ptr_t s1_ptr, ($17)
28 * mpi_ptr_t s2_ptr, ($18) 28 * mpi_ptr_t s2_ptr, ($18)
29 * mpi_size_t size) ($19) 29 * mpi_size_t size) ($19)
30 */ 30 */
31 31
32 32
33 .set noreorder 33 .set noreorder
34 .set noat 34 .set noat
35.text 35.text
36 .align 3 36 .align 3
37 .globl _gcry_mpih_add_n 37 .globl _gcry_mpih_add_n
38 .ent _gcry_mpih_add_n 38 .ent _gcry_mpih_add_n
39_gcry_mpih_add_n: 39_gcry_mpih_add_n:
40 .frame $30,0,$26,0 40 .frame $30,0,$26,0
41 41
42 ldq $3,0($17) 42 ldq $3,0($17)
43 ldq $4,0($18) 43 ldq $4,0($18)
44 44
45 subq $19,1,$19 45 subq $19,1,$19
46 and $19,4-1,$2 # number of limbs in first loop 46 and $19,4-1,$2 # number of limbs in first loop
47 bis $31,$31,$0 47 bis $31,$31,$0
48 beq $2,.L0 # if multiple of 4 limbs, skip first loop 48 beq $2,.L0 # if multiple of 4 limbs, skip first loop
49 49
50 subq $19,$2,$19 50 subq $19,$2,$19
51 51
52.Loop0: subq $2,1,$2 52.Loop0: subq $2,1,$2
53 ldq $5,8($17) 53 ldq $5,8($17)
54 addq $4,$0,$4 54 addq $4,$0,$4
55 ldq $6,8($18) 55 ldq $6,8($18)
56 cmpult $4,$0,$1 56 cmpult $4,$0,$1
57 addq $3,$4,$4 57 addq $3,$4,$4
58 cmpult $4,$3,$0 58 cmpult $4,$3,$0
59 stq $4,0($16) 59 stq $4,0($16)
60 or $0,$1,$0 60 or $0,$1,$0
61 61
62 addq $17,8,$17 62 addq $17,8,$17
63 addq $18,8,$18 63 addq $18,8,$18
64 bis $5,$5,$3 64 bis $5,$5,$3
65 bis $6,$6,$4 65 bis $6,$6,$4
66 addq $16,8,$16 66 addq $16,8,$16
67 bne $2,.Loop0 67 bne $2,.Loop0
68 68
69.L0: beq $19,.Lend 69.L0: beq $19,.Lend
70 70
71 .align 3 71 .align 3
72.Loop: subq $19,4,$19 72.Loop: subq $19,4,$19
73 73
74 ldq $5,8($17) 74 ldq $5,8($17)
75 addq $4,$0,$4 75 addq $4,$0,$4
76 ldq $6,8($18) 76 ldq $6,8($18)
77 cmpult $4,$0,$1 77 cmpult $4,$0,$1
78 addq $3,$4,$4 78 addq $3,$4,$4
79 cmpult $4,$3,$0 79 cmpult $4,$3,$0
80 stq $4,0($16) 80 stq $4,0($16)
81 or $0,$1,$0 81 or $0,$1,$0
82 82
83 ldq $3,16($17) 83 ldq $3,16($17)
84 addq $6,$0,$6 84 addq $6,$0,$6
85 ldq $4,16($18) 85 ldq $4,16($18)
86 cmpult $6,$0,$1 86 cmpult $6,$0,$1
87 addq $5,$6,$6 87 addq $5,$6,$6
88 cmpult $6,$5,$0 88 cmpult $6,$5,$0
89 stq $6,8($16) 89 stq $6,8($16)
90 or $0,$1,$0 90 or $0,$1,$0
91 91
92 ldq $5,24($17) 92 ldq $5,24($17)
93 addq $4,$0,$4 93 addq $4,$0,$4
94 ldq $6,24($18) 94 ldq $6,24($18)
95 cmpult $4,$0,$1 95 cmpult $4,$0,$1
96 addq $3,$4,$4 96 addq $3,$4,$4
97 cmpult $4,$3,$0 97 cmpult $4,$3,$0
98 stq $4,16($16) 98 stq $4,16($16)
99 or $0,$1,$0 99 or $0,$1,$0
100 100
101 ldq $3,32($17) 101 ldq $3,32($17)
102 addq $6,$0,$6 102 addq $6,$0,$6
103 ldq $4,32($18) 103 ldq $4,32($18)
104 cmpult $6,$0,$1 104 cmpult $6,$0,$1
105 addq $5,$6,$6 105 addq $5,$6,$6
106 cmpult $6,$5,$0 106 cmpult $6,$5,$0
107 stq $6,24($16) 107 stq $6,24($16)
108 or $0,$1,$0 108 or $0,$1,$0
109 109
110 addq $17,32,$17 110 addq $17,32,$17
111 addq $18,32,$18 111 addq $18,32,$18
112 addq $16,32,$16 112 addq $16,32,$16
113 bne $19,.Loop 113 bne $19,.Loop
114 114
115.Lend: addq $4,$0,$4 115.Lend: addq $4,$0,$4
116 cmpult $4,$0,$1 116 cmpult $4,$0,$1
117 addq $3,$4,$4 117 addq $3,$4,$4
118 cmpult $4,$3,$0 118 cmpult $4,$3,$0
119 stq $4,0($16) 119 stq $4,0($16)
120 or $0,$1,$0 120 or $0,$1,$0
121 ret $31,($26),1 121 ret $31,($26),1
122 122
123 .end _gcry_mpih_add_n 123 .end _gcry_mpih_add_n
124 124
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-lshift.S
index b3beb45..ded4b15 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-lshift.S
@@ -1,122 +1,122 @@
1/* alpha - left shift 1/* alpha - left shift
2 * 2 *
3 * Copyright (C) 1994, 1995, 1998, 2001, 3 * Copyright (C) 1994, 1995, 1998, 2001,
4 * 2002 Free Software Foundation, Inc. 4 * 2002 Free Software Foundation, Inc.
5 * 5 *
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 31
32/******************* 32/*******************
33 * mpi_limb_t 33 * mpi_limb_t
34 * _gcry_mpih_lshift( mpi_ptr_t wp, (r16) 34 * _gcry_mpih_lshift( mpi_ptr_t wp, (r16)
35 * mpi_ptr_t up, (r17) 35 * mpi_ptr_t up, (r17)
36 * mpi_size_t usize, (r18) 36 * mpi_size_t usize, (r18)
37 * unsigned cnt) (r19) 37 * unsigned cnt) (r19)
38 * 38 *
39 * This code runs at 4.8 cycles/limb on the 21064. With infinite unrolling, 39 * This code runs at 4.8 cycles/limb on the 21064. With infinite unrolling,
40 * it would take 4 cycles/limb. It should be possible to get down to 3 40 * it would take 4 cycles/limb. It should be possible to get down to 3
41 * cycles/limb since both ldq and stq can be paired with the other used 41 * cycles/limb since both ldq and stq can be paired with the other used
42 * instructions. But there are many restrictions in the 21064 pipeline that 42 * instructions. But there are many restrictions in the 21064 pipeline that
43 * makes it hard, if not impossible, to get down to 3 cycles/limb: 43 * makes it hard, if not impossible, to get down to 3 cycles/limb:
44 * 44 *
45 * 1. ldq has a 3 cycle delay, srl and sll have a 2 cycle delay. 45 * 1. ldq has a 3 cycle delay, srl and sll have a 2 cycle delay.
46 * 2. Only aligned instruction pairs can be paired. 46 * 2. Only aligned instruction pairs can be paired.
47 * 3. The store buffer or silo might not be able to deal with the bandwidth. 47 * 3. The store buffer or silo might not be able to deal with the bandwidth.
48 */ 48 */
49 49
50 .set noreorder 50 .set noreorder
51 .set noat 51 .set noat
52.text 52.text
53 .align 3 53 .align 3
54 .globl _gcry_mpih_lshift 54 .globl _gcry_mpih_lshift
55 .ent _gcry_mpih_lshift 55 .ent _gcry_mpih_lshift
56_gcry_mpih_lshift: 56_gcry_mpih_lshift:
57 .frame $30,0,$26,0 57 .frame $30,0,$26,0
58 58
59 s8addq $18,$17,$17 # make r17 point at end of s1 59 s8addq $18,$17,$17 # make r17 point at end of s1
60 ldq $4,-8($17) # load first limb 60 ldq $4,-8($17) # load first limb
61 subq $17,8,$17 61 subq $17,8,$17
62 subq $31,$19,$7 62 subq $31,$19,$7
63 s8addq $18,$16,$16 # make r16 point at end of RES 63 s8addq $18,$16,$16 # make r16 point at end of RES
64 subq $18,1,$18 64 subq $18,1,$18
65 and $18,4-1,$20 # number of limbs in first loop 65 and $18,4-1,$20 # number of limbs in first loop
66 srl $4,$7,$0 # compute function result 66 srl $4,$7,$0 # compute function result
67 67
68 beq $20,.L0 68 beq $20,.L0
69 subq $18,$20,$18 69 subq $18,$20,$18
70 70
71 .align 3 71 .align 3
72.Loop0: 72.Loop0:
73 ldq $3,-8($17) 73 ldq $3,-8($17)
74 subq $16,8,$16 74 subq $16,8,$16
75 subq $17,8,$17 75 subq $17,8,$17
76 subq $20,1,$20 76 subq $20,1,$20
77 sll $4,$19,$5 77 sll $4,$19,$5
78 srl $3,$7,$6 78 srl $3,$7,$6
79 bis $3,$3,$4 79 bis $3,$3,$4
80 bis $5,$6,$8 80 bis $5,$6,$8
81 stq $8,0($16) 81 stq $8,0($16)
82 bne $20,.Loop0 82 bne $20,.Loop0
83 83
84.L0: beq $18,.Lend 84.L0: beq $18,.Lend
85 85
86 .align 3 86 .align 3
87.Loop: ldq $3,-8($17) 87.Loop: ldq $3,-8($17)
88 subq $16,32,$16 88 subq $16,32,$16
89 subq $18,4,$18 89 subq $18,4,$18
90 sll $4,$19,$5 90 sll $4,$19,$5
91 srl $3,$7,$6 91 srl $3,$7,$6
92 92
93 ldq $4,-16($17) 93 ldq $4,-16($17)
94 sll $3,$19,$1 94 sll $3,$19,$1
95 bis $5,$6,$8 95 bis $5,$6,$8
96 stq $8,24($16) 96 stq $8,24($16)
97 srl $4,$7,$2 97 srl $4,$7,$2
98 98
99 ldq $3,-24($17) 99 ldq $3,-24($17)
100 sll $4,$19,$5 100 sll $4,$19,$5
101 bis $1,$2,$8 101 bis $1,$2,$8
102 stq $8,16($16) 102 stq $8,16($16)
103 srl $3,$7,$6 103 srl $3,$7,$6
104 104
105 ldq $4,-32($17) 105 ldq $4,-32($17)
106 sll $3,$19,$1 106 sll $3,$19,$1
107 bis $5,$6,$8 107 bis $5,$6,$8
108 stq $8,8($16) 108 stq $8,8($16)
109 srl $4,$7,$2 109 srl $4,$7,$2
110 110
111 subq $17,32,$17 111 subq $17,32,$17
112 bis $1,$2,$8 112 bis $1,$2,$8
113 stq $8,0($16) 113 stq $8,0($16)
114 114
115 bgt $18,.Loop 115 bgt $18,.Loop
116 116
117.Lend: sll $4,$19,$8 117.Lend: sll $4,$19,$8
118 stq $8,-8($16) 118 stq $8,-8($16)
119 ret $31,($26),1 119 ret $31,($26),1
120 .end _gcry_mpih_lshift 120 .end _gcry_mpih_lshift
121 121
122 122
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul1.S
index a4a76cc..cd91b10 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul1.S
@@ -1,90 +1,90 @@
1/* Alpha 21064 mpih-mul1.S -- Multiply a limb vector with a limb and store 1/* Alpha 21064 mpih-mul1.S -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second 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 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r16) 27 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r16)
28 * mpi_ptr_t s1_ptr, (r17) 28 * mpi_ptr_t s1_ptr, (r17)
29 * mpi_size_t s1_size, (r18) 29 * mpi_size_t s1_size, (r18)
30 * mpi_limb_t s2_limb) (r19) 30 * mpi_limb_t s2_limb) (r19)
31 * 31 *
32 * This code runs at 42 cycles/limb on the EV4 and 18 cycles/limb on the EV5. 32 * This code runs at 42 cycles/limb on the EV4 and 18 cycles/limb on the EV5.
33 * 33 *
34 * To improve performance for long multiplications, we would use 34 * To improve performance for long multiplications, we would use
35 * 'fetch' for S1 and 'fetch_m' for RES. It's not obvious how to use 35 * 'fetch' for S1 and 'fetch_m' for RES. It's not obvious how to use
36 * these instructions without slowing down the general code: 1. We can 36 * these instructions without slowing down the general code: 1. We can
37 * only have two prefetches in operation at any time in the Alpha 37 * only have two prefetches in operation at any time in the Alpha
38 * architecture. 2. There will seldom be any special alignment 38 * architecture. 2. There will seldom be any special alignment
39 * between RES_PTR and S1_PTR. Maybe we can simply divide the current 39 * between RES_PTR and S1_PTR. Maybe we can simply divide the current
40 * loop into an inner and outer loop, having the inner loop handle 40 * loop into an inner and outer loop, having the inner loop handle
41 * exactly one prefetch block? 41 * exactly one prefetch block?
42 */ 42 */
43 43
44 .set noreorder 44 .set noreorder
45 .set noat 45 .set noat
46.text 46.text
47 .align 3 47 .align 3
48 .globl _gcry_mpih_mul_1 48 .globl _gcry_mpih_mul_1
49 .ent _gcry_mpih_mul_1 2 49 .ent _gcry_mpih_mul_1 2
50_gcry_mpih_mul_1: 50_gcry_mpih_mul_1:
51 .frame $30,0,$26 51 .frame $30,0,$26
52 52
53 ldq $2,0($17) # $2 = s1_limb 53 ldq $2,0($17) # $2 = s1_limb
54 subq $18,1,$18 # size-- 54 subq $18,1,$18 # size--
55 mulq $2,$19,$3 # $3 = prod_low 55 mulq $2,$19,$3 # $3 = prod_low
56 bic $31,$31,$4 # clear cy_limb 56 bic $31,$31,$4 # clear cy_limb
57 umulh $2,$19,$0 # $0 = prod_high 57 umulh $2,$19,$0 # $0 = prod_high
58 beq $18,Lend1 # jump if size was == 1 58 beq $18,Lend1 # jump if size was == 1
59 ldq $2,8($17) # $2 = s1_limb 59 ldq $2,8($17) # $2 = s1_limb
60 subq $18,1,$18 # size-- 60 subq $18,1,$18 # size--
61 stq $3,0($16) 61 stq $3,0($16)
62 beq $18,Lend2 # jump if size was == 2 62 beq $18,Lend2 # jump if size was == 2
63 63
64 .align 3 64 .align 3
65Loop: mulq $2,$19,$3 # $3 = prod_low 65Loop: mulq $2,$19,$3 # $3 = prod_low
66 addq $4,$0,$0 # cy_limb = cy_limb + 'cy' 66 addq $4,$0,$0 # cy_limb = cy_limb + 'cy'
67 subq $18,1,$18 # size-- 67 subq $18,1,$18 # size--
68 umulh $2,$19,$4 # $4 = cy_limb 68 umulh $2,$19,$4 # $4 = cy_limb
69 ldq $2,16($17) # $2 = s1_limb 69 ldq $2,16($17) # $2 = s1_limb
70 addq $17,8,$17 # s1_ptr++ 70 addq $17,8,$17 # s1_ptr++
71 addq $3,$0,$3 # $3 = cy_limb + prod_low 71 addq $3,$0,$3 # $3 = cy_limb + prod_low
72 stq $3,8($16) 72 stq $3,8($16)
73 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low) 73 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low)
74 addq $16,8,$16 # res_ptr++ 74 addq $16,8,$16 # res_ptr++
75 bne $18,Loop 75 bne $18,Loop
76 76
77Lend2: mulq $2,$19,$3 # $3 = prod_low 77Lend2: mulq $2,$19,$3 # $3 = prod_low
78 addq $4,$0,$0 # cy_limb = cy_limb + 'cy' 78 addq $4,$0,$0 # cy_limb = cy_limb + 'cy'
79 umulh $2,$19,$4 # $4 = cy_limb 79 umulh $2,$19,$4 # $4 = cy_limb
80 addq $3,$0,$3 # $3 = cy_limb + prod_low 80 addq $3,$0,$3 # $3 = cy_limb + prod_low
81 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low) 81 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low)
82 stq $3,8($16) 82 stq $3,8($16)
83 addq $4,$0,$0 # cy_limb = prod_high + cy 83 addq $4,$0,$0 # cy_limb = prod_high + cy
84 ret $31,($26),1 84 ret $31,($26),1
85Lend1: stq $3,0($16) 85Lend1: stq $3,0($16)
86 ret $31,($26),1 86 ret $31,($26),1
87 87
88 .end _gcry_mpih_mul_1 88 .end _gcry_mpih_mul_1
89 89
90 90
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul2.S
index 5e5ce5a..5eb6b98 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul2.S
@@ -1,97 +1,97 @@
1/* Alpha 21064 addmul_1 -- Multiply a limb vector with a limb and add 1/* Alpha 21064 addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second 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 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r16) 27 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r16)
28 * mpi_ptr_t s1_ptr, (r17) 28 * mpi_ptr_t s1_ptr, (r17)
29 * mpi_size_t s1_size, (r18) 29 * mpi_size_t s1_size, (r18)
30 * mpi_limb_t s2_limb) (r19) 30 * mpi_limb_t s2_limb) (r19)
31 * 31 *
32 * This code runs at 42 cycles/limb on EV4 and 18 cycles/limb on EV5. 32 * This code runs at 42 cycles/limb on EV4 and 18 cycles/limb on EV5.
33 */ 33 */
34 34
35 35
36 .set noreorder 36 .set noreorder
37 .set noat 37 .set noat
38.text 38.text
39 .align 3 39 .align 3
40 .globl _gcry_mpih_addmul_1 40 .globl _gcry_mpih_addmul_1
41 .ent _gcry_mpih_addmul_1 2 41 .ent _gcry_mpih_addmul_1 2
42_gcry_mpih_addmul_1: 42_gcry_mpih_addmul_1:
43 .frame $30,0,$26 43 .frame $30,0,$26
44 44
45 ldq $2,0($17) # $2 = s1_limb 45 ldq $2,0($17) # $2 = s1_limb
46 addq $17,8,$17 # s1_ptr++ 46 addq $17,8,$17 # s1_ptr++
47 subq $18,1,$18 # size-- 47 subq $18,1,$18 # size--
48 mulq $2,$19,$3 # $3 = prod_low 48 mulq $2,$19,$3 # $3 = prod_low
49 ldq $5,0($16) # $5 = *res_ptr 49 ldq $5,0($16) # $5 = *res_ptr
50 umulh $2,$19,$0 # $0 = prod_high 50 umulh $2,$19,$0 # $0 = prod_high
51 beq $18,.Lend1 # jump if size was == 1 51 beq $18,.Lend1 # jump if size was == 1
52 ldq $2,0($17) # $2 = s1_limb 52 ldq $2,0($17) # $2 = s1_limb
53 addq $17,8,$17 # s1_ptr++ 53 addq $17,8,$17 # s1_ptr++
54 subq $18,1,$18 # size-- 54 subq $18,1,$18 # size--
55 addq $5,$3,$3 55 addq $5,$3,$3
56 cmpult $3,$5,$4 56 cmpult $3,$5,$4
57 stq $3,0($16) 57 stq $3,0($16)
58 addq $16,8,$16 # res_ptr++ 58 addq $16,8,$16 # res_ptr++
59 beq $18,.Lend2 # jump if size was == 2 59 beq $18,.Lend2 # jump if size was == 2
60 60
61 .align 3 61 .align 3
62.Loop: mulq $2,$19,$3 # $3 = prod_low 62.Loop: mulq $2,$19,$3 # $3 = prod_low
63 ldq $5,0($16) # $5 = *res_ptr 63 ldq $5,0($16) # $5 = *res_ptr
64 addq $4,$0,$0 # cy_limb = cy_limb + 'cy' 64 addq $4,$0,$0 # cy_limb = cy_limb + 'cy'
65 subq $18,1,$18 # size-- 65 subq $18,1,$18 # size--
66 umulh $2,$19,$4 # $4 = cy_limb 66 umulh $2,$19,$4 # $4 = cy_limb
67 ldq $2,0($17) # $2 = s1_limb 67 ldq $2,0($17) # $2 = s1_limb
68 addq $17,8,$17 # s1_ptr++ 68 addq $17,8,$17 # s1_ptr++
69 addq $3,$0,$3 # $3 = cy_limb + prod_low 69 addq $3,$0,$3 # $3 = cy_limb + prod_low
70 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low) 70 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low)
71 addq $5,$3,$3 71 addq $5,$3,$3
72 cmpult $3,$5,$5 72 cmpult $3,$5,$5
73 stq $3,0($16) 73 stq $3,0($16)
74 addq $16,8,$16 # res_ptr++ 74 addq $16,8,$16 # res_ptr++
75 addq $5,$0,$0 # combine carries 75 addq $5,$0,$0 # combine carries
76 bne $18,.Loop 76 bne $18,.Loop
77 77
78.Lend2: mulq $2,$19,$3 # $3 = prod_low 78.Lend2: mulq $2,$19,$3 # $3 = prod_low
79 ldq $5,0($16) # $5 = *res_ptr 79 ldq $5,0($16) # $5 = *res_ptr
80 addq $4,$0,$0 # cy_limb = cy_limb + 'cy' 80 addq $4,$0,$0 # cy_limb = cy_limb + 'cy'
81 umulh $2,$19,$4 # $4 = cy_limb 81 umulh $2,$19,$4 # $4 = cy_limb
82 addq $3,$0,$3 # $3 = cy_limb + prod_low 82 addq $3,$0,$3 # $3 = cy_limb + prod_low
83 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low) 83 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low)
84 addq $5,$3,$3 84 addq $5,$3,$3
85 cmpult $3,$5,$5 85 cmpult $3,$5,$5
86 stq $3,0($16) 86 stq $3,0($16)
87 addq $5,$0,$0 # combine carries 87 addq $5,$0,$0 # combine carries
88 addq $4,$0,$0 # cy_limb = prod_high + cy 88 addq $4,$0,$0 # cy_limb = prod_high + cy
89 ret $31,($26),1 89 ret $31,($26),1
90.Lend1: addq $5,$3,$3 90.Lend1: addq $5,$3,$3
91 cmpult $3,$5,$5 91 cmpult $3,$5,$5
92 stq $3,0($16) 92 stq $3,0($16)
93 addq $0,$5,$0 93 addq $0,$5,$0
94 ret $31,($26),1 94 ret $31,($26),1
95 95
96 .end _gcry_mpih_addmul_1 96 .end _gcry_mpih_addmul_1
97 97
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul3.S
index 0259ff8..7d5d2af 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-mul3.S
@@ -1,95 +1,95 @@
1/* Alpha 21064 submul_1 -- Multiply a limb vector with a limb and 1/* Alpha 21064 submul_1 -- Multiply a limb vector with a limb and
2 * subtract the result from a second limb vector. 2 * subtract the result from a second limb vector.
3 * Copyright (C) 1992, 1994, 1995, 1998, 3 * Copyright (C) 1992, 1994, 1995, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23 23
24/******************* 24/*******************
25 * mpi_limb_t 25 * mpi_limb_t
26 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r16 ) 26 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r16 )
27 * mpi_ptr_t s1_ptr, (r17 ) 27 * mpi_ptr_t s1_ptr, (r17 )
28 * mpi_size_t s1_size, (r18 ) 28 * mpi_size_t s1_size, (r18 )
29 * mpi_limb_t s2_limb) (r19 ) 29 * mpi_limb_t s2_limb) (r19 )
30 * 30 *
31 * This code runs at 42 cycles/limb on EV4 and 18 cycles/limb on EV5. 31 * This code runs at 42 cycles/limb on EV4 and 18 cycles/limb on EV5.
32 */ 32 */
33 33
34 .set noreorder 34 .set noreorder
35 .set noat 35 .set noat
36.text 36.text
37 .align 3 37 .align 3
38 .globl _gcry_mpih_submul_1 38 .globl _gcry_mpih_submul_1
39 .ent _gcry_mpih_submul_1 2 39 .ent _gcry_mpih_submul_1 2
40_gcry_mpih_submul_1: 40_gcry_mpih_submul_1:
41 .frame $30,0,$26 41 .frame $30,0,$26
42 42
43 ldq $2,0($17) # $2 = s1_limb 43 ldq $2,0($17) # $2 = s1_limb
44 addq $17,8,$17 # s1_ptr++ 44 addq $17,8,$17 # s1_ptr++
45 subq $18,1,$18 # size-- 45 subq $18,1,$18 # size--
46 mulq $2,$19,$3 # $3 = prod_low 46 mulq $2,$19,$3 # $3 = prod_low
47 ldq $5,0($16) # $5 = *res_ptr 47 ldq $5,0($16) # $5 = *res_ptr
48 umulh $2,$19,$0 # $0 = prod_high 48 umulh $2,$19,$0 # $0 = prod_high
49 beq $18,.Lend1 # jump if size was == 1 49 beq $18,.Lend1 # jump if size was == 1
50 ldq $2,0($17) # $2 = s1_limb 50 ldq $2,0($17) # $2 = s1_limb
51 addq $17,8,$17 # s1_ptr++ 51 addq $17,8,$17 # s1_ptr++
52 subq $18,1,$18 # size-- 52 subq $18,1,$18 # size--
53 subq $5,$3,$3 53 subq $5,$3,$3
54 cmpult $5,$3,$4 54 cmpult $5,$3,$4
55 stq $3,0($16) 55 stq $3,0($16)
56 addq $16,8,$16 # res_ptr++ 56 addq $16,8,$16 # res_ptr++
57 beq $18,.Lend2 # jump if size was == 2 57 beq $18,.Lend2 # jump if size was == 2
58 58
59 .align 3 59 .align 3
60.Loop: mulq $2,$19,$3 # $3 = prod_low 60.Loop: mulq $2,$19,$3 # $3 = prod_low
61 ldq $5,0($16) # $5 = *res_ptr 61 ldq $5,0($16) # $5 = *res_ptr
62 addq $4,$0,$0 # cy_limb = cy_limb + 'cy' 62 addq $4,$0,$0 # cy_limb = cy_limb + 'cy'
63 subq $18,1,$18 # size-- 63 subq $18,1,$18 # size--
64 umulh $2,$19,$4 # $4 = cy_limb 64 umulh $2,$19,$4 # $4 = cy_limb
65 ldq $2,0($17) # $2 = s1_limb 65 ldq $2,0($17) # $2 = s1_limb
66 addq $17,8,$17 # s1_ptr++ 66 addq $17,8,$17 # s1_ptr++
67 addq $3,$0,$3 # $3 = cy_limb + prod_low 67 addq $3,$0,$3 # $3 = cy_limb + prod_low
68 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low) 68 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low)
69 subq $5,$3,$3 69 subq $5,$3,$3
70 cmpult $5,$3,$5 70 cmpult $5,$3,$5
71 stq $3,0($16) 71 stq $3,0($16)
72 addq $16,8,$16 # res_ptr++ 72 addq $16,8,$16 # res_ptr++
73 addq $5,$0,$0 # combine carries 73 addq $5,$0,$0 # combine carries
74 bne $18,.Loop 74 bne $18,.Loop
75 75
76.Lend2: mulq $2,$19,$3 # $3 = prod_low 76.Lend2: mulq $2,$19,$3 # $3 = prod_low
77 ldq $5,0($16) # $5 = *res_ptr 77 ldq $5,0($16) # $5 = *res_ptr
78 addq $4,$0,$0 # cy_limb = cy_limb + 'cy' 78 addq $4,$0,$0 # cy_limb = cy_limb + 'cy'
79 umulh $2,$19,$4 # $4 = cy_limb 79 umulh $2,$19,$4 # $4 = cy_limb
80 addq $3,$0,$3 # $3 = cy_limb + prod_low 80 addq $3,$0,$3 # $3 = cy_limb + prod_low
81 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low) 81 cmpult $3,$0,$0 # $0 = carry from (cy_limb + prod_low)
82 subq $5,$3,$3 82 subq $5,$3,$3
83 cmpult $5,$3,$5 83 cmpult $5,$3,$5
84 stq $3,0($16) 84 stq $3,0($16)
85 addq $5,$0,$0 # combine carries 85 addq $5,$0,$0 # combine carries
86 addq $4,$0,$0 # cy_limb = prod_high + cy 86 addq $4,$0,$0 # cy_limb = prod_high + cy
87 ret $31,($26),1 87 ret $31,($26),1
88.Lend1: subq $5,$3,$3 88.Lend1: subq $5,$3,$3
89 cmpult $5,$3,$5 89 cmpult $5,$3,$5
90 stq $3,0($16) 90 stq $3,0($16)
91 addq $0,$5,$0 91 addq $0,$5,$0
92 ret $31,($26),1 92 ret $31,($26),1
93 93
94 .end _gcry_mpih_submul_1 94 .end _gcry_mpih_submul_1
95 95
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-rshift.S
index 25e08d4..f0c9814 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-rshift.S
@@ -1,118 +1,118 @@
1/* alpha rshift 1/* alpha rshift
2 * Copyright (C) 1994, 1995, 1998, 1999, 2 * Copyright (C) 1994, 1995, 1998, 1999,
3 * 2000, 2001, 2002 Free Software Foundation, Inc. 3 * 2000, 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28 28
29 29
30 30
31/******************* 31/*******************
32 * mpi_limb_t 32 * mpi_limb_t
33 * _gcry_mpih_rshift( mpi_ptr_t wp, (r16) 33 * _gcry_mpih_rshift( mpi_ptr_t wp, (r16)
34 * mpi_ptr_t up, (r17) 34 * mpi_ptr_t up, (r17)
35 * mpi_size_t usize, (r18) 35 * mpi_size_t usize, (r18)
36 * unsigned cnt) (r19) 36 * unsigned cnt) (r19)
37 * 37 *
38 * This code runs at 4.8 cycles/limb on the 21064. With infinite unrolling, 38 * This code runs at 4.8 cycles/limb on the 21064. With infinite unrolling,
39 * it would take 4 cycles/limb. It should be possible to get down to 3 39 * it would take 4 cycles/limb. It should be possible to get down to 3
40 * cycles/limb since both ldq and stq can be paired with the other used 40 * cycles/limb since both ldq and stq can be paired with the other used
41 * instructions. But there are many restrictions in the 21064 pipeline that 41 * instructions. But there are many restrictions in the 21064 pipeline that
42 * makes it hard, if not impossible, to get down to 3 cycles/limb: 42 * makes it hard, if not impossible, to get down to 3 cycles/limb:
43 * 43 *
44 * 1. ldq has a 3 cycle delay, srl and sll have a 2 cycle delay. 44 * 1. ldq has a 3 cycle delay, srl and sll have a 2 cycle delay.
45 * 2. Only aligned instruction pairs can be paired. 45 * 2. Only aligned instruction pairs can be paired.
46 * 3. The store buffer or silo might not be able to deal with the bandwidth. 46 * 3. The store buffer or silo might not be able to deal with the bandwidth.
47 */ 47 */
48 48
49 .set noreorder 49 .set noreorder
50 .set noat 50 .set noat
51.text 51.text
52 .align 3 52 .align 3
53 .globl _gcry_mpih_rshift 53 .globl _gcry_mpih_rshift
54 .ent _gcry_mpih_rshift 54 .ent _gcry_mpih_rshift
55_gcry_mpih_rshift: 55_gcry_mpih_rshift:
56 .frame $30,0,$26,0 56 .frame $30,0,$26,0
57 57
58 ldq $4,0($17) # load first limb 58 ldq $4,0($17) # load first limb
59 addq $17,8,$17 59 addq $17,8,$17
60 subq $31,$19,$7 60 subq $31,$19,$7
61 subq $18,1,$18 61 subq $18,1,$18
62 and $18,4-1,$20 # number of limbs in first loop 62 and $18,4-1,$20 # number of limbs in first loop
63 sll $4,$7,$0 # compute function result 63 sll $4,$7,$0 # compute function result
64 64
65 beq $20,.R0 65 beq $20,.R0
66 subq $18,$20,$18 66 subq $18,$20,$18
67 67
68 .align 3 68 .align 3
69.Roop0: 69.Roop0:
70 ldq $3,0($17) 70 ldq $3,0($17)
71 addq $16,8,$16 71 addq $16,8,$16
72 addq $17,8,$17 72 addq $17,8,$17
73 subq $20,1,$20 73 subq $20,1,$20
74 srl $4,$19,$5 74 srl $4,$19,$5
75 sll $3,$7,$6 75 sll $3,$7,$6
76 bis $3,$3,$4 76 bis $3,$3,$4
77 bis $5,$6,$8 77 bis $5,$6,$8
78 stq $8,-8($16) 78 stq $8,-8($16)
79 bne $20,.Roop0 79 bne $20,.Roop0
80 80
81.R0: beq $18,.Rend 81.R0: beq $18,.Rend
82 82
83 .align 3 83 .align 3
84.Roop: ldq $3,0($17) 84.Roop: ldq $3,0($17)
85 addq $16,32,$16 85 addq $16,32,$16
86 subq $18,4,$18 86 subq $18,4,$18
87 srl $4,$19,$5 87 srl $4,$19,$5
88 sll $3,$7,$6 88 sll $3,$7,$6
89 89
90 ldq $4,8($17) 90 ldq $4,8($17)
91 srl $3,$19,$1 91 srl $3,$19,$1
92 bis $5,$6,$8 92 bis $5,$6,$8
93 stq $8,-32($16) 93 stq $8,-32($16)
94 sll $4,$7,$2 94 sll $4,$7,$2
95 95
96 ldq $3,16($17) 96 ldq $3,16($17)
97 srl $4,$19,$5 97 srl $4,$19,$5
98 bis $1,$2,$8 98 bis $1,$2,$8
99 stq $8,-24($16) 99 stq $8,-24($16)
100 sll $3,$7,$6 100 sll $3,$7,$6
101 101
102 ldq $4,24($17) 102 ldq $4,24($17)
103 srl $3,$19,$1 103 srl $3,$19,$1
104 bis $5,$6,$8 104 bis $5,$6,$8
105 stq $8,-16($16) 105 stq $8,-16($16)
106 sll $4,$7,$2 106 sll $4,$7,$2
107 107
108 addq $17,32,$17 108 addq $17,32,$17
109 bis $1,$2,$8 109 bis $1,$2,$8
110 stq $8,-8($16) 110 stq $8,-8($16)
111 111
112 bgt $18,.Roop 112 bgt $18,.Roop
113 113
114.Rend: srl $4,$19,$8 114.Rend: srl $4,$19,$8
115 stq $8,0($16) 115 stq $8,0($16)
116 ret $31,($26),1 116 ret $31,($26),1
117 .end _gcry_mpih_rshift 117 .end _gcry_mpih_rshift
118 118
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-sub1.S
index 7fee36d..9a64446 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/mpih-sub1.S
@@ -1,124 +1,124 @@
1/* Alpha sub_n -- Subtract two limb vectors of the same length > 0 and 1/* Alpha sub_n -- Subtract two limb vectors of the same length > 0 and
2 * store difference in a third limb vector. 2 * store difference in a third limb vector.
3 * Copyright (C) 1995, 1998, 3 * Copyright (C) 1995, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23 23
24/******************* 24/*******************
25 * mpi_limb_t 25 * mpi_limb_t
26 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (r16) 26 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (r16)
27 * mpi_ptr_t s1_ptr, (r17) 27 * mpi_ptr_t s1_ptr, (r17)
28 * mpi_ptr_t s2_ptr, (r18) 28 * mpi_ptr_t s2_ptr, (r18)
29 * mpi_size_t size) (r19) 29 * mpi_size_t size) (r19)
30 */ 30 */
31 31
32 .set noreorder 32 .set noreorder
33 .set noat 33 .set noat
34.text 34.text
35 .align 3 35 .align 3
36 .globl _gcry_mpih_sub_n 36 .globl _gcry_mpih_sub_n
37 .ent _gcry_mpih_sub_n 37 .ent _gcry_mpih_sub_n
38_gcry_mpih_sub_n: 38_gcry_mpih_sub_n:
39 .frame $30,0,$26,0 39 .frame $30,0,$26,0
40 40
41 ldq $3,0($17) 41 ldq $3,0($17)
42 ldq $4,0($18) 42 ldq $4,0($18)
43 43
44 subq $19,1,$19 44 subq $19,1,$19
45 and $19,4-1,$2 # number of limbs in first loop 45 and $19,4-1,$2 # number of limbs in first loop
46 bis $31,$31,$0 46 bis $31,$31,$0
47 beq $2,.L0 # if multiple of 4 limbs, skip first loop 47 beq $2,.L0 # if multiple of 4 limbs, skip first loop
48 48
49 subq $19,$2,$19 49 subq $19,$2,$19
50 50
51.Loop0: subq $2,1,$2 51.Loop0: subq $2,1,$2
52 ldq $5,8($17) 52 ldq $5,8($17)
53 addq $4,$0,$4 53 addq $4,$0,$4
54 ldq $6,8($18) 54 ldq $6,8($18)
55 cmpult $4,$0,$1 55 cmpult $4,$0,$1
56 subq $3,$4,$4 56 subq $3,$4,$4
57 cmpult $3,$4,$0 57 cmpult $3,$4,$0
58 stq $4,0($16) 58 stq $4,0($16)
59 or $0,$1,$0 59 or $0,$1,$0
60 60
61 addq $17,8,$17 61 addq $17,8,$17
62 addq $18,8,$18 62 addq $18,8,$18
63 bis $5,$5,$3 63 bis $5,$5,$3
64 bis $6,$6,$4 64 bis $6,$6,$4
65 addq $16,8,$16 65 addq $16,8,$16
66 bne $2,.Loop0 66 bne $2,.Loop0
67 67
68.L0: beq $19,.Lend 68.L0: beq $19,.Lend
69 69
70 .align 3 70 .align 3
71.Loop: subq $19,4,$19 71.Loop: subq $19,4,$19
72 72
73 ldq $5,8($17) 73 ldq $5,8($17)
74 addq $4,$0,$4 74 addq $4,$0,$4
75 ldq $6,8($18) 75 ldq $6,8($18)
76 cmpult $4,$0,$1 76 cmpult $4,$0,$1
77 subq $3,$4,$4 77 subq $3,$4,$4
78 cmpult $3,$4,$0 78 cmpult $3,$4,$0
79 stq $4,0($16) 79 stq $4,0($16)
80 or $0,$1,$0 80 or $0,$1,$0
81 81
82 ldq $3,16($17) 82 ldq $3,16($17)
83 addq $6,$0,$6 83 addq $6,$0,$6
84 ldq $4,16($18) 84 ldq $4,16($18)
85 cmpult $6,$0,$1 85 cmpult $6,$0,$1
86 subq $5,$6,$6 86 subq $5,$6,$6
87 cmpult $5,$6,$0 87 cmpult $5,$6,$0
88 stq $6,8($16) 88 stq $6,8($16)
89 or $0,$1,$0 89 or $0,$1,$0
90 90
91 ldq $5,24($17) 91 ldq $5,24($17)
92 addq $4,$0,$4 92 addq $4,$0,$4
93 ldq $6,24($18) 93 ldq $6,24($18)
94 cmpult $4,$0,$1 94 cmpult $4,$0,$1
95 subq $3,$4,$4 95 subq $3,$4,$4
96 cmpult $3,$4,$0 96 cmpult $3,$4,$0
97 stq $4,16($16) 97 stq $4,16($16)
98 or $0,$1,$0 98 or $0,$1,$0
99 99
100 ldq $3,32($17) 100 ldq $3,32($17)
101 addq $6,$0,$6 101 addq $6,$0,$6
102 ldq $4,32($18) 102 ldq $4,32($18)
103 cmpult $6,$0,$1 103 cmpult $6,$0,$1
104 subq $5,$6,$6 104 subq $5,$6,$6
105 cmpult $5,$6,$0 105 cmpult $5,$6,$0
106 stq $6,24($16) 106 stq $6,24($16)
107 or $0,$1,$0 107 or $0,$1,$0
108 108
109 addq $17,32,$17 109 addq $17,32,$17
110 addq $18,32,$18 110 addq $18,32,$18
111 addq $16,32,$16 111 addq $16,32,$16
112 bne $19,.Loop 112 bne $19,.Loop
113 113
114.Lend: addq $4,$0,$4 114.Lend: addq $4,$0,$4
115 cmpult $4,$0,$1 115 cmpult $4,$0,$1
116 subq $3,$4,$4 116 subq $3,$4,$4
117 cmpult $3,$4,$0 117 cmpult $3,$4,$0
118 stq $4,0($16) 118 stq $4,0($16)
119 or $0,$1,$0 119 or $0,$1,$0
120 ret $31,($26),1 120 ret $31,($26),1
121 121
122 .end _gcry_mpih_sub_n 122 .end _gcry_mpih_sub_n
123 123
124 124
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/udiv-qrnnd.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/udiv-qrnnd.S
index 98f2850..dd0c52d 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/udiv-qrnnd.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/alpha/udiv-qrnnd.S
@@ -1,159 +1,159 @@
1/* Alpha 21064 __udiv_qrnnd 1/* Alpha 21064 __udiv_qrnnd
2 * 2 *
3 * Copyright (C) 1992, 1994, 1995, 1998, 3 * Copyright (C) 1992, 1994, 1995, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 * 21 *
22 * Note: This code is heavily based on the GNU MP Library. 22 * Note: This code is heavily based on the GNU MP Library.
23 * Actually it's the same code with only minor changes in the 23 * Actually it's the same code with only minor changes in the
24 * way the data is stored; this is to support the abstraction 24 * way the data is stored; this is to support the abstraction
25 * of an optional secure memory allocation which may be used 25 * of an optional secure memory allocation which may be used
26 * to avoid revealing of sensitive data due to paging etc. 26 * to avoid revealing of sensitive data due to paging etc.
27 */ 27 */
28 28
29 29
30 30
31 .set noreorder 31 .set noreorder
32 .set noat 32 .set noat
33.text 33.text
34 .align 3 34 .align 3
35 .globl __udiv_qrnnd 35 .globl __udiv_qrnnd
36 .ent __udiv_qrnnd 36 .ent __udiv_qrnnd
37__udiv_qrnnd: 37__udiv_qrnnd:
38 .frame $30,0,$26,0 38 .frame $30,0,$26,0
39 .prologue 0 39 .prologue 0
40#define cnt $2 40#define cnt $2
41#define tmp $3 41#define tmp $3
42#define rem_ptr $16 42#define rem_ptr $16
43#define n1 $17 43#define n1 $17
44#define n0 $18 44#define n0 $18
45#define d $19 45#define d $19
46#define qb $20 46#define qb $20
47 47
48 ldiq cnt,16 48 ldiq cnt,16
49 blt d,.Largedivisor 49 blt d,.Largedivisor
50 50
51.Loop1: cmplt n0,0,tmp 51.Loop1: cmplt n0,0,tmp
52 addq n1,n1,n1 52 addq n1,n1,n1
53 bis n1,tmp,n1 53 bis n1,tmp,n1
54 addq n0,n0,n0 54 addq n0,n0,n0
55 cmpule d,n1,qb 55 cmpule d,n1,qb
56 subq n1,d,tmp 56 subq n1,d,tmp
57 cmovne qb,tmp,n1 57 cmovne qb,tmp,n1
58 bis n0,qb,n0 58 bis n0,qb,n0
59 cmplt n0,0,tmp 59 cmplt n0,0,tmp
60 addq n1,n1,n1 60 addq n1,n1,n1
61 bis n1,tmp,n1 61 bis n1,tmp,n1
62 addq n0,n0,n0 62 addq n0,n0,n0
63 cmpule d,n1,qb 63 cmpule d,n1,qb
64 subq n1,d,tmp 64 subq n1,d,tmp
65 cmovne qb,tmp,n1 65 cmovne qb,tmp,n1
66 bis n0,qb,n0 66 bis n0,qb,n0
67 cmplt n0,0,tmp 67 cmplt n0,0,tmp
68 addq n1,n1,n1 68 addq n1,n1,n1
69 bis n1,tmp,n1 69 bis n1,tmp,n1
70 addq n0,n0,n0 70 addq n0,n0,n0
71 cmpule d,n1,qb 71 cmpule d,n1,qb
72 subq n1,d,tmp 72 subq n1,d,tmp
73 cmovne qb,tmp,n1 73 cmovne qb,tmp,n1
74 bis n0,qb,n0 74 bis n0,qb,n0
75 cmplt n0,0,tmp 75 cmplt n0,0,tmp
76 addq n1,n1,n1 76 addq n1,n1,n1
77 bis n1,tmp,n1 77 bis n1,tmp,n1
78 addq n0,n0,n0 78 addq n0,n0,n0
79 cmpule d,n1,qb 79 cmpule d,n1,qb
80 subq n1,d,tmp 80 subq n1,d,tmp
81 cmovne qb,tmp,n1 81 cmovne qb,tmp,n1
82 bis n0,qb,n0 82 bis n0,qb,n0
83 subq cnt,1,cnt 83 subq cnt,1,cnt
84 bgt cnt,.Loop1 84 bgt cnt,.Loop1
85 stq n1,0(rem_ptr) 85 stq n1,0(rem_ptr)
86 bis $31,n0,$0 86 bis $31,n0,$0
87 ret $31,($26),1 87 ret $31,($26),1
88 88
89.Largedivisor: 89.Largedivisor:
90 and n0,1,$4 90 and n0,1,$4
91 91
92 srl n0,1,n0 92 srl n0,1,n0
93 sll n1,63,tmp 93 sll n1,63,tmp
94 or tmp,n0,n0 94 or tmp,n0,n0
95 srl n1,1,n1 95 srl n1,1,n1
96 96
97 and d,1,$6 97 and d,1,$6
98 srl d,1,$5 98 srl d,1,$5
99 addq $5,$6,$5 99 addq $5,$6,$5
100 100
101.Loop2: cmplt n0,0,tmp 101.Loop2: cmplt n0,0,tmp
102 addq n1,n1,n1 102 addq n1,n1,n1
103 bis n1,tmp,n1 103 bis n1,tmp,n1
104 addq n0,n0,n0 104 addq n0,n0,n0
105 cmpule $5,n1,qb 105 cmpule $5,n1,qb
106 subq n1,$5,tmp 106 subq n1,$5,tmp
107 cmovne qb,tmp,n1 107 cmovne qb,tmp,n1
108 bis n0,qb,n0 108 bis n0,qb,n0
109 cmplt n0,0,tmp 109 cmplt n0,0,tmp
110 addq n1,n1,n1 110 addq n1,n1,n1
111 bis n1,tmp,n1 111 bis n1,tmp,n1
112 addq n0,n0,n0 112 addq n0,n0,n0
113 cmpule $5,n1,qb 113 cmpule $5,n1,qb
114 subq n1,$5,tmp 114 subq n1,$5,tmp
115 cmovne qb,tmp,n1 115 cmovne qb,tmp,n1
116 bis n0,qb,n0 116 bis n0,qb,n0
117 cmplt n0,0,tmp 117 cmplt n0,0,tmp
118 addq n1,n1,n1 118 addq n1,n1,n1
119 bis n1,tmp,n1 119 bis n1,tmp,n1
120 addq n0,n0,n0 120 addq n0,n0,n0
121 cmpule $5,n1,qb 121 cmpule $5,n1,qb
122 subq n1,$5,tmp 122 subq n1,$5,tmp
123 cmovne qb,tmp,n1 123 cmovne qb,tmp,n1
124 bis n0,qb,n0 124 bis n0,qb,n0
125 cmplt n0,0,tmp 125 cmplt n0,0,tmp
126 addq n1,n1,n1 126 addq n1,n1,n1
127 bis n1,tmp,n1 127 bis n1,tmp,n1
128 addq n0,n0,n0 128 addq n0,n0,n0
129 cmpule $5,n1,qb 129 cmpule $5,n1,qb
130 subq n1,$5,tmp 130 subq n1,$5,tmp
131 cmovne qb,tmp,n1 131 cmovne qb,tmp,n1
132 bis n0,qb,n0 132 bis n0,qb,n0
133 subq cnt,1,cnt 133 subq cnt,1,cnt
134 bgt cnt,.Loop2 134 bgt cnt,.Loop2
135 135
136 addq n1,n1,n1 136 addq n1,n1,n1
137 addq $4,n1,n1 137 addq $4,n1,n1
138 bne $6,.LOdd 138 bne $6,.LOdd
139 stq n1,0(rem_ptr) 139 stq n1,0(rem_ptr)
140 bis $31,n0,$0 140 bis $31,n0,$0
141 ret $31,($26),1 141 ret $31,($26),1
142 142
143.LOdd: 143.LOdd:
144 /* q' in n0. r' in n1 */ 144 /* q' in n0. r' in n1 */
145 addq n1,n0,n1 145 addq n1,n0,n1
146 cmpult n1,n0,tmp # tmp := carry from addq 146 cmpult n1,n0,tmp # tmp := carry from addq
147 beq tmp,.LLp6 147 beq tmp,.LLp6
148 addq n0,1,n0 148 addq n0,1,n0
149 subq n1,d,n1 149 subq n1,d,n1
150.LLp6: cmpult n1,d,tmp 150.LLp6: cmpult n1,d,tmp
151 bne tmp,.LLp7 151 bne tmp,.LLp7
152 addq n0,1,n0 152 addq n0,1,n0
153 subq n1,d,n1 153 subq n1,d,n1
154.LLp7: 154.LLp7:
155 stq n1,0(rem_ptr) 155 stq n1,0(rem_ptr)
156 bis $31,n0,$0 156 bis $31,n0,$0
157 ret $31,($26),1 157 ret $31,($26),1
158 158
159 .end __udiv_qrnnd 159 .end __udiv_qrnnd
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/config.links b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/config.links
index 1c69f6e..a5abb67 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/config.links
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/config.links
@@ -1,350 +1,350 @@
1# config.links - helper for ../configure 1# config.links - helper for ../configure
2# Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 2# Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19# 19#
20# sourced by ../configure to get the list of files to link 20# sourced by ../configure to get the list of files to link
21# this should set $mpi_ln_list. 21# this should set $mpi_ln_list.
22# Note: this is called from the above directory. 22# Note: this is called from the above directory.
23 23
24mpi_sflags= 24mpi_sflags=
25mpi_extra_modules= 25mpi_extra_modules=
26 26
27test -d ./mpi || mkdir ./mpi 27test -d ./mpi || mkdir ./mpi
28 28
29# We grep the list of modules from the Makefile so that 29# We grep the list of modules from the Makefile so that
30# we don't need to maintain them here. 30# we don't need to maintain them here.
31mpi_standard_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ { 31mpi_standard_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ {
32 if( $3 != "O" ) print $2 }' $srcdir/mpi/Makefile.am` 32 if( $3 != "O" ) print $2 }' $srcdir/mpi/Makefile.am`
33mpi_optional_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ { 33mpi_optional_modules=`$AWK '/^#BEGIN_ASM_LIST/,/^#END_ASM_LIST/ {
34 if( $3 == "O" ) print $2 }' $srcdir/mpi/Makefile.am` 34 if( $3 == "O" ) print $2 }' $srcdir/mpi/Makefile.am`
35 35
36 36
37echo '/* created by config.links - do not edit */' >./mpi/asm-syntax.h 37echo '/* created by config.links - do not edit */' >./mpi/asm-syntax.h
38echo "/* Target: ${target} */" >>./mpi/asm-syntax.h 38echo "/* Target: ${target} */" >>./mpi/asm-syntax.h
39 39
40if test "$try_asm_modules" = "yes" ; then 40if test "$try_asm_modules" = "yes" ; then
41case "${target}" in 41case "${target}" in
42 powerpc-apple-darwin* | \ 42 powerpc-apple-darwin* | \
43 i[34567]86*-*-openbsd[12]* | \ 43 i[34567]86*-*-openbsd[12]* | \
44 i[34567]86*-*-openbsd3.[0123]*) 44 i[34567]86*-*-openbsd3.[0123]*)
45 echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h 45 echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
46 path="" 46 path=""
47 ;; 47 ;;
48 i[3467]86*-*-openbsd* | \ 48 i[3467]86*-*-openbsd* | \
49 i[3467]86*-*-freebsd*-elf | \ 49 i[3467]86*-*-freebsd*-elf | \
50 i[3467]86*-*-freebsd[3-9]* | \ 50 i[3467]86*-*-freebsd[3-9]* | \
51 i[3467]86*-*-freebsdelf* | \ 51 i[3467]86*-*-freebsdelf* | \
52 i[3467]86*-*-netbsd* | \ 52 i[3467]86*-*-netbsd* | \
53 i[3467]86*-*-k*bsd*) 53 i[3467]86*-*-k*bsd*)
54 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 54 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
55 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 55 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
56 path="i386" 56 path="i386"
57 ;; 57 ;;
58 i586*-*-openbsd* | \ 58 i586*-*-openbsd* | \
59 i586*-*-freebsd*-elf | \ 59 i586*-*-freebsd*-elf | \
60 i586*-*-freebsd[3-9]* | \ 60 i586*-*-freebsd[3-9]* | \
61 i586*-*-freebsdelf* | \ 61 i586*-*-freebsdelf* | \
62 i586*-*-netbsd* | \ 62 i586*-*-netbsd* | \
63 i586*-*-k*bsd* | \ 63 i586*-*-k*bsd* | \
64 pentium-*-netbsd* | \ 64 pentium-*-netbsd* | \
65 pentiumpro-*-netbsd*) 65 pentiumpro-*-netbsd*)
66 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 66 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
67 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 67 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
68 path="i586 i386" 68 path="i586 i386"
69 ;; 69 ;;
70 i[34]86*-*-bsdi4*) 70 i[34]86*-*-bsdi4*)
71 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 71 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
72 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 72 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
73 path="i386" 73 path="i386"
74 ;; 74 ;;
75 i[3467]86*-*-linuxaout* | \ 75 i[3467]86*-*-linuxaout* | \
76 i[3467]86*-*-linuxoldld* | \ 76 i[3467]86*-*-linuxoldld* | \
77 i[3467]86*-*-*bsd*) 77 i[3467]86*-*-*bsd*)
78 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h 78 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h
79 echo '#define X86_BROKEN_ALIGN' >>./mpi/asm-syntax.h 79 echo '#define X86_BROKEN_ALIGN' >>./mpi/asm-syntax.h
80 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 80 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
81 path="i386" 81 path="i386"
82 ;; 82 ;;
83 i586*-*-linuxaout* | \ 83 i586*-*-linuxaout* | \
84 i586*-*-linuxoldld* | \ 84 i586*-*-linuxoldld* | \
85 i586*-*-*bsd*) 85 i586*-*-*bsd*)
86 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h 86 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h
87 echo '#define X86_BROKEN_ALIGN' >>./mpi/asm-syntax.h 87 echo '#define X86_BROKEN_ALIGN' >>./mpi/asm-syntax.h
88 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 88 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
89 path="i586 i386" 89 path="i586 i386"
90 ;; 90 ;;
91 i[3467]86*-msdosdjgpp*) 91 i[3467]86*-msdosdjgpp*)
92 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h 92 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h
93 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 93 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
94 path="i386" 94 path="i386"
95 ;; 95 ;;
96 i586*-msdosdjgpp*) 96 i586*-msdosdjgpp*)
97 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h 97 echo '#define BSD_SYNTAX' >>./mpi/asm-syntax.h
98 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 98 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
99 path="i586 i386" 99 path="i586 i386"
100 ;; 100 ;;
101 i[3467]86*-*-*) 101 i[3467]86*-*-*)
102 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 102 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
103 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 103 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
104 path="i386" 104 path="i386"
105 ;; 105 ;;
106 i586*-*-* | \ 106 i586*-*-* | \
107 pentium-*-* | \ 107 pentium-*-* | \
108 pentiumpro-*-*) 108 pentiumpro-*-*)
109 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 109 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
110 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h 110 cat $srcdir/mpi/i386/syntax.h >>./mpi/asm-syntax.h
111 path="i586 i386" 111 path="i586 i386"
112 ;; 112 ;;
113 alpha*-*-*) 113 alpha*-*-*)
114 echo '/* configured for alpha */' >>./mpi/asm-syntax.h 114 echo '/* configured for alpha */' >>./mpi/asm-syntax.h
115 path="alpha" 115 path="alpha"
116 mpi_extra_modules="udiv-qrnnd" 116 mpi_extra_modules="udiv-qrnnd"
117 ;; 117 ;;
118 hppa7000*-*-*) 118 hppa7000*-*-*)
119 echo '/* configured for HPPA (pa7000) */' >>./mpi/asm-syntax.h 119 echo '/* configured for HPPA (pa7000) */' >>./mpi/asm-syntax.h
120 path="hppa1.1 hppa" 120 path="hppa1.1 hppa"
121 mpi_extra_modules="udiv-qrnnd" 121 mpi_extra_modules="udiv-qrnnd"
122 ;; 122 ;;
123 hppa1.0*-*-*) 123 hppa1.0*-*-*)
124 echo '/* configured for HPPA 1.0 */' >>./mpi/asm-syntax.h 124 echo '/* configured for HPPA 1.0 */' >>./mpi/asm-syntax.h
125 path="hppa" 125 path="hppa"
126 mpi_extra_modules="udiv-qrnnd" 126 mpi_extra_modules="udiv-qrnnd"
127 ;; 127 ;;
128 hppa*-*-*) # assume pa7100 128 hppa*-*-*) # assume pa7100
129 echo '/* configured for HPPA (pa7100) */' >>./mpi/asm-syntax.h 129 echo '/* configured for HPPA (pa7100) */' >>./mpi/asm-syntax.h
130 path="pa7100 hppa1.1 hppa" 130 path="pa7100 hppa1.1 hppa"
131 mpi_extra_modules="udiv-qrnnd" 131 mpi_extra_modules="udiv-qrnnd"
132 ;; 132 ;;
133 sparc64-*-linux-gnu) 133 sparc64-*-linux-gnu)
134 # An extra rule because we have an report for this one only. 134 # An extra rule because we have an report for this one only.
135 # Should be compared against the next GMP version 135 # Should be compared against the next GMP version
136 echo '/* configured for sparc64-*-linux-gnu */' >>./mpi/asm-syntax.h 136 echo '/* configured for sparc64-*-linux-gnu */' >>./mpi/asm-syntax.h
137 path="sparc32v8 sparc32" 137 path="sparc32v8 sparc32"
138 mpi_extra_modules="udiv" 138 mpi_extra_modules="udiv"
139 ;; 139 ;;
140 sparc64-sun-solaris2*) 140 sparc64-sun-solaris2*)
141 # Got a report that udiv is missing, so we try this one 141 # Got a report that udiv is missing, so we try this one
142 echo '/* configured for sparc64-sun-solaris2 */' >>./mpi/asm-syntax.h 142 echo '/* configured for sparc64-sun-solaris2 */' >>./mpi/asm-syntax.h
143 path="sparc32v8 sparc32" 143 path="sparc32v8 sparc32"
144 mpi_extra_modules="udiv" 144 mpi_extra_modules="udiv"
145 ;; 145 ;;
146 sparc64-*-netbsd* | sparc64-*-freebsd* | sparc64-*-openbsd*) 146 sparc64-*-netbsd* | sparc64-*-freebsd* | sparc64-*-openbsd*)
147 # There are no sparc64 assembler modules that work on the 147 # There are no sparc64 assembler modules that work on the
148 # *BSDs, so use the generic C functions. 148 # *BSDs, so use the generic C functions.
149 echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h 149 echo '/* No working assembler modules available */' >>./mpi/asm-syntax.h
150 path="" 150 path=""
151 ;; 151 ;;
152 sparc9*-*-* | \ 152 sparc9*-*-* | \
153 sparc64*-*-* | \ 153 sparc64*-*-* | \
154 ultrasparc*-*-* ) 154 ultrasparc*-*-* )
155 echo '/* configured for sparc9 or higher */' >>./mpi/asm-syntax.h 155 echo '/* configured for sparc9 or higher */' >>./mpi/asm-syntax.h
156 path="sparc32v8 sparc32" 156 path="sparc32v8 sparc32"
157 ;; 157 ;;
158 sparc8*-*-* | \ 158 sparc8*-*-* | \
159 microsparc*-*-*) 159 microsparc*-*-*)
160 echo '/* configured for sparc8 */' >>./mpi/asm-syntax.h 160 echo '/* configured for sparc8 */' >>./mpi/asm-syntax.h
161 path="sparc32v8 sparc32" 161 path="sparc32v8 sparc32"
162 ;; 162 ;;
163 supersparc*-*-*) 163 supersparc*-*-*)
164 echo '/* configured for supersparc */' >>./mpi/asm-syntax.h 164 echo '/* configured for supersparc */' >>./mpi/asm-syntax.h
165 path="supersparc sparc32v8 sparc32" 165 path="supersparc sparc32v8 sparc32"
166 mpi_extra_modules="udiv" 166 mpi_extra_modules="udiv"
167 ;; 167 ;;
168 sparc*-*-*) 168 sparc*-*-*)
169 echo '/* configured for sparc */' >>./mpi/asm-syntax.h 169 echo '/* configured for sparc */' >>./mpi/asm-syntax.h
170 path="sparc32" 170 path="sparc32"
171 mpi_extra_modules="udiv" 171 mpi_extra_modules="udiv"
172 ;; 172 ;;
173 mips[34]*-*-* | \ 173 mips[34]*-*-* | \
174 mips*-*-irix6*) 174 mips*-*-irix6*)
175 echo '/* configured for MIPS3 */' >>./mpi/asm-syntax.h 175 echo '/* configured for MIPS3 */' >>./mpi/asm-syntax.h
176 path="mips3" 176 path="mips3"
177 ;; 177 ;;
178 mips*-*-*) 178 mips*-*-*)
179 echo '/* configured for MIPS2 */' >>./mpi/asm-syntax.h 179 echo '/* configured for MIPS2 */' >>./mpi/asm-syntax.h
180 path="mips2" 180 path="mips2"
181 ;; 181 ;;
182 182
183 # Motorola 68k configurations. Let m68k mean 68020-68040. 183 # Motorola 68k configurations. Let m68k mean 68020-68040.
184 # mc68000 or mc68060 configurations need to be specified explicitly 184 # mc68000 or mc68060 configurations need to be specified explicitly
185 m680[234]0*-*-linuxaout* | \ 185 m680[234]0*-*-linuxaout* | \
186 m68k*-*-linuxaout*) 186 m68k*-*-linuxaout*)
187 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h 187 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h
188 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h 188 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h
189 path="m68k/mc68020 m68k" 189 path="m68k/mc68020 m68k"
190 ;; 190 ;;
191 m68060*-*-linuxaout*) 191 m68060*-*-linuxaout*)
192 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h 192 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h
193 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h 193 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h
194 path="m68k" 194 path="m68k"
195 ;; 195 ;;
196 m680[234]0*-*-linux* | \ 196 m680[234]0*-*-linux* | \
197 m68k*-*-linux*) 197 m68k*-*-linux*)
198 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 198 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
199 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h 199 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h
200 ;; 200 ;;
201 m68060*-*-linux*) 201 m68060*-*-linux*)
202 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 202 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
203 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h 203 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h
204 path="m68k" 204 path="m68k"
205 ;; 205 ;;
206 m68k-atari-mint) 206 m68k-atari-mint)
207 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h 207 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h
208 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h 208 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h
209 path="m68k/mc68020 m68k" 209 path="m68k/mc68020 m68k"
210 ;; 210 ;;
211 m68000*-*-* | \ 211 m68000*-*-* | \
212 m68060*-*-*) 212 m68060*-*-*)
213 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h 213 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h
214 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h 214 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h
215 path="m68k/mc68000" 215 path="m68k/mc68000"
216 ;; 216 ;;
217 m680[234]0*-*-* | \ 217 m680[234]0*-*-* | \
218 m68k*-*-*) 218 m68k*-*-*)
219 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h 219 echo '#define MIT_SYNTAX' >>./mpi/asm-syntax.h
220 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h 220 cat $srcdir/mpi/m68k/syntax.h >>./mpi/asm-syntax.h
221 path="m68k/mc68020 m68k" 221 path="m68k/mc68020 m68k"
222 ;; 222 ;;
223 223
224 powerpc*-*-linux*) 224 powerpc*-*-linux*)
225 echo '/* configured for powerpc/ELF */' >>./mpi/asm-syntax.h 225 echo '/* configured for powerpc/ELF */' >>./mpi/asm-syntax.h
226 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 226 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
227 cat $srcdir/mpi/powerpc32/syntax.h >>./mpi/asm-syntax.h 227 cat $srcdir/mpi/powerpc32/syntax.h >>./mpi/asm-syntax.h
228 path="powerpc32" 228 path="powerpc32"
229 ;; 229 ;;
230 230
231 powerpc*-*-netbsd* | powerpc*-*-openbsd*) 231 powerpc*-*-netbsd* | powerpc*-*-openbsd*)
232 echo '/* configured {Open,Net}BSD on powerpc */' >>./mpi/asm-syntax.h 232 echo '/* configured {Open,Net}BSD on powerpc */' >>./mpi/asm-syntax.h
233 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h 233 echo '#define ELF_SYNTAX' >>./mpi/asm-syntax.h
234 cat $srcdir/mpi/powerpc32/syntax.h >>./mpi/asm-syntax.h 234 cat $srcdir/mpi/powerpc32/syntax.h >>./mpi/asm-syntax.h
235 mpi_sflags="-Wa,-mppc" 235 mpi_sflags="-Wa,-mppc"
236 path="powerpc32" 236 path="powerpc32"
237 ;; 237 ;;
238 238
239 rs6000-*-aix[456789]* | \ 239 rs6000-*-aix[456789]* | \
240 rs6000-*-aix3.2.[456789]) 240 rs6000-*-aix3.2.[456789])
241 mpi_sflags="-Wa,-mpwr" 241 mpi_sflags="-Wa,-mpwr"
242 path="power" 242 path="power"
243 mpi_extra_modules="udiv-w-sdiv" 243 mpi_extra_modules="udiv-w-sdiv"
244 ;; 244 ;;
245 rs6000-*-* | \ 245 rs6000-*-* | \
246 power-*-* | \ 246 power-*-* | \
247 power2-*-*) 247 power2-*-*)
248 mpi_sflags="-Wa,-mppc" 248 mpi_sflags="-Wa,-mppc"
249 path="power" 249 path="power"
250 mpi_extra_modules="udiv-w-sdiv" 250 mpi_extra_modules="udiv-w-sdiv"
251 ;; 251 ;;
252 powerpc-ibm-aix4.2.* ) 252 powerpc-ibm-aix4.2.* )
253 # I am not sure about this one but a machine identified by 253 # I am not sure about this one but a machine identified by
254 # powerpc-ibm-aix4.2.1.0 cannot use the powerpc32 code. 254 # powerpc-ibm-aix4.2.1.0 cannot use the powerpc32 code.
255 mpi_sflags="-Wa,-mpwr" 255 mpi_sflags="-Wa,-mpwr"
256 path="power" 256 path="power"
257 mpi_extra_modules="udiv-w-sdiv" 257 mpi_extra_modules="udiv-w-sdiv"
258 ;; 258 ;;
259 ppc601-*-*) 259 ppc601-*-*)
260 mpi_sflags="-Wa,-mppc" 260 mpi_sflags="-Wa,-mppc"
261 path="power powerpc32" 261 path="power powerpc32"
262 ;; 262 ;;
263 ppc60[234]*-*-*) 263 ppc60[234]*-*-*)
264 mpi_sflags="-Wa,-mppc" 264 mpi_sflags="-Wa,-mppc"
265 path="powerpc32" 265 path="powerpc32"
266 ;; 266 ;;
267 ppc620-*-* | \ 267 ppc620-*-* | \
268 powerpc64*-*-*) 268 powerpc64*-*-*)
269 mpi_sflags="-Wa,-mppc" 269 mpi_sflags="-Wa,-mppc"
270 path="powerpc64" 270 path="powerpc64"
271 ;; 271 ;;
272 powerpc*-*-*) 272 powerpc*-*-*)
273 mpi_sflags="-Wa,-mppc" 273 mpi_sflags="-Wa,-mppc"
274 path="powerpc32" 274 path="powerpc32"
275 ;; 275 ;;
276 *) 276 *)
277 echo '/* No assembler modules configured */' >>./mpi/asm-syntax.h 277 echo '/* No assembler modules configured */' >>./mpi/asm-syntax.h
278 path="" 278 path=""
279 ;; 279 ;;
280esac 280esac
281else 281else
282 echo '/* Assembler modules disabled on request */' >>./mpi/asm-syntax.h 282 echo '/* Assembler modules disabled on request */' >>./mpi/asm-syntax.h
283 path="" 283 path=""
284fi 284fi
285 285
286 286
287# Make sysdep.h 287# Make sysdep.h
288echo '/* created by config.links - do not edit */' >./mpi/sysdep.h 288echo '/* created by config.links - do not edit */' >./mpi/sysdep.h
289if test x$ac_cv_sys_symbol_underscore = xyes; then 289if test x$ac_cv_sys_symbol_underscore = xyes; then
290 cat <<EOF >>./mpi/sysdep.h 290 cat <<EOF >>./mpi/sysdep.h
291#if __STDC__ 291#if __STDC__
292#define C_SYMBOL_NAME(name) _##name 292#define C_SYMBOL_NAME(name) _##name
293#else 293#else
294#define C_SYMBOL_NAME(name) _/**/name 294#define C_SYMBOL_NAME(name) _/**/name
295#endif 295#endif
296EOF 296EOF
297else 297else
298 cat <<EOF >>./mpi/sysdep.h 298 cat <<EOF >>./mpi/sysdep.h
299#define C_SYMBOL_NAME(name) name 299#define C_SYMBOL_NAME(name) name
300EOF 300EOF
301fi 301fi
302 302
303 303
304# Figure the required modules out 304# Figure the required modules out
305mpi_required_modules=$mpi_standard_modules 305mpi_required_modules=$mpi_standard_modules
306if test "$mpi_extra_modules" != ""; then 306if test "$mpi_extra_modules" != ""; then
307 for fn in $mpi_extra_modules; do 307 for fn in $mpi_extra_modules; do
308 for i in $mpi_optional_modules; do 308 for i in $mpi_optional_modules; do
309 if test "$fn" = "$i" ; then 309 if test "$fn" = "$i" ; then
310 mpi_required_modules="$mpi_required_modules $fn" 310 mpi_required_modules="$mpi_required_modules $fn"
311 fi 311 fi
312 done 312 done
313 done 313 done
314fi 314fi
315 315
316# try to get file to link from the assembler subdirectory and 316# try to get file to link from the assembler subdirectory and
317# if this fails get it from the generic subdirectory. 317# if this fails get it from the generic subdirectory.
318mpi_ln_list= 318mpi_ln_list=
319mpi_mod_list= 319mpi_mod_list=
320path="$path generic" 320path="$path generic"
321for fn in $mpi_required_modules ; do 321for fn in $mpi_required_modules ; do
322 fnu=`echo $fn | sed 's/-/_/g'` 322 fnu=`echo $fn | sed 's/-/_/g'`
323 eval mpi_mod_c_${fnu}=no 323 eval mpi_mod_c_${fnu}=no
324 eval mpi_mod_asm_${fnu}=no 324 eval mpi_mod_asm_${fnu}=no
325 for dir in $path ; do 325 for dir in $path ; do
326 rm -f $srcdir/mpi/$fn.[Sc] 326 rm -f $srcdir/mpi/$fn.[Sc]
327 if test -f $srcdir/mpi/$dir/$fn.S ; then 327 if test -f $srcdir/mpi/$dir/$fn.S ; then
328 mpi_ln_list="$mpi_ln_list mpi/$fn.S:mpi/$dir/$fn.S" 328 mpi_ln_list="$mpi_ln_list mpi/$fn.S:mpi/$dir/$fn.S"
329 eval mpi_mod_asm_${fnu}=yes 329 eval mpi_mod_asm_${fnu}=yes
330 mpi_mod_list="$mpi_mod_list $fn" 330 mpi_mod_list="$mpi_mod_list $fn"
331 break; 331 break;
332 elif test -f $srcdir/mpi/$dir/$fn.c ; then 332 elif test -f $srcdir/mpi/$dir/$fn.c ; then
333 mpi_ln_list="$mpi_ln_list mpi/$fn.c:mpi/$dir/$fn.c" 333 mpi_ln_list="$mpi_ln_list mpi/$fn.c:mpi/$dir/$fn.c"
334 eval mpi_mod_c_${fnu}=yes 334 eval mpi_mod_c_${fnu}=yes
335 mpi_mod_list="$mpi_mod_list $fn" 335 mpi_mod_list="$mpi_mod_list $fn"
336 break; 336 break;
337 fi 337 fi
338 done 338 done
339done 339done
340 340
341# Same thing for the file which defines the limb size 341# Same thing for the file which defines the limb size
342path="$path generic" 342path="$path generic"
343for dir in $path ; do 343for dir in $path ; do
344 rm -f $srcdir/mpi/mpi-asm-defs.h 344 rm -f $srcdir/mpi/mpi-asm-defs.h
345 if test -f $srcdir/mpi/$dir/mpi-asm-defs.h ; then 345 if test -f $srcdir/mpi/$dir/mpi-asm-defs.h ; then
346 mpi_ln_list="$mpi_ln_list mpi/mpi-asm-defs.h:mpi/$dir/mpi-asm-defs.h" 346 mpi_ln_list="$mpi_ln_list mpi/mpi-asm-defs.h:mpi/$dir/mpi-asm-defs.h"
347 break; 347 break;
348 fi 348 fi
349done 349done
350 350
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/Manifest
index 565920e..c429fde 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/Manifest
@@ -1,29 +1,29 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser general Public License as 7# it under the terms of the GNU Lesser general Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-add1.c iQCVAwUAP+Lj2DEAnp832S/7AQKn/AQAwQLWggl6zNQ5EZ+lE+jKV8W3FsogW3/6tp9T5rrSR5JnlWyoHQ9/Pu4knOcLjS6nIfVOiAEifu3nuIysQr9jDSSSJA2LylSUBSXKLKDamPsOCwXOLxiZODslJT3CCGAUtLvXJrWDbTZQrkEuwnLnjQFDzuA7iY9JLrG9kAoXD6Q==WoWm 20mpih-add1.c iQCVAwUAP+Lj2DEAnp832S/7AQKn/AQAwQLWggl6zNQ5EZ+lE+jKV8W3FsogW3/6tp9T5rrSR5JnlWyoHQ9/Pu4knOcLjS6nIfVOiAEifu3nuIysQr9jDSSSJA2LylSUBSXKLKDamPsOCwXOLxiZODslJT3CCGAUtLvXJrWDbTZQrkEuwnLnjQFDzuA7iY9JLrG9kAoXD6Q==WoWm
21mpih-mul1.c iQCVAwUAP+LkCTEAnp832S/7AQKFVQP+MhBNjcY73JtnsHZfnaVZq3TiKwN151cWV51nDc1RnTaMhSIFeuNlj3vNML2W0Gn8n+GnyiWE2XXdQEaik6BL02eekUn9aq7I/rdpnTHuOjQPK1uwjuNl8RuJ9YrERBAxq4oB71f+iwMab8dsMSUlVC+NdeAocRqLLgnR/efkdLc==2Tkb 21mpih-mul1.c iQCVAwUAP+LkCTEAnp832S/7AQKFVQP+MhBNjcY73JtnsHZfnaVZq3TiKwN151cWV51nDc1RnTaMhSIFeuNlj3vNML2W0Gn8n+GnyiWE2XXdQEaik6BL02eekUn9aq7I/rdpnTHuOjQPK1uwjuNl8RuJ9YrERBAxq4oB71f+iwMab8dsMSUlVC+NdeAocRqLLgnR/efkdLc==2Tkb
22mpih-mul2.c iQCVAwUAP+LkMjEAnp832S/7AQLPeAQAqmRzxFe/mDqTdZr/pTXT8RVyB1vKB0Ei2THV05BxmI4OPv39uysfFpLMt/INsX7AGqdOlj4jOZ/qNaFXR1ceMrlSXvo8u/epk6rCXFp82kM7Qs983LjoP//PrMCkYkXwblaVrgUGiBUCbuPMliWTK6qKkxxXtEfqZ7nVbEWdBx8==Kwhl 22mpih-mul2.c iQCVAwUAP+LkMjEAnp832S/7AQLPeAQAqmRzxFe/mDqTdZr/pTXT8RVyB1vKB0Ei2THV05BxmI4OPv39uysfFpLMt/INsX7AGqdOlj4jOZ/qNaFXR1ceMrlSXvo8u/epk6rCXFp82kM7Qs983LjoP//PrMCkYkXwblaVrgUGiBUCbuPMliWTK6qKkxxXtEfqZ7nVbEWdBx8==Kwhl
23mpih-mul3.c iQCVAwUAP+LkVDEAnp832S/7AQL91gP/Qd5iZWxRiN5DdEIVHAedoNvl23NPrT2UUdXvnSK49DpplTxkLiMBj0WqCayG/YIET2NpMRCeLvAZNcSt6lOm0bSZDYo1Hv/N+UoqD3V1McjY16REBv/nnPaMWMZcx7rl5yKTVZiX2PgV6oQOL7Yfrt5ZIOlrHBRs9S2/zcCaVz0==9BQe 23mpih-mul3.c iQCVAwUAP+LkVDEAnp832S/7AQL91gP/Qd5iZWxRiN5DdEIVHAedoNvl23NPrT2UUdXvnSK49DpplTxkLiMBj0WqCayG/YIET2NpMRCeLvAZNcSt6lOm0bSZDYo1Hv/N+UoqD3V1McjY16REBv/nnPaMWMZcx7rl5yKTVZiX2PgV6oQOL7Yfrt5ZIOlrHBRs9S2/zcCaVz0==9BQe
24mpih-lshift.c iQCVAwUAP+LlATEAnp832S/7AQIACAQAhMrpx0SRXE/LN1NkjMO9n74nMrvmzYJyru0gw2O4BYrUPvD/LWGju2FZaggKV0IBjmi0cDoCrNeK9EGjKOO1lfgODbX2IZ1LUhr9jDuMj0QRqj6T9YkAFYTNUk4GfpwIf7T6Ybo7c78Jx93PidCJt7d39eMMEalooC7LZ4IU3NM==nZ4k 24mpih-lshift.c iQCVAwUAP+LlATEAnp832S/7AQIACAQAhMrpx0SRXE/LN1NkjMO9n74nMrvmzYJyru0gw2O4BYrUPvD/LWGju2FZaggKV0IBjmi0cDoCrNeK9EGjKOO1lfgODbX2IZ1LUhr9jDuMj0QRqj6T9YkAFYTNUk4GfpwIf7T6Ybo7c78Jx93PidCJt7d39eMMEalooC7LZ4IU3NM==nZ4k
25mpih-rshift.c iQCVAwUAP+LlIjEAnp832S/7AQKiuAP/eYC2ZScd+taBx/kNzRvGjA0eAXvORMkMLV6Ot+OXVzVUi04eoP2yXdxSNFKwUj12p8GWXkdoMG3aOGBKg2a7bY5Q5RUho3hUWb9UsVYVUfXLf7IOTt/3a6MLh2CmV5dFPWJmSlbCyQRcn6n/fLDeJ3A2bWTS/BhqGfpOXUIU1ws==jCf8 25mpih-rshift.c iQCVAwUAP+LlIjEAnp832S/7AQKiuAP/eYC2ZScd+taBx/kNzRvGjA0eAXvORMkMLV6Ot+OXVzVUi04eoP2yXdxSNFKwUj12p8GWXkdoMG3aOGBKg2a7bY5Q5RUho3hUWb9UsVYVUfXLf7IOTt/3a6MLh2CmV5dFPWJmSlbCyQRcn6n/fLDeJ3A2bWTS/BhqGfpOXUIU1ws==jCf8
26mpih-sub1.c iQCVAwUAP+LlZzEAnp832S/7AQIEPgP/dLHTDRbPrYJhsLp9SjGstU1M8/IC5XytcDtO3NQeu4mx6vaXjpujtsTvKIbX4QL5IahNntVVKv1xFLEm2yFg7L2ns0uD/mfwGgOhCG1j2o/SaTAWP5KxP7ae5UDcZl2w6NWvEuMj9t32zmziAZjP8W73A37FUspeRDYiL9sQzkI==QQzk 26mpih-sub1.c iQCVAwUAP+LlZzEAnp832S/7AQIEPgP/dLHTDRbPrYJhsLp9SjGstU1M8/IC5XytcDtO3NQeu4mx6vaXjpujtsTvKIbX4QL5IahNntVVKv1xFLEm2yFg7L2ns0uD/mfwGgOhCG1j2o/SaTAWP5KxP7ae5UDcZl2w6NWvEuMj9t32zmziAZjP8W73A37FUspeRDYiL9sQzkI==QQzk
27udiv-w-sdiv.c iQCVAwUAP+Lk0TEAnp832S/7AQICXAQAsxe1SQD4+xZaZTqBC0V9Cyuo0mrdccnRFzthOtm0ARwKFXU2cuLW/ZBOkmeWOVmOFhBp22/I8dEGYnMA3gcfmOMCpNu9i9zk/XHfptdunA1MnOe3GsoWgfHL0rhpAyPhp/X043ICB41NElnnuxADuQQlD4Z1fca5ygYxMr2crJg==EI/6 27udiv-w-sdiv.c iQCVAwUAP+Lk0TEAnp832S/7AQICXAQAsxe1SQD4+xZaZTqBC0V9Cyuo0mrdccnRFzthOtm0ARwKFXU2cuLW/ZBOkmeWOVmOFhBp22/I8dEGYnMA3gcfmOMCpNu9i9zk/XHfptdunA1MnOe3GsoWgfHL0rhpAyPhp/X043ICB41NElnnuxADuQQlD4Z1fca5ygYxMr2crJg==EI/6
28mpi-asm-defs.h iQCVAwUAP+LkgDEAnp832S/7AQK0FgQAxJZ7xvXhoZa33GWe23LRb3asrno/loZSyAIXrntqtVH8M3pEsCY0OyW4ry4hX2RnxpuhRCM/PdRNLG3xXyMSVIhkHU8WVRLqzF2LLjEkyU3cAmHnnTQ9aO/XpUWtJGTZ8q2bv7ZsAEi4aPl0p6KhPXcPgM9vQ2XcyOPn3Dl0d6Q==xpjI 28mpi-asm-defs.h iQCVAwUAP+LkgDEAnp832S/7AQK0FgQAxJZ7xvXhoZa33GWe23LRb3asrno/loZSyAIXrntqtVH8M3pEsCY0OyW4ry4hX2RnxpuhRCM/PdRNLG3xXyMSVIhkHU8WVRLqzF2LLjEkyU3cAmHnnTQ9aO/XpUWtJGTZ8q2bv7ZsAEi4aPl0p6KhPXcPgM9vQ2XcyOPn3Dl0d6Q==xpjI
29$names$ iQCVAwUAP+LmNDEAnp832S/7AQJa+gP+KQNJpbNOgc+s2UX+Ya2gDaOFcAROImIllhg3ej8EaBF8xxdHmWT1zaKwTwi3moEEleykMR104YAGWyQeMbFYiuPPBW+ohrT6KxRBVJpIA9auOOqqJMyglZyoR3Hv7gduVYUW1h/DebnqiKXKEfzQDFqYuT0ayuteoOR4B5NICbE==nLSh 29$names$ iQCVAwUAP+LmNDEAnp832S/7AQJa+gP+KQNJpbNOgc+s2UX+Ya2gDaOFcAROImIllhg3ej8EaBF8xxdHmWT1zaKwTwi3moEEleykMR104YAGWyQeMbFYiuPPBW+ohrT6KxRBVJpIA9auOOqqJMyglZyoR3Hv7gduVYUW1h/DebnqiKXKEfzQDFqYuT0ayuteoOR4B5NICbE==nLSh
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/distfiles
index f569530..9810eef 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/distfiles
@@ -1,11 +1,11 @@
1Manifest 1Manifest
2mpih-add1.c 2mpih-add1.c
3mpih-mul1.c 3mpih-mul1.c
4mpih-mul2.c 4mpih-mul2.c
5mpih-mul3.c 5mpih-mul3.c
6mpih-lshift.c 6mpih-lshift.c
7mpih-rshift.c 7mpih-rshift.c
8mpih-sub1.c 8mpih-sub1.c
9udiv-w-sdiv.c 9udiv-w-sdiv.c
10mpi-asm-defs.h 10mpi-asm-defs.h
11 11
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpi-asm-defs.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpi-asm-defs.h
index 5cf33c8..13424e2 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpi-asm-defs.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpi-asm-defs.h
@@ -1,10 +1,10 @@
1/* This file defines some basic constants for the MPI machinery. We 1/* This file defines some basic constants for the MPI machinery. We
2 * need to define the types on a per-CPU basis, so it is done with 2 * need to define the types on a per-CPU basis, so it is done with
3 * this file here. */ 3 * this file here. */
4#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG) 4#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG)
5 5
6 6
7 7
8 8
9 9
10 10
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-add1.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-add1.c
index 2888641..4a84df6 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-add1.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-add1.c
@@ -1,65 +1,65 @@
1/* mpihelp-add_1.c - MPI helper functions 1/* mpihelp-add_1.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1997, 1998, 2 * Copyright (C) 1994, 1996, 1997, 1998,
3 * 2000, 2002 Free Software Foundation, Inc. 3 * 2000, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33 33
34mpi_limb_t 34mpi_limb_t
35_gcry_mpih_add_n (mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 35_gcry_mpih_add_n (mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
36 mpi_ptr_t s2_ptr, mpi_size_t size) 36 mpi_ptr_t s2_ptr, mpi_size_t size)
37{ 37{
38 mpi_limb_t x, y, cy; 38 mpi_limb_t x, y, cy;
39 mpi_size_t j; 39 mpi_size_t j;
40 40
41 /* The loop counter and index J goes from -SIZE to -1. This way 41 /* The loop counter and index J goes from -SIZE to -1. This way
42 the loop becomes faster. */ 42 the loop becomes faster. */
43 j = -size; 43 j = -size;
44 44
45 /* Offset the base pointers to compensate for the negative indices. */ 45 /* Offset the base pointers to compensate for the negative indices. */
46 s1_ptr -= j; 46 s1_ptr -= j;
47 s2_ptr -= j; 47 s2_ptr -= j;
48 res_ptr -= j; 48 res_ptr -= j;
49 49
50 cy = 0; 50 cy = 0;
51 do 51 do
52 { 52 {
53 y = s2_ptr[j]; 53 y = s2_ptr[j];
54 x = s1_ptr[j]; 54 x = s1_ptr[j];
55 y += cy; /* add previous carry to one addend */ 55 y += cy; /* add previous carry to one addend */
56 cy = y < cy; /* get out carry from that addition */ 56 cy = y < cy; /* get out carry from that addition */
57 y += x; /* add other addend */ 57 y += x; /* add other addend */
58 cy += y < x; /* get out carry from that add, combine */ 58 cy += y < x; /* get out carry from that add, combine */
59 res_ptr[j] = y; 59 res_ptr[j] = y;
60 } 60 }
61 while ( ++j ); 61 while ( ++j );
62 62
63 return cy; 63 return cy;
64} 64}
65 65
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-lshift.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-lshift.c
index 61beea3..f48c12c 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-lshift.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-lshift.c
@@ -1,68 +1,68 @@
1/* mpi-lshift.c - MPI helper functions 1/* mpi-lshift.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1998, 2001, 2002 Free Software Foundation, Inc. 2 * Copyright (C) 1994, 1996, 1998, 2001, 2002 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 * 19 *
20 * Note: This code is heavily based on the GNU MP Library. 20 * Note: This code is heavily based on the GNU MP Library.
21 * Actually it's the same code with only minor changes in the 21 * Actually it's the same code with only minor changes in the
22 * way the data is stored; this is to support the abstraction 22 * way the data is stored; this is to support the abstraction
23 * of an optional secure memory allocation which may be used 23 * of an optional secure memory allocation which may be used
24 * to avoid revealing of sensitive data due to paging etc. 24 * to avoid revealing of sensitive data due to paging etc.
25 */ 25 */
26 26
27#include <config.h> 27#include <config.h>
28#include <stdio.h> 28#include <stdio.h>
29#include <stdlib.h> 29#include <stdlib.h>
30#include "mpi-internal.h" 30#include "mpi-internal.h"
31 31
32/* Shift U (pointed to by UP and USIZE digits long) CNT bits to the left 32/* Shift U (pointed to by UP and USIZE digits long) CNT bits to the left
33 * and store the USIZE least significant digits of the result at WP. 33 * and store the USIZE least significant digits of the result at WP.
34 * Return the bits shifted out from the most significant digit. 34 * Return the bits shifted out from the most significant digit.
35 * 35 *
36 * Argument constraints: 36 * Argument constraints:
37 * 1. 0 < CNT < BITS_PER_MP_LIMB 37 * 1. 0 < CNT < BITS_PER_MP_LIMB
38 * 2. If the result is to be written over the input, WP must be >= UP. 38 * 2. If the result is to be written over the input, WP must be >= UP.
39 */ 39 */
40 40
41mpi_limb_t 41mpi_limb_t
42_gcry_mpih_lshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, 42_gcry_mpih_lshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize,
43 unsigned int cnt) 43 unsigned int cnt)
44{ 44{
45 mpi_limb_t high_limb, low_limb; 45 mpi_limb_t high_limb, low_limb;
46 unsigned sh_1, sh_2; 46 unsigned sh_1, sh_2;
47 mpi_size_t i; 47 mpi_size_t i;
48 mpi_limb_t retval; 48 mpi_limb_t retval;
49 49
50 sh_1 = cnt; 50 sh_1 = cnt;
51 wp += 1; 51 wp += 1;
52 sh_2 = BITS_PER_MPI_LIMB - sh_1; 52 sh_2 = BITS_PER_MPI_LIMB - sh_1;
53 i = usize - 1; 53 i = usize - 1;
54 low_limb = up[i]; 54 low_limb = up[i];
55 retval = low_limb >> sh_2; 55 retval = low_limb >> sh_2;
56 high_limb = low_limb; 56 high_limb = low_limb;
57 while ( --i >= 0 ) 57 while ( --i >= 0 )
58 { 58 {
59 low_limb = up[i]; 59 low_limb = up[i];
60 wp[i] = (high_limb << sh_1) | (low_limb >> sh_2); 60 wp[i] = (high_limb << sh_1) | (low_limb >> sh_2);
61 high_limb = low_limb; 61 high_limb = low_limb;
62 } 62 }
63 wp[i] = high_limb << sh_1; 63 wp[i] = high_limb << sh_1;
64 64
65 return retval; 65 return retval;
66} 66}
67 67
68 68
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul1.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul1.c
index 694a7f6..0e8197d 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul1.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul1.c
@@ -1,62 +1,62 @@
1/* mpihelp-mul_1.c - MPI helper functions 1/* mpihelp-mul_1.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1997, 1998, 2001, 2 * Copyright (C) 1994, 1996, 1997, 1998, 2001,
3 * 2002 Free Software Foundation, Inc. 3 * 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33 33
34mpi_limb_t 34mpi_limb_t
35_gcry_mpih_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, 35_gcry_mpih_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
36 mpi_limb_t s2_limb) 36 mpi_limb_t s2_limb)
37{ 37{
38 mpi_limb_t cy_limb; 38 mpi_limb_t cy_limb;
39 mpi_size_t j; 39 mpi_size_t j;
40 mpi_limb_t prod_high, prod_low; 40 mpi_limb_t prod_high, prod_low;
41 41
42 /* The loop counter and index J goes from -S1_SIZE to -1. This way 42 /* The loop counter and index J goes from -S1_SIZE to -1. This way
43 * the loop becomes faster. */ 43 * the loop becomes faster. */
44 j = -s1_size; 44 j = -s1_size;
45 45
46 /* Offset the base pointers to compensate for the negative indices. */ 46 /* Offset the base pointers to compensate for the negative indices. */
47 s1_ptr -= j; 47 s1_ptr -= j;
48 res_ptr -= j; 48 res_ptr -= j;
49 49
50 cy_limb = 0; 50 cy_limb = 0;
51 do 51 do
52 { 52 {
53 umul_ppmm( prod_high, prod_low, s1_ptr[j], s2_limb ); 53 umul_ppmm( prod_high, prod_low, s1_ptr[j], s2_limb );
54 prod_low += cy_limb; 54 prod_low += cy_limb;
55 cy_limb = (prod_low < cy_limb?1:0) + prod_high; 55 cy_limb = (prod_low < cy_limb?1:0) + prod_high;
56 res_ptr[j] = prod_low; 56 res_ptr[j] = prod_low;
57 } 57 }
58 while( ++j ); 58 while( ++j );
59 59
60 return cy_limb; 60 return cy_limb;
61} 61}
62 62
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul2.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul2.c
index 4dbcb9a..3b75496 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul2.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul2.c
@@ -1,68 +1,68 @@
1/* mpih-mul2.c - MPI helper functions 1/* mpih-mul2.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1997, 1998, 2001, 2 * Copyright (C) 1994, 1996, 1997, 1998, 2001,
3 * 2002 Free Software Foundation, Inc. 3 * 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33 33
34 34
35mpi_limb_t 35mpi_limb_t
36_gcry_mpih_addmul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 36_gcry_mpih_addmul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
37 mpi_size_t s1_size, mpi_limb_t s2_limb) 37 mpi_size_t s1_size, mpi_limb_t s2_limb)
38{ 38{
39 mpi_limb_t cy_limb; 39 mpi_limb_t cy_limb;
40 mpi_size_t j; 40 mpi_size_t j;
41 mpi_limb_t prod_high, prod_low; 41 mpi_limb_t prod_high, prod_low;
42 mpi_limb_t x; 42 mpi_limb_t x;
43 43
44 /* The loop counter and index J goes from -SIZE to -1. This way 44 /* The loop counter and index J goes from -SIZE to -1. This way
45 * the loop becomes faster. */ 45 * the loop becomes faster. */
46 j = -s1_size; 46 j = -s1_size;
47 res_ptr -= j; 47 res_ptr -= j;
48 s1_ptr -= j; 48 s1_ptr -= j;
49 49
50 cy_limb = 0; 50 cy_limb = 0;
51 do 51 do
52 { 52 {
53 umul_ppmm( prod_high, prod_low, s1_ptr[j], s2_limb ); 53 umul_ppmm( prod_high, prod_low, s1_ptr[j], s2_limb );
54 54
55 prod_low += cy_limb; 55 prod_low += cy_limb;
56 cy_limb = (prod_low < cy_limb?1:0) + prod_high; 56 cy_limb = (prod_low < cy_limb?1:0) + prod_high;
57 57
58 x = res_ptr[j]; 58 x = res_ptr[j];
59 prod_low = x + prod_low; 59 prod_low = x + prod_low;
60 cy_limb += prod_low < x?1:0; 60 cy_limb += prod_low < x?1:0;
61 res_ptr[j] = prod_low; 61 res_ptr[j] = prod_low;
62 } 62 }
63 while ( ++j ); 63 while ( ++j );
64 64
65 return cy_limb; 65 return cy_limb;
66} 66}
67 67
68 68
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul3.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul3.c
index 2975a6a..5e84f94 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul3.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-mul3.c
@@ -1,68 +1,68 @@
1/* mpih-mul3.c - MPI helper functions 1/* mpih-mul3.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1997, 1998, 2001, 2 * Copyright (C) 1994, 1996, 1997, 1998, 2001,
3 * 2002 Free Software Foundation, Inc. 3 * 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33 33
34 34
35mpi_limb_t 35mpi_limb_t
36_gcry_mpih_submul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 36_gcry_mpih_submul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
37 mpi_size_t s1_size, mpi_limb_t s2_limb) 37 mpi_size_t s1_size, mpi_limb_t s2_limb)
38{ 38{
39 mpi_limb_t cy_limb; 39 mpi_limb_t cy_limb;
40 mpi_size_t j; 40 mpi_size_t j;
41 mpi_limb_t prod_high, prod_low; 41 mpi_limb_t prod_high, prod_low;
42 mpi_limb_t x; 42 mpi_limb_t x;
43 43
44 /* The loop counter and index J goes from -SIZE to -1. This way 44 /* The loop counter and index J goes from -SIZE to -1. This way
45 * the loop becomes faster. */ 45 * the loop becomes faster. */
46 j = -s1_size; 46 j = -s1_size;
47 res_ptr -= j; 47 res_ptr -= j;
48 s1_ptr -= j; 48 s1_ptr -= j;
49 49
50 cy_limb = 0; 50 cy_limb = 0;
51 do 51 do
52 { 52 {
53 umul_ppmm( prod_high, prod_low, s1_ptr[j], s2_limb); 53 umul_ppmm( prod_high, prod_low, s1_ptr[j], s2_limb);
54 54
55 prod_low += cy_limb; 55 prod_low += cy_limb;
56 cy_limb = (prod_low < cy_limb?1:0) + prod_high; 56 cy_limb = (prod_low < cy_limb?1:0) + prod_high;
57 57
58 x = res_ptr[j]; 58 x = res_ptr[j];
59 prod_low = x - prod_low; 59 prod_low = x - prod_low;
60 cy_limb += prod_low > x?1:0; 60 cy_limb += prod_low > x?1:0;
61 res_ptr[j] = prod_low; 61 res_ptr[j] = prod_low;
62 } 62 }
63 while( ++j ); 63 while( ++j );
64 64
65 return cy_limb; 65 return cy_limb;
66} 66}
67 67
68 68
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-rshift.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-rshift.c
index d2c7311..e40794f 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-rshift.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-rshift.c
@@ -1,67 +1,67 @@
1/* mpih-rshift.c - MPI helper functions 1/* mpih-rshift.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1998, 1999, 2 * Copyright (C) 1994, 1996, 1998, 1999,
3 * 2000, 2001, 2002 Free Software Foundation, Inc. 3 * 2000, 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32 32
33 33
34/* Shift U (pointed to by UP and USIZE limbs long) CNT bits to the right 34/* Shift U (pointed to by UP and USIZE limbs long) CNT bits to the right
35 * and store the USIZE least significant limbs of the result at WP. 35 * and store the USIZE least significant limbs of the result at WP.
36 * The bits shifted out to the right are returned. 36 * The bits shifted out to the right are returned.
37 * 37 *
38 * Argument constraints: 38 * Argument constraints:
39 * 1. 0 < CNT < BITS_PER_MP_LIMB 39 * 1. 0 < CNT < BITS_PER_MP_LIMB
40 * 2. If the result is to be written over the input, WP must be <= UP. 40 * 2. If the result is to be written over the input, WP must be <= UP.
41 */ 41 */
42 42
43mpi_limb_t 43mpi_limb_t
44_gcry_mpih_rshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, unsigned cnt) 44_gcry_mpih_rshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, unsigned cnt)
45{ 45{
46 mpi_limb_t high_limb, low_limb; 46 mpi_limb_t high_limb, low_limb;
47 unsigned sh_1, sh_2; 47 unsigned sh_1, sh_2;
48 mpi_size_t i; 48 mpi_size_t i;
49 mpi_limb_t retval; 49 mpi_limb_t retval;
50 50
51 sh_1 = cnt; 51 sh_1 = cnt;
52 wp -= 1; 52 wp -= 1;
53 sh_2 = BITS_PER_MPI_LIMB - sh_1; 53 sh_2 = BITS_PER_MPI_LIMB - sh_1;
54 high_limb = up[0]; 54 high_limb = up[0];
55 retval = high_limb << sh_2; 55 retval = high_limb << sh_2;
56 low_limb = high_limb; 56 low_limb = high_limb;
57 for (i=1; i < usize; i++) 57 for (i=1; i < usize; i++)
58 { 58 {
59 high_limb = up[i]; 59 high_limb = up[i];
60 wp[i] = (low_limb >> sh_1) | (high_limb << sh_2); 60 wp[i] = (low_limb >> sh_1) | (high_limb << sh_2);
61 low_limb = high_limb; 61 low_limb = high_limb;
62 } 62 }
63 wp[i] = low_limb >> sh_1; 63 wp[i] = low_limb >> sh_1;
64 64
65 return retval; 65 return retval;
66} 66}
67 67
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-sub1.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-sub1.c
index 7c2c5ea..e88821b 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-sub1.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/mpih-sub1.c
@@ -1,66 +1,66 @@
1/* mpihelp-add_2.c - MPI helper functions 1/* mpihelp-add_2.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1997, 1998, 2001, 2 * Copyright (C) 1994, 1996, 1997, 1998, 2001,
3 * 2002 Free Software Foundation, Inc. 3 * 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33 33
34mpi_limb_t 34mpi_limb_t
35_gcry_mpih_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 35_gcry_mpih_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
36 mpi_ptr_t s2_ptr, mpi_size_t size) 36 mpi_ptr_t s2_ptr, mpi_size_t size)
37{ 37{
38 mpi_limb_t x, y, cy; 38 mpi_limb_t x, y, cy;
39 mpi_size_t j; 39 mpi_size_t j;
40 40
41 /* The loop counter and index J goes from -SIZE to -1. This way 41 /* The loop counter and index J goes from -SIZE to -1. This way
42 the loop becomes faster. */ 42 the loop becomes faster. */
43 j = -size; 43 j = -size;
44 44
45 /* Offset the base pointers to compensate for the negative indices. */ 45 /* Offset the base pointers to compensate for the negative indices. */
46 s1_ptr -= j; 46 s1_ptr -= j;
47 s2_ptr -= j; 47 s2_ptr -= j;
48 res_ptr -= j; 48 res_ptr -= j;
49 49
50 cy = 0; 50 cy = 0;
51 do 51 do
52 { 52 {
53 y = s2_ptr[j]; 53 y = s2_ptr[j];
54 x = s1_ptr[j]; 54 x = s1_ptr[j];
55 y += cy; /* add previous carry to subtrahend */ 55 y += cy; /* add previous carry to subtrahend */
56 cy = y < cy; /* get out carry from that addition */ 56 cy = y < cy; /* get out carry from that addition */
57 y = x - y; /* main subtract */ 57 y = x - y; /* main subtract */
58 cy += y > x; /* get out carry from the subtract, combine */ 58 cy += y > x; /* get out carry from the subtract, combine */
59 res_ptr[j] = y; 59 res_ptr[j] = y;
60 } 60 }
61 while( ++j ); 61 while( ++j );
62 62
63 return cy; 63 return cy;
64} 64}
65 65
66 66
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/udiv-w-sdiv.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/udiv-w-sdiv.c
index fd86704..e80d98b 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/udiv-w-sdiv.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/generic/udiv-w-sdiv.c
@@ -1,133 +1,133 @@
1/* mpih-w-sdiv -- implement udiv_qrnnd on machines with only signed 1/* mpih-w-sdiv -- implement udiv_qrnnd on machines with only signed
2 * division. 2 * division.
3 * Copyright (C) 1992, 1994, 1996, 1998, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1992, 1994, 1996, 1998, 2002 Free Software Foundation, Inc.
4 * Contributed by Peter L. Montgomery. 4 * Contributed by Peter L. Montgomery.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include <config.h> 23#include <config.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <stdlib.h> 25#include <stdlib.h>
26#include "mpi-internal.h" 26#include "mpi-internal.h"
27#include "longlong.h" 27#include "longlong.h"
28 28
29 29
30#if 0 /* not yet ported to MPI */ 30#if 0 /* not yet ported to MPI */
31 31
32mpi_limb_t 32mpi_limb_t
33mpihelp_udiv_w_sdiv( mpi_limp_t *rp, 33mpihelp_udiv_w_sdiv( mpi_limp_t *rp,
34 mpi_limp_t *a1, 34 mpi_limp_t *a1,
35 mpi_limp_t *a0, 35 mpi_limp_t *a0,
36 mpi_limp_t *d ) 36 mpi_limp_t *d )
37{ 37{
38 mp_limb_t q, r; 38 mp_limb_t q, r;
39 mp_limb_t c0, c1, b1; 39 mp_limb_t c0, c1, b1;
40 40
41 if ((mpi_limb_signed_t) d >= 0) 41 if ((mpi_limb_signed_t) d >= 0)
42 { 42 {
43 if (a1 < d - a1 - (a0 >> (BITS_PER_MP_LIMB - 1))) 43 if (a1 < d - a1 - (a0 >> (BITS_PER_MP_LIMB - 1)))
44 { 44 {
45 /* dividend, divisor, and quotient are nonnegative */ 45 /* dividend, divisor, and quotient are nonnegative */
46 sdiv_qrnnd (q, r, a1, a0, d); 46 sdiv_qrnnd (q, r, a1, a0, d);
47 } 47 }
48 else 48 else
49 { 49 {
50 /* Compute c1*2^32 + c0 = a1*2^32 + a0 - 2^31*d */ 50 /* Compute c1*2^32 + c0 = a1*2^32 + a0 - 2^31*d */
51 sub_ddmmss (c1, c0, a1, a0, d >> 1, d << (BITS_PER_MP_LIMB - 1)); 51 sub_ddmmss (c1, c0, a1, a0, d >> 1, d << (BITS_PER_MP_LIMB - 1));
52 /* Divide (c1*2^32 + c0) by d */ 52 /* Divide (c1*2^32 + c0) by d */
53 sdiv_qrnnd (q, r, c1, c0, d); 53 sdiv_qrnnd (q, r, c1, c0, d);
54 /* Add 2^31 to quotient */ 54 /* Add 2^31 to quotient */
55 q += (mp_limb_t) 1 << (BITS_PER_MP_LIMB - 1); 55 q += (mp_limb_t) 1 << (BITS_PER_MP_LIMB - 1);
56 } 56 }
57 } 57 }
58 else 58 else
59 { 59 {
60 b1 = d >> 1; /* d/2, between 2^30 and 2^31 - 1 */ 60 b1 = d >> 1; /* d/2, between 2^30 and 2^31 - 1 */
61 c1 = a1 >> 1; /* A/2 */ 61 c1 = a1 >> 1; /* A/2 */
62 c0 = (a1 << (BITS_PER_MP_LIMB - 1)) + (a0 >> 1); 62 c0 = (a1 << (BITS_PER_MP_LIMB - 1)) + (a0 >> 1);
63 63
64 if (a1 < b1) /* A < 2^32*b1, so A/2 < 2^31*b1 */ 64 if (a1 < b1) /* A < 2^32*b1, so A/2 < 2^31*b1 */
65 { 65 {
66 sdiv_qrnnd (q, r, c1, c0, b1); /* (A/2) / (d/2) */ 66 sdiv_qrnnd (q, r, c1, c0, b1); /* (A/2) / (d/2) */
67 67
68 r = 2*r + (a0 & 1); /* Remainder from A/(2*b1) */ 68 r = 2*r + (a0 & 1); /* Remainder from A/(2*b1) */
69 if ((d & 1) != 0) 69 if ((d & 1) != 0)
70 { 70 {
71 if (r >= q) 71 if (r >= q)
72 r = r - q; 72 r = r - q;
73 else if (q - r <= d) 73 else if (q - r <= d)
74 { 74 {
75 r = r - q + d; 75 r = r - q + d;
76 q--; 76 q--;
77 } 77 }
78 else 78 else
79 { 79 {
80 r = r - q + 2*d; 80 r = r - q + 2*d;
81 q -= 2; 81 q -= 2;
82 } 82 }
83 } 83 }
84 } 84 }
85 else if (c1 < b1) /* So 2^31 <= (A/2)/b1 < 2^32 */ 85 else if (c1 < b1) /* So 2^31 <= (A/2)/b1 < 2^32 */
86 { 86 {
87 c1 = (b1 - 1) - c1; 87 c1 = (b1 - 1) - c1;
88 c0 = ~c0; /* logical NOT */ 88 c0 = ~c0; /* logical NOT */
89 89
90 sdiv_qrnnd (q, r, c1, c0, b1); /* (A/2) / (d/2) */ 90 sdiv_qrnnd (q, r, c1, c0, b1); /* (A/2) / (d/2) */
91 91
92 q = ~q; /* (A/2)/b1 */ 92 q = ~q; /* (A/2)/b1 */
93 r = (b1 - 1) - r; 93 r = (b1 - 1) - r;
94 94
95 r = 2*r + (a0 & 1); /* A/(2*b1) */ 95 r = 2*r + (a0 & 1); /* A/(2*b1) */
96 96
97 if ((d & 1) != 0) 97 if ((d & 1) != 0)
98 { 98 {
99 if (r >= q) 99 if (r >= q)
100 r = r - q; 100 r = r - q;
101 else if (q - r <= d) 101 else if (q - r <= d)
102 { 102 {
103 r = r - q + d; 103 r = r - q + d;
104 q--; 104 q--;
105 } 105 }
106 else 106 else
107 { 107 {
108 r = r - q + 2*d; 108 r = r - q + 2*d;
109 q -= 2; 109 q -= 2;
110 } 110 }
111 } 111 }
112 } 112 }
113 else /* Implies c1 = b1 */ 113 else /* Implies c1 = b1 */
114 { /* Hence a1 = d - 1 = 2*b1 - 1 */ 114 { /* Hence a1 = d - 1 = 2*b1 - 1 */
115 if (a0 >= -d) 115 if (a0 >= -d)
116 { 116 {
117 q = -1; 117 q = -1;
118 r = a0 + d; 118 r = a0 + d;
119 } 119 }
120 else 120 else
121 { 121 {
122 q = -2; 122 q = -2;
123 r = a0 + 2*d; 123 r = a0 + 2*d;
124 } 124 }
125 } 125 }
126 } 126 }
127 127
128 *rp = r; 128 *rp = r;
129 return q; 129 return q;
130} 130}
131 131
132#endif 132#endif
133 133
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/README b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/README
index ae42a48..5a2d5fd 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/README
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/README
@@ -1,84 +1,84 @@
1This directory contains mpn functions for various HP PA-RISC chips. Code 1This directory contains mpn functions for various HP PA-RISC chips. Code
2that runs faster on the PA7100 and later implementations, is in the pa7100 2that runs faster on the PA7100 and later implementations, is in the pa7100
3directory. 3directory.
4 4
5RELEVANT OPTIMIZATION ISSUES 5RELEVANT OPTIMIZATION ISSUES
6 6
7 Load and Store timing 7 Load and Store timing
8 8
9On the PA7000 no memory instructions can issue the two cycles after a store. 9On the PA7000 no memory instructions can issue the two cycles after a store.
10For the PA7100, this is reduced to one cycle. 10For the PA7100, this is reduced to one cycle.
11 11
12The PA7100 has a lookup-free cache, so it helps to schedule loads and the 12The PA7100 has a lookup-free cache, so it helps to schedule loads and the
13dependent instruction really far from each other. 13dependent instruction really far from each other.
14 14
15STATUS 15STATUS
16 16
171. mpn_mul_1 could be improved to 6.5 cycles/limb on the PA7100, using the 171. mpn_mul_1 could be improved to 6.5 cycles/limb on the PA7100, using the
18 instructions bwlow (but some sw pipelining is needed to avoid the 18 instructions bwlow (but some sw pipelining is needed to avoid the
19 xmpyu-fstds delay): 19 xmpyu-fstds delay):
20 20
21 fldds s1_ptr 21 fldds s1_ptr
22 22
23 xmpyu 23 xmpyu
24 fstds N(%r30) 24 fstds N(%r30)
25 xmpyu 25 xmpyu
26 fstds N(%r30) 26 fstds N(%r30)
27 27
28 ldws N(%r30) 28 ldws N(%r30)
29 ldws N(%r30) 29 ldws N(%r30)
30 ldws N(%r30) 30 ldws N(%r30)
31 ldws N(%r30) 31 ldws N(%r30)
32 32
33 addc 33 addc
34 stws res_ptr 34 stws res_ptr
35 addc 35 addc
36 stws res_ptr 36 stws res_ptr
37 37
38 addib Loop 38 addib Loop
39 39
402. mpn_addmul_1 could be improved from the current 10 to 7.5 cycles/limb 402. mpn_addmul_1 could be improved from the current 10 to 7.5 cycles/limb
41 (asymptotically) on the PA7100, using the instructions below. With proper 41 (asymptotically) on the PA7100, using the instructions below. With proper
42 sw pipelining and the unrolling level below, the speed becomes 8 42 sw pipelining and the unrolling level below, the speed becomes 8
43 cycles/limb. 43 cycles/limb.
44 44
45 fldds s1_ptr 45 fldds s1_ptr
46 fldds s1_ptr 46 fldds s1_ptr
47 47
48 xmpyu 48 xmpyu
49 fstds N(%r30) 49 fstds N(%r30)
50 xmpyu 50 xmpyu
51 fstds N(%r30) 51 fstds N(%r30)
52 xmpyu 52 xmpyu
53 fstds N(%r30) 53 fstds N(%r30)
54 xmpyu 54 xmpyu
55 fstds N(%r30) 55 fstds N(%r30)
56 56
57 ldws N(%r30) 57 ldws N(%r30)
58 ldws N(%r30) 58 ldws N(%r30)
59 ldws N(%r30) 59 ldws N(%r30)
60 ldws N(%r30) 60 ldws N(%r30)
61 ldws N(%r30) 61 ldws N(%r30)
62 ldws N(%r30) 62 ldws N(%r30)
63 ldws N(%r30) 63 ldws N(%r30)
64 ldws N(%r30) 64 ldws N(%r30)
65 addc 65 addc
66 addc 66 addc
67 addc 67 addc
68 addc 68 addc
69 addc %r0,%r0,cy-limb 69 addc %r0,%r0,cy-limb
70 70
71 ldws res_ptr 71 ldws res_ptr
72 ldws res_ptr 72 ldws res_ptr
73 ldws res_ptr 73 ldws res_ptr
74 ldws res_ptr 74 ldws res_ptr
75 add 75 add
76 stws res_ptr 76 stws res_ptr
77 addc 77 addc
78 stws res_ptr 78 stws res_ptr
79 addc 79 addc
80 stws res_ptr 80 stws res_ptr
81 addc 81 addc
82 stws res_ptr 82 stws res_ptr
83 83
84 addib 84 addib
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/distfiles
index ef180c6..7f24205 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/distfiles
@@ -1,7 +1,7 @@
1README 1README
2udiv-qrnnd.S 2udiv-qrnnd.S
3mpih-add1.S 3mpih-add1.S
4mpih-sub1.S 4mpih-sub1.S
5mpih-lshift.S 5mpih-lshift.S
6mpih-rshift.S 6mpih-rshift.S
7 7
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-add1.S
index f521de0..3bc0e5e 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-add1.S
@@ -1,70 +1,70 @@
1/* hppa add_n -- Add two limb vectors of the same length > 0 and store 1/* hppa 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, 1998, 4 * Copyright (C) 1992, 1994, 1998,
5 * 2001, 2002 Fee Software Foundation, Inc. 5 * 2001, 2002 Fee 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 31
32/******************* 32/*******************
33 * mpi_limb_t 33 * mpi_limb_t
34 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (gr26) 34 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (gr26)
35 * mpi_ptr_t s1_ptr, (gr25) 35 * mpi_ptr_t s1_ptr, (gr25)
36 * mpi_ptr_t s2_ptr, (gr24) 36 * mpi_ptr_t s2_ptr, (gr24)
37 * mpi_size_t size) (gr23) 37 * mpi_size_t size) (gr23)
38 * 38 *
39 * One might want to unroll this as for other processors, but it turns 39 * One might want to unroll this as for other processors, but it turns
40 * out that the data cache contention after a store makes such 40 * out that the data cache contention after a store makes such
41 * unrolling useless. We can't come under 5 cycles/limb anyway. 41 * unrolling useless. We can't come under 5 cycles/limb anyway.
42 */ 42 */
43 43
44 .code 44 .code
45 .export _gcry_mpih_add_n 45 .export _gcry_mpih_add_n
46 .label _gcry_mpih_add_n 46 .label _gcry_mpih_add_n
47 .proc 47 .proc
48 .callinfo frame=0,no_calls 48 .callinfo frame=0,no_calls
49 .entry 49 .entry
50 50
51 ldws,ma 4(0,%r25),%r20 51 ldws,ma 4(0,%r25),%r20
52 ldws,ma 4(0,%r24),%r19 52 ldws,ma 4(0,%r24),%r19
53 53
54 addib,= -1,%r23,L$end ; check for (SIZE == 1) 54 addib,= -1,%r23,L$end ; check for (SIZE == 1)
55 add %r20,%r19,%r28 ; add first limbs ignoring cy 55 add %r20,%r19,%r28 ; add first limbs ignoring cy
56 56
57 .label L$loop 57 .label L$loop
58 ldws,ma 4(0,%r25),%r20 58 ldws,ma 4(0,%r25),%r20
59 ldws,ma 4(0,%r24),%r19 59 ldws,ma 4(0,%r24),%r19
60 stws,ma %r28,4(0,%r26) 60 stws,ma %r28,4(0,%r26)
61 addib,<> -1,%r23,L$loop 61 addib,<> -1,%r23,L$loop
62 addc %r20,%r19,%r28 62 addc %r20,%r19,%r28
63 63
64 .label L$end 64 .label L$end
65 stws %r28,0(0,%r26) 65 stws %r28,0(0,%r26)
66 bv 0(%r2) 66 bv 0(%r2)
67 addc %r0,%r0,%r28 67 addc %r0,%r0,%r28
68 68
69 .exit 69 .exit
70 .procend 70 .procend
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-lshift.S
index 607982f..91b29bb 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-lshift.S
@@ -1,77 +1,77 @@
1/* hppa lshift 1/* hppa lshift
2 * 2 *
3 * Copyright (C) 1992, 1994, 1998 3 * Copyright (C) 1992, 1994, 1998
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_lshift( mpi_ptr_t wp, (gr26) 27 * _gcry_mpih_lshift( mpi_ptr_t wp, (gr26)
28 * mpi_ptr_t up, (gr25) 28 * mpi_ptr_t up, (gr25)
29 * mpi_size_t usize, (gr24) 29 * mpi_size_t usize, (gr24)
30 * unsigned cnt) (gr23) 30 * unsigned cnt) (gr23)
31 */ 31 */
32 32
33 .code 33 .code
34 .export _gcry_mpih_lshift 34 .export _gcry_mpih_lshift
35 .label _gcry_mpih_lshift 35 .label _gcry_mpih_lshift
36 .proc 36 .proc
37 .callinfo frame=64,no_calls 37 .callinfo frame=64,no_calls
38 .entry 38 .entry
39 39
40 sh2add %r24,%r25,%r25 40 sh2add %r24,%r25,%r25
41 sh2add %r24,%r26,%r26 41 sh2add %r24,%r26,%r26
42 ldws,mb -4(0,%r25),%r22 42 ldws,mb -4(0,%r25),%r22
43 subi 32,%r23,%r1 43 subi 32,%r23,%r1
44 mtsar %r1 44 mtsar %r1
45 addib,= -1,%r24,L$0004 45 addib,= -1,%r24,L$0004
46 vshd %r0,%r22,%r28 ; compute carry out limb 46 vshd %r0,%r22,%r28 ; compute carry out limb
47 ldws,mb -4(0,%r25),%r29 47 ldws,mb -4(0,%r25),%r29
48 addib,= -1,%r24,L$0002 48 addib,= -1,%r24,L$0002
49 vshd %r22,%r29,%r20 49 vshd %r22,%r29,%r20
50 50
51 .label L$loop 51 .label L$loop
52 ldws,mb -4(0,%r25),%r22 52 ldws,mb -4(0,%r25),%r22
53 stws,mb %r20,-4(0,%r26) 53 stws,mb %r20,-4(0,%r26)
54 addib,= -1,%r24,L$0003 54 addib,= -1,%r24,L$0003
55 vshd %r29,%r22,%r20 55 vshd %r29,%r22,%r20
56 ldws,mb -4(0,%r25),%r29 56 ldws,mb -4(0,%r25),%r29
57 stws,mb %r20,-4(0,%r26) 57 stws,mb %r20,-4(0,%r26)
58 addib,<> -1,%r24,L$loop 58 addib,<> -1,%r24,L$loop
59 vshd %r22,%r29,%r20 59 vshd %r22,%r29,%r20
60 60
61 .label L$0002 61 .label L$0002
62 stws,mb %r20,-4(0,%r26) 62 stws,mb %r20,-4(0,%r26)
63 vshd %r29,%r0,%r20 63 vshd %r29,%r0,%r20
64 bv 0(%r2) 64 bv 0(%r2)
65 stw %r20,-4(0,%r26) 65 stw %r20,-4(0,%r26)
66 .label L$0003 66 .label L$0003
67 stws,mb %r20,-4(0,%r26) 67 stws,mb %r20,-4(0,%r26)
68 .label L$0004 68 .label L$0004
69 vshd %r22,%r0,%r20 69 vshd %r22,%r0,%r20
70 bv 0(%r2) 70 bv 0(%r2)
71 stw %r20,-4(0,%r26) 71 stw %r20,-4(0,%r26)
72 72
73 .exit 73 .exit
74 .procend 74 .procend
75 75
76 76
77 77
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-rshift.S
index 9801c02..37a9d4e 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-rshift.S
@@ -1,73 +1,73 @@
1/* hppa rshift 1/* hppa rshift
2 * 2 *
3 * Copyright (C) 1992, 1994, 1998, 3 * Copyright (C) 1992, 1994, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23 23
24 24
25 25
26/******************* 26/*******************
27 * mpi_limb_t 27 * mpi_limb_t
28 * _gcry_mpih_rshift( mpi_ptr_t wp, (gr26) 28 * _gcry_mpih_rshift( mpi_ptr_t wp, (gr26)
29 * mpi_ptr_t up, (gr25) 29 * mpi_ptr_t up, (gr25)
30 * mpi_size_t usize, (gr24) 30 * mpi_size_t usize, (gr24)
31 * unsigned cnt) (gr23) 31 * unsigned cnt) (gr23)
32 */ 32 */
33 33
34 .code 34 .code
35 .export _gcry_mpih_rshift 35 .export _gcry_mpih_rshift
36 .label _gcry_mpih_rshift 36 .label _gcry_mpih_rshift
37 .proc 37 .proc
38 .callinfo frame=64,no_calls 38 .callinfo frame=64,no_calls
39 .entry 39 .entry
40 40
41 ldws,ma 4(0,%r25),%r22 41 ldws,ma 4(0,%r25),%r22
42 mtsar %r23 42 mtsar %r23
43 addib,= -1,%r24,L$r004 43 addib,= -1,%r24,L$r004
44 vshd %r22,%r0,%r28 ; compute carry out limb 44 vshd %r22,%r0,%r28 ; compute carry out limb
45 ldws,ma 4(0,%r25),%r29 45 ldws,ma 4(0,%r25),%r29
46 addib,= -1,%r24,L$r002 46 addib,= -1,%r24,L$r002
47 vshd %r29,%r22,%r20 47 vshd %r29,%r22,%r20
48 48
49 .label L$roop 49 .label L$roop
50 ldws,ma 4(0,%r25),%r22 50 ldws,ma 4(0,%r25),%r22
51 stws,ma %r20,4(0,%r26) 51 stws,ma %r20,4(0,%r26)
52 addib,= -1,%r24,L$r003 52 addib,= -1,%r24,L$r003
53 vshd %r22,%r29,%r20 53 vshd %r22,%r29,%r20
54 ldws,ma 4(0,%r25),%r29 54 ldws,ma 4(0,%r25),%r29
55 stws,ma %r20,4(0,%r26) 55 stws,ma %r20,4(0,%r26)
56 addib,<> -1,%r24,L$roop 56 addib,<> -1,%r24,L$roop
57 vshd %r29,%r22,%r20 57 vshd %r29,%r22,%r20
58 58
59 .label L$r002 59 .label L$r002
60 stws,ma %r20,4(0,%r26) 60 stws,ma %r20,4(0,%r26)
61 vshd %r0,%r29,%r20 61 vshd %r0,%r29,%r20
62 bv 0(%r2) 62 bv 0(%r2)
63 stw %r20,0(0,%r26) 63 stw %r20,0(0,%r26)
64 .label L$r003 64 .label L$r003
65 stws,ma %r20,4(0,%r26) 65 stws,ma %r20,4(0,%r26)
66 .label L$r004 66 .label L$r004
67 vshd %r0,%r22,%r20 67 vshd %r0,%r22,%r20
68 bv 0(%r2) 68 bv 0(%r2)
69 stw %r20,0(0,%r26) 69 stw %r20,0(0,%r26)
70 70
71 .exit 71 .exit
72 .procend 72 .procend
73 73
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-sub1.S
index cc4b837..8d197e4 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/mpih-sub1.S
@@ -1,78 +1,78 @@
1/* hppa sub_n -- Sub two limb vectors of the same length > 0 and store 1/* hppa sub_n -- Sub 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, 1998, 4 * Copyright (C) 1992, 1994, 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_sub_n( mpi_ptr_t res_ptr, (gr26) 37 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (gr26)
38 * mpi_ptr_t s1_ptr, (gr25) 38 * mpi_ptr_t s1_ptr, (gr25)
39 * mpi_ptr_t s2_ptr, (gr24) 39 * mpi_ptr_t s2_ptr, (gr24)
40 * mpi_size_t size) (gr23) 40 * mpi_size_t size) (gr23)
41 * 41 *
42 * One might want to unroll this as for other processors, but it turns 42 * One might want to unroll this as for other processors, but it turns
43 * out that the data cache contention after a store makes such 43 * out that the data cache contention after a store makes such
44 * unrolling useless. We can't come under 5 cycles/limb anyway. 44 * unrolling useless. We can't come under 5 cycles/limb anyway.
45 */ 45 */
46 46
47 47
48 .code 48 .code
49 .export _gcry_mpih_sub_n 49 .export _gcry_mpih_sub_n
50 .label _gcry_mpih_sub_n 50 .label _gcry_mpih_sub_n
51 .proc 51 .proc
52 .callinfo frame=0,no_calls 52 .callinfo frame=0,no_calls
53 .entry 53 .entry
54 54
55 ldws,ma 4(0,%r25),%r20 55 ldws,ma 4(0,%r25),%r20
56 ldws,ma 4(0,%r24),%r19 56 ldws,ma 4(0,%r24),%r19
57 57
58 addib,= -1,%r23,L$end ; check for (SIZE == 1) 58 addib,= -1,%r23,L$end ; check for (SIZE == 1)
59 sub %r20,%r19,%r28 ; subtract first limbs ignoring cy 59 sub %r20,%r19,%r28 ; subtract first limbs ignoring cy
60 60
61 .label L$loop 61 .label L$loop
62 ldws,ma 4(0,%r25),%r20 62 ldws,ma 4(0,%r25),%r20
63 ldws,ma 4(0,%r24),%r19 63 ldws,ma 4(0,%r24),%r19
64 stws,ma %r28,4(0,%r26) 64 stws,ma %r28,4(0,%r26)
65 addib,<> -1,%r23,L$loop 65 addib,<> -1,%r23,L$loop
66 subb %r20,%r19,%r28 66 subb %r20,%r19,%r28
67 67
68 .label L$end 68 .label L$end
69 stws %r28,0(0,%r26) 69 stws %r28,0(0,%r26)
70 addc %r0,%r0,%r28 70 addc %r0,%r0,%r28
71 bv 0(%r2) 71 bv 0(%r2)
72 subi 1,%r28,%r28 72 subi 1,%r28,%r28
73 73
74 .exit 74 .exit
75 .procend 75 .procend
76 76
77 77
78 78
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/udiv-qrnnd.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/udiv-qrnnd.S
index 81b432b..59ebf7a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/udiv-qrnnd.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa/udiv-qrnnd.S
@@ -1,297 +1,297 @@
1/* HP-PA __udiv_qrnnd division support, used from longlong.h. 1/* HP-PA __udiv_qrnnd division support, used from longlong.h.
2 * This version runs fast on pre-PA7000 CPUs. 2 * This version runs fast on pre-PA7000 CPUs.
3 * 3 *
4 * Copyright (C) 1993, 1994, 1998, 2001, 4 * Copyright (C) 1993, 1994, 1998, 2001,
5 * 2002 Free Software Foundation, Inc. 5 * 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 31
32/* INPUT PARAMETERS 32/* INPUT PARAMETERS
33 * rem_ptr gr26 33 * rem_ptr gr26
34 * n1 gr25 34 * n1 gr25
35 * n0 gr24 35 * n0 gr24
36 * d gr23 36 * d gr23
37 * 37 *
38 * The code size is a bit excessive. We could merge the last two ds;addc 38 * The code size is a bit excessive. We could merge the last two ds;addc
39 * sequences by simply moving the "bb,< Odd" instruction down. The only 39 * sequences by simply moving the "bb,< Odd" instruction down. The only
40 * trouble is the FFFFFFFF code that would need some hacking. 40 * trouble is the FFFFFFFF code that would need some hacking.
41 */ 41 */
42 42
43 .code 43 .code
44 .export __udiv_qrnnd 44 .export __udiv_qrnnd
45 .label __udiv_qrnnd 45 .label __udiv_qrnnd
46 .proc 46 .proc
47 .callinfo frame=0,no_calls 47 .callinfo frame=0,no_calls
48 .entry 48 .entry
49 49
50 comb,< %r23,0,L$largedivisor 50 comb,< %r23,0,L$largedivisor
51 sub %r0,%r23,%r1 ; clear cy as side-effect 51 sub %r0,%r23,%r1 ; clear cy as side-effect
52 ds %r0,%r1,%r0 52 ds %r0,%r1,%r0
53 addc %r24,%r24,%r24 53 addc %r24,%r24,%r24
54 ds %r25,%r23,%r25 54 ds %r25,%r23,%r25
55 addc %r24,%r24,%r24 55 addc %r24,%r24,%r24
56 ds %r25,%r23,%r25 56 ds %r25,%r23,%r25
57 addc %r24,%r24,%r24 57 addc %r24,%r24,%r24
58 ds %r25,%r23,%r25 58 ds %r25,%r23,%r25
59 addc %r24,%r24,%r24 59 addc %r24,%r24,%r24
60 ds %r25,%r23,%r25 60 ds %r25,%r23,%r25
61 addc %r24,%r24,%r24 61 addc %r24,%r24,%r24
62 ds %r25,%r23,%r25 62 ds %r25,%r23,%r25
63 addc %r24,%r24,%r24 63 addc %r24,%r24,%r24
64 ds %r25,%r23,%r25 64 ds %r25,%r23,%r25
65 addc %r24,%r24,%r24 65 addc %r24,%r24,%r24
66 ds %r25,%r23,%r25 66 ds %r25,%r23,%r25
67 addc %r24,%r24,%r24 67 addc %r24,%r24,%r24
68 ds %r25,%r23,%r25 68 ds %r25,%r23,%r25
69 addc %r24,%r24,%r24 69 addc %r24,%r24,%r24
70 ds %r25,%r23,%r25 70 ds %r25,%r23,%r25
71 addc %r24,%r24,%r24 71 addc %r24,%r24,%r24
72 ds %r25,%r23,%r25 72 ds %r25,%r23,%r25
73 addc %r24,%r24,%r24 73 addc %r24,%r24,%r24
74 ds %r25,%r23,%r25 74 ds %r25,%r23,%r25
75 addc %r24,%r24,%r24 75 addc %r24,%r24,%r24
76 ds %r25,%r23,%r25 76 ds %r25,%r23,%r25
77 addc %r24,%r24,%r24 77 addc %r24,%r24,%r24
78 ds %r25,%r23,%r25 78 ds %r25,%r23,%r25
79 addc %r24,%r24,%r24 79 addc %r24,%r24,%r24
80 ds %r25,%r23,%r25 80 ds %r25,%r23,%r25
81 addc %r24,%r24,%r24 81 addc %r24,%r24,%r24
82 ds %r25,%r23,%r25 82 ds %r25,%r23,%r25
83 addc %r24,%r24,%r24 83 addc %r24,%r24,%r24
84 ds %r25,%r23,%r25 84 ds %r25,%r23,%r25
85 addc %r24,%r24,%r24 85 addc %r24,%r24,%r24
86 ds %r25,%r23,%r25 86 ds %r25,%r23,%r25
87 addc %r24,%r24,%r24 87 addc %r24,%r24,%r24
88 ds %r25,%r23,%r25 88 ds %r25,%r23,%r25
89 addc %r24,%r24,%r24 89 addc %r24,%r24,%r24
90 ds %r25,%r23,%r25 90 ds %r25,%r23,%r25
91 addc %r24,%r24,%r24 91 addc %r24,%r24,%r24
92 ds %r25,%r23,%r25 92 ds %r25,%r23,%r25
93 addc %r24,%r24,%r24 93 addc %r24,%r24,%r24
94 ds %r25,%r23,%r25 94 ds %r25,%r23,%r25
95 addc %r24,%r24,%r24 95 addc %r24,%r24,%r24
96 ds %r25,%r23,%r25 96 ds %r25,%r23,%r25
97 addc %r24,%r24,%r24 97 addc %r24,%r24,%r24
98 ds %r25,%r23,%r25 98 ds %r25,%r23,%r25
99 addc %r24,%r24,%r24 99 addc %r24,%r24,%r24
100 ds %r25,%r23,%r25 100 ds %r25,%r23,%r25
101 addc %r24,%r24,%r24 101 addc %r24,%r24,%r24
102 ds %r25,%r23,%r25 102 ds %r25,%r23,%r25
103 addc %r24,%r24,%r24 103 addc %r24,%r24,%r24
104 ds %r25,%r23,%r25 104 ds %r25,%r23,%r25
105 addc %r24,%r24,%r24 105 addc %r24,%r24,%r24
106 ds %r25,%r23,%r25 106 ds %r25,%r23,%r25
107 addc %r24,%r24,%r24 107 addc %r24,%r24,%r24
108 ds %r25,%r23,%r25 108 ds %r25,%r23,%r25
109 addc %r24,%r24,%r24 109 addc %r24,%r24,%r24
110 ds %r25,%r23,%r25 110 ds %r25,%r23,%r25
111 addc %r24,%r24,%r24 111 addc %r24,%r24,%r24
112 ds %r25,%r23,%r25 112 ds %r25,%r23,%r25
113 addc %r24,%r24,%r24 113 addc %r24,%r24,%r24
114 ds %r25,%r23,%r25 114 ds %r25,%r23,%r25
115 addc %r24,%r24,%r28 115 addc %r24,%r24,%r28
116 ds %r25,%r23,%r25 116 ds %r25,%r23,%r25
117 comclr,>= %r25,%r0,%r0 117 comclr,>= %r25,%r0,%r0
118 addl %r25,%r23,%r25 118 addl %r25,%r23,%r25
119 stws %r25,0(0,%r26) 119 stws %r25,0(0,%r26)
120 bv 0(%r2) 120 bv 0(%r2)
121 addc %r28,%r28,%r28 121 addc %r28,%r28,%r28
122 122
123 .label L$largedivisor 123 .label L$largedivisor
124 extru %r24,31,1,%r19 ; r19 = n0 & 1 124 extru %r24,31,1,%r19 ; r19 = n0 & 1
125 bb,< %r23,31,L$odd 125 bb,< %r23,31,L$odd
126 extru %r23,30,31,%r22 ; r22 = d >> 1 126 extru %r23,30,31,%r22 ; r22 = d >> 1
127 shd %r25,%r24,1,%r24 ; r24 = new n0 127 shd %r25,%r24,1,%r24 ; r24 = new n0
128 extru %r25,30,31,%r25 ; r25 = new n1 128 extru %r25,30,31,%r25 ; r25 = new n1
129 sub %r0,%r22,%r21 129 sub %r0,%r22,%r21
130 ds %r0,%r21,%r0 130 ds %r0,%r21,%r0
131 addc %r24,%r24,%r24 131 addc %r24,%r24,%r24
132 ds %r25,%r22,%r25 132 ds %r25,%r22,%r25
133 addc %r24,%r24,%r24 133 addc %r24,%r24,%r24
134 ds %r25,%r22,%r25 134 ds %r25,%r22,%r25
135 addc %r24,%r24,%r24 135 addc %r24,%r24,%r24
136 ds %r25,%r22,%r25 136 ds %r25,%r22,%r25
137 addc %r24,%r24,%r24 137 addc %r24,%r24,%r24
138 ds %r25,%r22,%r25 138 ds %r25,%r22,%r25
139 addc %r24,%r24,%r24 139 addc %r24,%r24,%r24
140 ds %r25,%r22,%r25 140 ds %r25,%r22,%r25
141 addc %r24,%r24,%r24 141 addc %r24,%r24,%r24
142 ds %r25,%r22,%r25 142 ds %r25,%r22,%r25
143 addc %r24,%r24,%r24 143 addc %r24,%r24,%r24
144 ds %r25,%r22,%r25 144 ds %r25,%r22,%r25
145 addc %r24,%r24,%r24 145 addc %r24,%r24,%r24
146 ds %r25,%r22,%r25 146 ds %r25,%r22,%r25
147 addc %r24,%r24,%r24 147 addc %r24,%r24,%r24
148 ds %r25,%r22,%r25 148 ds %r25,%r22,%r25
149 addc %r24,%r24,%r24 149 addc %r24,%r24,%r24
150 ds %r25,%r22,%r25 150 ds %r25,%r22,%r25
151 addc %r24,%r24,%r24 151 addc %r24,%r24,%r24
152 ds %r25,%r22,%r25 152 ds %r25,%r22,%r25
153 addc %r24,%r24,%r24 153 addc %r24,%r24,%r24
154 ds %r25,%r22,%r25 154 ds %r25,%r22,%r25
155 addc %r24,%r24,%r24 155 addc %r24,%r24,%r24
156 ds %r25,%r22,%r25 156 ds %r25,%r22,%r25
157 addc %r24,%r24,%r24 157 addc %r24,%r24,%r24
158 ds %r25,%r22,%r25 158 ds %r25,%r22,%r25
159 addc %r24,%r24,%r24 159 addc %r24,%r24,%r24
160 ds %r25,%r22,%r25 160 ds %r25,%r22,%r25
161 addc %r24,%r24,%r24 161 addc %r24,%r24,%r24
162 ds %r25,%r22,%r25 162 ds %r25,%r22,%r25
163 addc %r24,%r24,%r24 163 addc %r24,%r24,%r24
164 ds %r25,%r22,%r25 164 ds %r25,%r22,%r25
165 addc %r24,%r24,%r24 165 addc %r24,%r24,%r24
166 ds %r25,%r22,%r25 166 ds %r25,%r22,%r25
167 addc %r24,%r24,%r24 167 addc %r24,%r24,%r24
168 ds %r25,%r22,%r25 168 ds %r25,%r22,%r25
169 addc %r24,%r24,%r24 169 addc %r24,%r24,%r24
170 ds %r25,%r22,%r25 170 ds %r25,%r22,%r25
171 addc %r24,%r24,%r24 171 addc %r24,%r24,%r24
172 ds %r25,%r22,%r25 172 ds %r25,%r22,%r25
173 addc %r24,%r24,%r24 173 addc %r24,%r24,%r24
174 ds %r25,%r22,%r25 174 ds %r25,%r22,%r25
175 addc %r24,%r24,%r24 175 addc %r24,%r24,%r24
176 ds %r25,%r22,%r25 176 ds %r25,%r22,%r25
177 addc %r24,%r24,%r24 177 addc %r24,%r24,%r24
178 ds %r25,%r22,%r25 178 ds %r25,%r22,%r25
179 addc %r24,%r24,%r24 179 addc %r24,%r24,%r24
180 ds %r25,%r22,%r25 180 ds %r25,%r22,%r25
181 addc %r24,%r24,%r24 181 addc %r24,%r24,%r24
182 ds %r25,%r22,%r25 182 ds %r25,%r22,%r25
183 addc %r24,%r24,%r24 183 addc %r24,%r24,%r24
184 ds %r25,%r22,%r25 184 ds %r25,%r22,%r25
185 addc %r24,%r24,%r24 185 addc %r24,%r24,%r24
186 ds %r25,%r22,%r25 186 ds %r25,%r22,%r25
187 addc %r24,%r24,%r24 187 addc %r24,%r24,%r24
188 ds %r25,%r22,%r25 188 ds %r25,%r22,%r25
189 addc %r24,%r24,%r24 189 addc %r24,%r24,%r24
190 ds %r25,%r22,%r25 190 ds %r25,%r22,%r25
191 addc %r24,%r24,%r24 191 addc %r24,%r24,%r24
192 ds %r25,%r22,%r25 192 ds %r25,%r22,%r25
193 addc %r24,%r24,%r24 193 addc %r24,%r24,%r24
194 ds %r25,%r22,%r25 194 ds %r25,%r22,%r25
195 comclr,>= %r25,%r0,%r0 195 comclr,>= %r25,%r0,%r0
196 addl %r25,%r22,%r25 196 addl %r25,%r22,%r25
197 sh1addl %r25,%r19,%r25 197 sh1addl %r25,%r19,%r25
198 stws %r25,0(0,%r26) 198 stws %r25,0(0,%r26)
199 bv 0(%r2) 199 bv 0(%r2)
200 addc %r24,%r24,%r28 200 addc %r24,%r24,%r28
201 201
202 .label L$odd 202 .label L$odd
203 addib,sv,n 1,%r22,L$FF.. ; r22 = (d / 2 + 1) 203 addib,sv,n 1,%r22,L$FF.. ; r22 = (d / 2 + 1)
204 shd %r25,%r24,1,%r24 ; r24 = new n0 204 shd %r25,%r24,1,%r24 ; r24 = new n0
205 extru %r25,30,31,%r25 ; r25 = new n1 205 extru %r25,30,31,%r25 ; r25 = new n1
206 sub %r0,%r22,%r21 206 sub %r0,%r22,%r21
207 ds %r0,%r21,%r0 207 ds %r0,%r21,%r0
208 addc %r24,%r24,%r24 208 addc %r24,%r24,%r24
209 ds %r25,%r22,%r25 209 ds %r25,%r22,%r25
210 addc %r24,%r24,%r24 210 addc %r24,%r24,%r24
211 ds %r25,%r22,%r25 211 ds %r25,%r22,%r25
212 addc %r24,%r24,%r24 212 addc %r24,%r24,%r24
213 ds %r25,%r22,%r25 213 ds %r25,%r22,%r25
214 addc %r24,%r24,%r24 214 addc %r24,%r24,%r24
215 ds %r25,%r22,%r25 215 ds %r25,%r22,%r25
216 addc %r24,%r24,%r24 216 addc %r24,%r24,%r24
217 ds %r25,%r22,%r25 217 ds %r25,%r22,%r25
218 addc %r24,%r24,%r24 218 addc %r24,%r24,%r24
219 ds %r25,%r22,%r25 219 ds %r25,%r22,%r25
220 addc %r24,%r24,%r24 220 addc %r24,%r24,%r24
221 ds %r25,%r22,%r25 221 ds %r25,%r22,%r25
222 addc %r24,%r24,%r24 222 addc %r24,%r24,%r24
223 ds %r25,%r22,%r25 223 ds %r25,%r22,%r25
224 addc %r24,%r24,%r24 224 addc %r24,%r24,%r24
225 ds %r25,%r22,%r25 225 ds %r25,%r22,%r25
226 addc %r24,%r24,%r24 226 addc %r24,%r24,%r24
227 ds %r25,%r22,%r25 227 ds %r25,%r22,%r25
228 addc %r24,%r24,%r24 228 addc %r24,%r24,%r24
229 ds %r25,%r22,%r25 229 ds %r25,%r22,%r25
230 addc %r24,%r24,%r24 230 addc %r24,%r24,%r24
231 ds %r25,%r22,%r25 231 ds %r25,%r22,%r25
232 addc %r24,%r24,%r24 232 addc %r24,%r24,%r24
233 ds %r25,%r22,%r25 233 ds %r25,%r22,%r25
234 addc %r24,%r24,%r24 234 addc %r24,%r24,%r24
235 ds %r25,%r22,%r25 235 ds %r25,%r22,%r25
236 addc %r24,%r24,%r24 236 addc %r24,%r24,%r24
237 ds %r25,%r22,%r25 237 ds %r25,%r22,%r25
238 addc %r24,%r24,%r24 238 addc %r24,%r24,%r24
239 ds %r25,%r22,%r25 239 ds %r25,%r22,%r25
240 addc %r24,%r24,%r24 240 addc %r24,%r24,%r24
241 ds %r25,%r22,%r25 241 ds %r25,%r22,%r25
242 addc %r24,%r24,%r24 242 addc %r24,%r24,%r24
243 ds %r25,%r22,%r25 243 ds %r25,%r22,%r25
244 addc %r24,%r24,%r24 244 addc %r24,%r24,%r24
245 ds %r25,%r22,%r25 245 ds %r25,%r22,%r25
246 addc %r24,%r24,%r24 246 addc %r24,%r24,%r24
247 ds %r25,%r22,%r25 247 ds %r25,%r22,%r25
248 addc %r24,%r24,%r24 248 addc %r24,%r24,%r24
249 ds %r25,%r22,%r25 249 ds %r25,%r22,%r25
250 addc %r24,%r24,%r24 250 addc %r24,%r24,%r24
251 ds %r25,%r22,%r25 251 ds %r25,%r22,%r25
252 addc %r24,%r24,%r24 252 addc %r24,%r24,%r24
253 ds %r25,%r22,%r25 253 ds %r25,%r22,%r25
254 addc %r24,%r24,%r24 254 addc %r24,%r24,%r24
255 ds %r25,%r22,%r25 255 ds %r25,%r22,%r25
256 addc %r24,%r24,%r24 256 addc %r24,%r24,%r24
257 ds %r25,%r22,%r25 257 ds %r25,%r22,%r25
258 addc %r24,%r24,%r24 258 addc %r24,%r24,%r24
259 ds %r25,%r22,%r25 259 ds %r25,%r22,%r25
260 addc %r24,%r24,%r24 260 addc %r24,%r24,%r24
261 ds %r25,%r22,%r25 261 ds %r25,%r22,%r25
262 addc %r24,%r24,%r24 262 addc %r24,%r24,%r24
263 ds %r25,%r22,%r25 263 ds %r25,%r22,%r25
264 addc %r24,%r24,%r24 264 addc %r24,%r24,%r24
265 ds %r25,%r22,%r25 265 ds %r25,%r22,%r25
266 addc %r24,%r24,%r24 266 addc %r24,%r24,%r24
267 ds %r25,%r22,%r25 267 ds %r25,%r22,%r25
268 addc %r24,%r24,%r24 268 addc %r24,%r24,%r24
269 ds %r25,%r22,%r25 269 ds %r25,%r22,%r25
270 addc %r24,%r24,%r24 270 addc %r24,%r24,%r24
271 ds %r25,%r22,%r25 271 ds %r25,%r22,%r25
272 addc %r24,%r24,%r28 272 addc %r24,%r24,%r28
273 comclr,>= %r25,%r0,%r0 273 comclr,>= %r25,%r0,%r0
274 addl %r25,%r22,%r25 274 addl %r25,%r22,%r25
275 sh1addl %r25,%r19,%r25 275 sh1addl %r25,%r19,%r25
276; We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25 276; We have computed (n1,,n0) / (d + 1), q' = r28, r' = r25
277 add,nuv %r28,%r25,%r25 277 add,nuv %r28,%r25,%r25
278 addl %r25,%r1,%r25 278 addl %r25,%r1,%r25
279 addc %r0,%r28,%r28 279 addc %r0,%r28,%r28
280 sub,<< %r25,%r23,%r0 280 sub,<< %r25,%r23,%r0
281 addl %r25,%r1,%r25 281 addl %r25,%r1,%r25
282 stws %r25,0(0,%r26) 282 stws %r25,0(0,%r26)
283 bv 0(%r2) 283 bv 0(%r2)
284 addc %r0,%r28,%r28 284 addc %r0,%r28,%r28
285 285
286; This is just a special case of the code above. 286; This is just a special case of the code above.
287; We come here when d == 0xFFFFFFFF 287; We come here when d == 0xFFFFFFFF
288 .label L$FF.. 288 .label L$FF..
289 add,uv %r25,%r24,%r24 289 add,uv %r25,%r24,%r24
290 sub,<< %r24,%r23,%r0 290 sub,<< %r24,%r23,%r0
291 ldo 1(%r24),%r24 291 ldo 1(%r24),%r24
292 stws %r24,0(0,%r26) 292 stws %r24,0(0,%r26)
293 bv 0(%r2) 293 bv 0(%r2)
294 addc %r0,%r25,%r28 294 addc %r0,%r25,%r28
295 295
296 .exit 296 .exit
297 .procend 297 .procend
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/distfiles
index 565f24e..d68227a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/distfiles
@@ -1,5 +1,5 @@
1udiv-qrnnd.S 1udiv-qrnnd.S
2mpih-mul1.S 2mpih-mul1.S
3mpih-mul2.S 3mpih-mul2.S
4mpih-mul3.S 4mpih-mul3.S
5 5
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul1.S
index f847ece..93166e3 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul1.S
@@ -1,113 +1,113 @@
1/* hppa1.1 mul_1 -- Multiply a limb vector with a limb and store 1/* hppa1.1 mul_1 -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1993, 1994, 1998, 4 * Copyright (C) 1992, 1993, 1994, 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/******************* 31/*******************
32 * mpi_limb_t 32 * mpi_limb_t
33 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r26) 33 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r26)
34 * mpi_ptr_t s1_ptr, (r25) 34 * mpi_ptr_t s1_ptr, (r25)
35 * mpi_size_t s1_size, (r24) 35 * mpi_size_t s1_size, (r24)
36 * mpi_limb_t s2_limb) (r23) 36 * mpi_limb_t s2_limb) (r23)
37 * 37 *
38 * 38 *
39 * 39 *
40 * This runs at 9 cycles/limb on a PA7000. With the used instructions, it can 40 * This runs at 9 cycles/limb on a PA7000. With the used instructions, it can
41 * not become faster due to data cache contention after a store. On the 41 * not become faster due to data cache contention after a store. On the
42 * PA7100 it runs at 7 cycles/limb, and that can not be improved either, since 42 * PA7100 it runs at 7 cycles/limb, and that can not be improved either, since
43 * only the xmpyu does not need the integer pipeline, so the only dual-issue 43 * only the xmpyu does not need the integer pipeline, so the only dual-issue
44 * we will get are addc+xmpyu. Unrolling would not help either CPU. 44 * we will get are addc+xmpyu. Unrolling would not help either CPU.
45 * 45 *
46 * We could use fldds to read two limbs at a time from the S1 array, and that 46 * We could use fldds to read two limbs at a time from the S1 array, and that
47 * could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and 47 * could bring down the times to 8.5 and 6.5 cycles/limb for the PA7000 and
48 * PA7100, respectively. We don't do that since it does not seem worth the 48 * PA7100, respectively. We don't do that since it does not seem worth the
49 * (alignment) troubles... 49 * (alignment) troubles...
50 * 50 *
51 * At least the PA7100 is rumored to be able to deal with cache-misses 51 * At least the PA7100 is rumored to be able to deal with cache-misses
52 * without stalling instruction issue. If this is true, and the cache is 52 * without stalling instruction issue. If this is true, and the cache is
53 * actually also lockup-free, we should use a deeper software pipeline, and 53 * actually also lockup-free, we should use a deeper software pipeline, and
54 * load from S1 very early! (The loads and stores to -12(sp) will surely be 54 * load from S1 very early! (The loads and stores to -12(sp) will surely be
55 * in the cache.) 55 * in the cache.)
56 */ 56 */
57 57
58 .code 58 .code
59 .export _gcry_mpih_mul_1 59 .export _gcry_mpih_mul_1
60 .label _gcry_mpih_mul_1 60 .label _gcry_mpih_mul_1
61 .proc 61 .proc
62 .callinfo frame=64,no_calls 62 .callinfo frame=64,no_calls
63 .entry 63 .entry
64 64
65 ldo 64(%r30),%r30 65 ldo 64(%r30),%r30
66 fldws,ma 4(%r25),%fr5 66 fldws,ma 4(%r25),%fr5
67 stw %r23,-16(%r30) ; move s2_limb ... 67 stw %r23,-16(%r30) ; move s2_limb ...
68 addib,= -1,%r24,L$just_one_limb 68 addib,= -1,%r24,L$just_one_limb
69 fldws -16(%r30),%fr4 ; ... into fr4 69 fldws -16(%r30),%fr4 ; ... into fr4
70 add %r0,%r0,%r0 ; clear carry 70 add %r0,%r0,%r0 ; clear carry
71 xmpyu %fr4,%fr5,%fr6 71 xmpyu %fr4,%fr5,%fr6
72 fldws,ma 4(%r25),%fr7 72 fldws,ma 4(%r25),%fr7
73 fstds %fr6,-16(%r30) 73 fstds %fr6,-16(%r30)
74 xmpyu %fr4,%fr7,%fr8 74 xmpyu %fr4,%fr7,%fr8
75 ldw -12(%r30),%r19 ; least significant limb in product 75 ldw -12(%r30),%r19 ; least significant limb in product
76 ldw -16(%r30),%r28 76 ldw -16(%r30),%r28
77 77
78 fstds %fr8,-16(%r30) 78 fstds %fr8,-16(%r30)
79 addib,= -1,%r24,L$end 79 addib,= -1,%r24,L$end
80 ldw -12(%r30),%r1 80 ldw -12(%r30),%r1
81 81
82; Main loop 82; Main loop
83 .label L$loop 83 .label L$loop
84 fldws,ma 4(%r25),%fr5 84 fldws,ma 4(%r25),%fr5
85 stws,ma %r19,4(%r26) 85 stws,ma %r19,4(%r26)
86 addc %r28,%r1,%r19 86 addc %r28,%r1,%r19
87 xmpyu %fr4,%fr5,%fr6 87 xmpyu %fr4,%fr5,%fr6
88 ldw -16(%r30),%r28 88 ldw -16(%r30),%r28
89 fstds %fr6,-16(%r30) 89 fstds %fr6,-16(%r30)
90 addib,<> -1,%r24,L$loop 90 addib,<> -1,%r24,L$loop
91 ldw -12(%r30),%r1 91 ldw -12(%r30),%r1
92 92
93 .label L$end 93 .label L$end
94 stws,ma %r19,4(%r26) 94 stws,ma %r19,4(%r26)
95 addc %r28,%r1,%r19 95 addc %r28,%r1,%r19
96 ldw -16(%r30),%r28 96 ldw -16(%r30),%r28
97 stws,ma %r19,4(%r26) 97 stws,ma %r19,4(%r26)
98 addc %r0,%r28,%r28 98 addc %r0,%r28,%r28
99 bv 0(%r2) 99 bv 0(%r2)
100 ldo -64(%r30),%r30 100 ldo -64(%r30),%r30
101 101
102 .label L$just_one_limb 102 .label L$just_one_limb
103 xmpyu %fr4,%fr5,%fr6 103 xmpyu %fr4,%fr5,%fr6
104 fstds %fr6,-16(%r30) 104 fstds %fr6,-16(%r30)
105 ldw -16(%r30),%r28 105 ldw -16(%r30),%r28
106 ldo -64(%r30),%r30 106 ldo -64(%r30),%r30
107 bv 0(%r2) 107 bv 0(%r2)
108 fstws %fr6R,0(%r26) 108 fstws %fr6R,0(%r26)
109 109
110 .exit 110 .exit
111 .procend 111 .procend
112 112
113 113
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul2.S
index 0fdbbf2..84b9d4a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul2.S
@@ -1,115 +1,115 @@
1/* hppa1.1 addmul_1 -- Multiply a limb vector with a limb and add 1/* hppa1.1 addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1993, 1994, 1998, 4 * Copyright (C) 1992, 1993, 1994, 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/******************* 31/*******************
32 * mpi_limb_t 32 * mpi_limb_t
33 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r26) 33 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r26)
34 * mpi_ptr_t s1_ptr, (r25) 34 * mpi_ptr_t s1_ptr, (r25)
35 * mpi_size_t s1_size, (r24) 35 * mpi_size_t s1_size, (r24)
36 * mpi_limb_t s2_limb) (r23) 36 * mpi_limb_t s2_limb) (r23)
37 * 37 *
38 * This runs at 11 cycles/limb on a PA7000. With the used instructions, it 38 * This runs at 11 cycles/limb on a PA7000. With the used instructions, it
39 * can not become faster due to data cache contention after a store. On the 39 * can not become faster due to data cache contention after a store. On the
40 * PA7100 it runs at 10 cycles/limb, and that can not be improved either, 40 * PA7100 it runs at 10 cycles/limb, and that can not be improved either,
41 * since only the xmpyu does not need the integer pipeline, so the only 41 * since only the xmpyu does not need the integer pipeline, so the only
42 * dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb 42 * dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb
43 * on the PA7100. 43 * on the PA7100.
44 * 44 *
45 * There are some ideas described in mul1.S that applies to this code too. 45 * There are some ideas described in mul1.S that applies to this code too.
46 */ 46 */
47 47
48 .code 48 .code
49 .export _gcry_mpih_addmul_1 49 .export _gcry_mpih_addmul_1
50 .label _gcry_mpih_addmul_1 50 .label _gcry_mpih_addmul_1
51 .proc 51 .proc
52 .callinfo frame=64,no_calls 52 .callinfo frame=64,no_calls
53 .entry 53 .entry
54 54
55 ldo 64(%r30),%r30 55 ldo 64(%r30),%r30
56 fldws,ma 4(%r25),%fr5 56 fldws,ma 4(%r25),%fr5
57 stw %r23,-16(%r30) ; move s2_limb ... 57 stw %r23,-16(%r30) ; move s2_limb ...
58 addib,= -1,%r24,L$just_one_limb 58 addib,= -1,%r24,L$just_one_limb
59 fldws -16(%r30),%fr4 ; ... into fr4 59 fldws -16(%r30),%fr4 ; ... into fr4
60 add %r0,%r0,%r0 ; clear carry 60 add %r0,%r0,%r0 ; clear carry
61 xmpyu %fr4,%fr5,%fr6 61 xmpyu %fr4,%fr5,%fr6
62 fldws,ma 4(%r25),%fr7 62 fldws,ma 4(%r25),%fr7
63 fstds %fr6,-16(%r30) 63 fstds %fr6,-16(%r30)
64 xmpyu %fr4,%fr7,%fr8 64 xmpyu %fr4,%fr7,%fr8
65 ldw -12(%r30),%r19 ; least significant limb in product 65 ldw -12(%r30),%r19 ; least significant limb in product
66 ldw -16(%r30),%r28 66 ldw -16(%r30),%r28
67 67
68 fstds %fr8,-16(%r30) 68 fstds %fr8,-16(%r30)
69 addib,= -1,%r24,L$end 69 addib,= -1,%r24,L$end
70 ldw -12(%r30),%r1 70 ldw -12(%r30),%r1
71 71
72; Main loop 72; Main loop
73 .label L$loop 73 .label L$loop
74 ldws 0(%r26),%r29 74 ldws 0(%r26),%r29
75 fldws,ma 4(%r25),%fr5 75 fldws,ma 4(%r25),%fr5
76 add %r29,%r19,%r19 76 add %r29,%r19,%r19
77 stws,ma %r19,4(%r26) 77 stws,ma %r19,4(%r26)
78 addc %r28,%r1,%r19 78 addc %r28,%r1,%r19
79 xmpyu %fr4,%fr5,%fr6 79 xmpyu %fr4,%fr5,%fr6
80 ldw -16(%r30),%r28 80 ldw -16(%r30),%r28
81 fstds %fr6,-16(%r30) 81 fstds %fr6,-16(%r30)
82 addc %r0,%r28,%r28 82 addc %r0,%r28,%r28
83 addib,<> -1,%r24,L$loop 83 addib,<> -1,%r24,L$loop
84 ldw -12(%r30),%r1 84 ldw -12(%r30),%r1
85 85
86 .label L$end 86 .label L$end
87 ldw 0(%r26),%r29 87 ldw 0(%r26),%r29
88 add %r29,%r19,%r19 88 add %r29,%r19,%r19
89 stws,ma %r19,4(%r26) 89 stws,ma %r19,4(%r26)
90 addc %r28,%r1,%r19 90 addc %r28,%r1,%r19
91 ldw -16(%r30),%r28 91 ldw -16(%r30),%r28
92 ldws 0(%r26),%r29 92 ldws 0(%r26),%r29
93 addc %r0,%r28,%r28 93 addc %r0,%r28,%r28
94 add %r29,%r19,%r19 94 add %r29,%r19,%r19
95 stws,ma %r19,4(%r26) 95 stws,ma %r19,4(%r26)
96 addc %r0,%r28,%r28 96 addc %r0,%r28,%r28
97 bv 0(%r2) 97 bv 0(%r2)
98 ldo -64(%r30),%r30 98 ldo -64(%r30),%r30
99 99
100 .label L$just_one_limb 100 .label L$just_one_limb
101 xmpyu %fr4,%fr5,%fr6 101 xmpyu %fr4,%fr5,%fr6
102 ldw 0(%r26),%r29 102 ldw 0(%r26),%r29
103 fstds %fr6,-16(%r30) 103 fstds %fr6,-16(%r30)
104 ldw -12(%r30),%r1 104 ldw -12(%r30),%r1
105 ldw -16(%r30),%r28 105 ldw -16(%r30),%r28
106 add %r29,%r1,%r19 106 add %r29,%r1,%r19
107 stw %r19,0(%r26) 107 stw %r19,0(%r26)
108 addc %r0,%r28,%r28 108 addc %r0,%r28,%r28
109 bv 0(%r2) 109 bv 0(%r2)
110 ldo -64(%r30),%r30 110 ldo -64(%r30),%r30
111 111
112 .exit 112 .exit
113 .procend 113 .procend
114 114
115 115
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul3.S
index 7daf7f4..c4246e4 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/mpih-mul3.S
@@ -1,125 +1,125 @@
1/* hppa1.1 submul_1 -- Multiply a limb vector with a limb and add 1/* hppa1.1 submul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1993, 1994, 1998, 4 * Copyright (C) 1992, 1993, 1994, 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/******************* 31/*******************
32 * mpi_limb_t 32 * mpi_limb_t
33 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r26) 33 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r26)
34 * mpi_ptr_t s1_ptr, (r25) 34 * mpi_ptr_t s1_ptr, (r25)
35 * mpi_size_t s1_size, (r24) 35 * mpi_size_t s1_size, (r24)
36 * mpi_limb_t s2_limb) (r23) 36 * mpi_limb_t s2_limb) (r23)
37 * 37 *
38 * 38 *
39 * This runs at 12 cycles/limb on a PA7000. With the used instructions, it 39 * This runs at 12 cycles/limb on a PA7000. With the used instructions, it
40 * can not become faster due to data cache contention after a store. On the 40 * can not become faster due to data cache contention after a store. On the
41 * PA7100 it runs at 11 cycles/limb, and that can not be improved either, 41 * PA7100 it runs at 11 cycles/limb, and that can not be improved either,
42 * since only the xmpyu does not need the integer pipeline, so the only 42 * since only the xmpyu does not need the integer pipeline, so the only
43 * dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb 43 * dual-issue we will get are addc+xmpyu. Unrolling could gain a cycle/limb
44 * on the PA7100. 44 * on the PA7100.
45 * 45 *
46 * There are some ideas described in mul1.S that applies to this code too. 46 * There are some ideas described in mul1.S that applies to this code too.
47 * 47 *
48 * It seems possible to make this run as fast as addmul_1, if we use 48 * It seems possible to make this run as fast as addmul_1, if we use
49 * sub,>>= %r29,%r19,%r22 49 * sub,>>= %r29,%r19,%r22
50 * addi 1,%r28,%r28 50 * addi 1,%r28,%r28
51 * but that requires reworking the hairy software pipeline... 51 * but that requires reworking the hairy software pipeline...
52 */ 52 */
53 53
54 54
55 .code 55 .code
56 .export _gcry_mpih_submul_1 56 .export _gcry_mpih_submul_1
57 .label _gcry_mpih_submul_1 57 .label _gcry_mpih_submul_1
58 .proc 58 .proc
59 .callinfo frame=64,no_calls 59 .callinfo frame=64,no_calls
60 .entry 60 .entry
61 61
62 ldo 64(%r30),%r30 62 ldo 64(%r30),%r30
63 fldws,ma 4(%r25),%fr5 63 fldws,ma 4(%r25),%fr5
64 stw %r23,-16(%r30) ; move s2_limb ... 64 stw %r23,-16(%r30) ; move s2_limb ...
65 addib,= -1,%r24,L$just_one_limb 65 addib,= -1,%r24,L$just_one_limb
66 fldws -16(%r30),%fr4 ; ... into fr4 66 fldws -16(%r30),%fr4 ; ... into fr4
67 add %r0,%r0,%r0 ; clear carry 67 add %r0,%r0,%r0 ; clear carry
68 xmpyu %fr4,%fr5,%fr6 68 xmpyu %fr4,%fr5,%fr6
69 fldws,ma 4(%r25),%fr7 69 fldws,ma 4(%r25),%fr7
70 fstds %fr6,-16(%r30) 70 fstds %fr6,-16(%r30)
71 xmpyu %fr4,%fr7,%fr8 71 xmpyu %fr4,%fr7,%fr8
72 ldw -12(%r30),%r19 ; least significant limb in product 72 ldw -12(%r30),%r19 ; least significant limb in product
73 ldw -16(%r30),%r28 73 ldw -16(%r30),%r28
74 74
75 fstds %fr8,-16(%r30) 75 fstds %fr8,-16(%r30)
76 addib,= -1,%r24,L$end 76 addib,= -1,%r24,L$end
77 ldw -12(%r30),%r1 77 ldw -12(%r30),%r1
78 78
79; Main loop 79; Main loop
80 .label L$loop 80 .label L$loop
81 ldws 0(%r26),%r29 81 ldws 0(%r26),%r29
82 fldws,ma 4(%r25),%fr5 82 fldws,ma 4(%r25),%fr5
83 sub %r29,%r19,%r22 83 sub %r29,%r19,%r22
84 add %r22,%r19,%r0 84 add %r22,%r19,%r0
85 stws,ma %r22,4(%r26) 85 stws,ma %r22,4(%r26)
86 addc %r28,%r1,%r19 86 addc %r28,%r1,%r19
87 xmpyu %fr4,%fr5,%fr6 87 xmpyu %fr4,%fr5,%fr6
88 ldw -16(%r30),%r28 88 ldw -16(%r30),%r28
89 fstds %fr6,-16(%r30) 89 fstds %fr6,-16(%r30)
90 addc %r0,%r28,%r28 90 addc %r0,%r28,%r28
91 addib,<> -1,%r24,L$loop 91 addib,<> -1,%r24,L$loop
92 ldw -12(%r30),%r1 92 ldw -12(%r30),%r1
93 93
94 .label L$end 94 .label L$end
95 ldw 0(%r26),%r29 95 ldw 0(%r26),%r29
96 sub %r29,%r19,%r22 96 sub %r29,%r19,%r22
97 add %r22,%r19,%r0 97 add %r22,%r19,%r0
98 stws,ma %r22,4(%r26) 98 stws,ma %r22,4(%r26)
99 addc %r28,%r1,%r19 99 addc %r28,%r1,%r19
100 ldw -16(%r30),%r28 100 ldw -16(%r30),%r28
101 ldws 0(%r26),%r29 101 ldws 0(%r26),%r29
102 addc %r0,%r28,%r28 102 addc %r0,%r28,%r28
103 sub %r29,%r19,%r22 103 sub %r29,%r19,%r22
104 add %r22,%r19,%r0 104 add %r22,%r19,%r0
105 stws,ma %r22,4(%r26) 105 stws,ma %r22,4(%r26)
106 addc %r0,%r28,%r28 106 addc %r0,%r28,%r28
107 bv 0(%r2) 107 bv 0(%r2)
108 ldo -64(%r30),%r30 108 ldo -64(%r30),%r30
109 109
110 .label L$just_one_limb 110 .label L$just_one_limb
111 xmpyu %fr4,%fr5,%fr6 111 xmpyu %fr4,%fr5,%fr6
112 ldw 0(%r26),%r29 112 ldw 0(%r26),%r29
113 fstds %fr6,-16(%r30) 113 fstds %fr6,-16(%r30)
114 ldw -12(%r30),%r1 114 ldw -12(%r30),%r1
115 ldw -16(%r30),%r28 115 ldw -16(%r30),%r28
116 sub %r29,%r1,%r22 116 sub %r29,%r1,%r22
117 add %r22,%r1,%r0 117 add %r22,%r1,%r0
118 stw %r22,0(%r26) 118 stw %r22,0(%r26)
119 addc %r0,%r28,%r28 119 addc %r0,%r28,%r28
120 bv 0(%r2) 120 bv 0(%r2)
121 ldo -64(%r30),%r30 121 ldo -64(%r30),%r30
122 122
123 .exit 123 .exit
124 .procend 124 .procend
125 125
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/udiv-qrnnd.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/udiv-qrnnd.S
index cdf987e..020c31e 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/udiv-qrnnd.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/hppa1.1/udiv-qrnnd.S
@@ -1,90 +1,90 @@
1/* HP-PA __udiv_qrnnd division support, used from longlong.h. 1/* HP-PA __udiv_qrnnd division support, used from longlong.h.
2 * This version runs fast on PA 7000 and later. 2 * This version runs fast on PA 7000 and later.
3 * 3 *
4 * Copyright (C) 1993, 1994, 1998, 4 * Copyright (C) 1993, 1994, 1998,
5 * 2001, 2002, 2004 Free Software Foundation, Inc. 5 * 2001, 2002, 2004 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 31
32/* INPUT PARAMETERS 32/* INPUT PARAMETERS
33 * rem_ptr gr26 33 * rem_ptr gr26
34 * n1 gr25 34 * n1 gr25
35 * n0 gr24 35 * n0 gr24
36 * d gr23 36 * d gr23
37 */ 37 */
38 38
39 .data 39 .data
40 .align 8 40 .align 8
41 .label L$0000 41 .label L$0000
42 .word 0x43f00000 42 .word 0x43f00000
43 .word 0x0 43 .word 0x0
44 .code 44 .code
45 .export __udiv_qrnnd 45 .export __udiv_qrnnd
46 .label __udiv_qrnnd 46 .label __udiv_qrnnd
47 .proc 47 .proc
48 .callinfo frame=64,no_calls 48 .callinfo frame=64,no_calls
49 .entry 49 .entry
50 ldo 64(%r30),%r30 50 ldo 64(%r30),%r30
51 51
52 stws %r25,-16(0,%r30) ; n_hi 52 stws %r25,-16(0,%r30) ; n_hi
53 stws %r24,-12(0,%r30) ; n_lo 53 stws %r24,-12(0,%r30) ; n_lo
54 stw %r19,-32(%r30) 54 stw %r19,-32(%r30)
55 addil LT%L$0000,%r19 55 addil LT%L$0000,%r19
56 ldw RT%L$0000(%r1),%r1 56 ldw RT%L$0000(%r1),%r1
57 fldds -16(0,%r30),%fr5 57 fldds -16(0,%r30),%fr5
58 stws %r23,-12(0,%r30) 58 stws %r23,-12(0,%r30)
59 comib,<= 0,%r25,L$1 59 comib,<= 0,%r25,L$1
60 fcnvxf,dbl,dbl %fr5,%fr5 60 fcnvxf,dbl,dbl %fr5,%fr5
61 fldds 0(0,%r1),%fr4 61 fldds 0(0,%r1),%fr4
62 fadd,dbl %fr4,%fr5,%fr5 62 fadd,dbl %fr4,%fr5,%fr5
63 .label L$1 63 .label L$1
64 fcpy,sgl %fr0,%fr6L 64 fcpy,sgl %fr0,%fr6L
65 fldws -12(0,%r30),%fr6R 65 fldws -12(0,%r30),%fr6R
66 fcnvxf,dbl,dbl %fr6,%fr4 66 fcnvxf,dbl,dbl %fr6,%fr4
67 67
68 fdiv,dbl %fr5,%fr4,%fr5 68 fdiv,dbl %fr5,%fr4,%fr5
69 69
70 fcnvfx,dbl,dbl %fr5,%fr4 70 fcnvfx,dbl,dbl %fr5,%fr4
71 fstws %fr4R,-16(%r30) 71 fstws %fr4R,-16(%r30)
72 xmpyu %fr4R,%fr6R,%fr6 72 xmpyu %fr4R,%fr6R,%fr6
73 ldws -16(%r30),%r28 73 ldws -16(%r30),%r28
74 fstds %fr6,-16(0,%r30) 74 fstds %fr6,-16(0,%r30)
75 ldws -12(0,%r30),%r21 75 ldws -12(0,%r30),%r21
76 ldws -16(0,%r30),%r20 76 ldws -16(0,%r30),%r20
77 sub %r24,%r21,%r22 77 sub %r24,%r21,%r22
78 subb %r25,%r20,%r1 78 subb %r25,%r20,%r1
79 comib,= 0,%r1,L$2 79 comib,= 0,%r1,L$2
80 ldo -64(%r30),%r30 80 ldo -64(%r30),%r30
81 81
82 add %r22,%r23,%r22 82 add %r22,%r23,%r22
83 ldo -1(%r28),%r28 83 ldo -1(%r28),%r28
84 .label L$2 84 .label L$2
85 bv 0(%r2) 85 bv 0(%r2)
86 stws %r22,0(0,%r26) 86 stws %r22,0(0,%r26)
87 87
88 .exit 88 .exit
89 .procend 89 .procend
90 90
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/Manifest
index 5d03bd3..812bc8a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/Manifest
@@ -1,28 +1,28 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser general Public License as 7# it under the terms of the GNU Lesser general Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-add1.S 20mpih-add1.S
21mpih-mul1.S 21mpih-mul1.S
22mpih-mul2.S 22mpih-mul2.S
23mpih-mul3.S 23mpih-mul3.S
24mpih-lshift.S 24mpih-lshift.S
25mpih-rshift.S 25mpih-rshift.S
26mpih-sub1.S 26mpih-sub1.S
27syntax.h 27syntax.h
28$names$ iQCVAwUAP+LmOTEAnp832S/7AQJZmgQA1+GIl7rXiEY00y5xD2kG5Lm2QD6c9aBME8hTl812OEcj0ul/QSpdv8E2NEKooifr4SiLVhEVfLNaLqAgN3cIsttn3rRX3/pMC5JwSKHDJPsUbpN9tzb5dr2YC9GG9m8xngAQrN11IQPnGfvFLJK+oDnEMIAeHDpOnX9NeQPDAQA==bnOy 28$names$ iQCVAwUAP+LmOTEAnp832S/7AQJZmgQA1+GIl7rXiEY00y5xD2kG5Lm2QD6c9aBME8hTl812OEcj0ul/QSpdv8E2NEKooifr4SiLVhEVfLNaLqAgN3cIsttn3rRX3/pMC5JwSKHDJPsUbpN9tzb5dr2YC9GG9m8xngAQrN11IQPnGfvFLJK+oDnEMIAeHDpOnX9NeQPDAQA==bnOy
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/distfiles
index 480544d..22b9979 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/distfiles
@@ -1,10 +1,10 @@
1Manifest 1Manifest
2mpih-add1.S 2mpih-add1.S
3mpih-mul1.S 3mpih-mul1.S
4mpih-mul2.S 4mpih-mul2.S
5mpih-mul3.S 5mpih-mul3.S
6mpih-lshift.S 6mpih-lshift.S
7mpih-rshift.S 7mpih-rshift.S
8mpih-sub1.S 8mpih-sub1.S
9syntax.h 9syntax.h
10 10
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
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-lshift.S
index 1dc4c63..bf8ed9d 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-lshift.S
@@ -1,94 +1,94 @@
1/* i80386 lshift 1/* i80386 lshift
2 * Copyright (C) 1992, 1994, 1998, 2 * Copyright (C) 1992, 1994, 1998,
3 * 2001, 2002 Free Software Foundation, Inc. 3 * 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28 28
29#include "sysdep.h" 29#include "sysdep.h"
30#include "asm-syntax.h" 30#include "asm-syntax.h"
31 31
32 32
33/******************* 33/*******************
34 * mpi_limb_t 34 * mpi_limb_t
35 * _gcry_mpih_lshift( mpi_ptr_t wp, (sp + 4) 35 * _gcry_mpih_lshift( mpi_ptr_t wp, (sp + 4)
36 * mpi_ptr_t up, (sp + 8) 36 * mpi_ptr_t up, (sp + 8)
37 * mpi_size_t usize, (sp + 12) 37 * mpi_size_t usize, (sp + 12)
38 * unsigned cnt) (sp + 16) 38 * unsigned cnt) (sp + 16)
39 */ 39 */
40 40
41.text 41.text
42 ALIGN (3) 42 ALIGN (3)
43 .globl C_SYMBOL_NAME(_gcry_mpih_lshift) 43 .globl C_SYMBOL_NAME(_gcry_mpih_lshift)
44C_SYMBOL_NAME(_gcry_mpih_lshift:) 44C_SYMBOL_NAME(_gcry_mpih_lshift:)
45 pushl %edi 45 pushl %edi
46 pushl %esi 46 pushl %esi
47 pushl %ebx 47 pushl %ebx
48 48
49 movl 16(%esp),%edi /* res_ptr */ 49 movl 16(%esp),%edi /* res_ptr */
50 movl 20(%esp),%esi /* s_ptr */ 50 movl 20(%esp),%esi /* s_ptr */
51 movl 24(%esp),%edx /* size */ 51 movl 24(%esp),%edx /* size */
52 movl 28(%esp),%ecx /* cnt */ 52 movl 28(%esp),%ecx /* cnt */
53 53
54 subl $4,%esi /* adjust s_ptr */ 54 subl $4,%esi /* adjust s_ptr */
55 55
56 movl (%esi,%edx,4),%ebx /* read most significant limb */ 56 movl (%esi,%edx,4),%ebx /* read most significant limb */
57 xorl %eax,%eax 57 xorl %eax,%eax
58 shldl %cl,%ebx,%eax /* compute carry limb */ 58 shldl %cl,%ebx,%eax /* compute carry limb */
59 decl %edx 59 decl %edx
60 jz Lend 60 jz Lend
61 pushl %eax /* push carry limb onto stack */ 61 pushl %eax /* push carry limb onto stack */
62 testb $1,%dl 62 testb $1,%dl
63 jnz L1 /* enter loop in the middle */ 63 jnz L1 /* enter loop in the middle */
64 movl %ebx,%eax 64 movl %ebx,%eax
65 65
66 ALIGN (3) 66 ALIGN (3)
67Loop: movl (%esi,%edx,4),%ebx /* load next lower limb */ 67Loop: movl (%esi,%edx,4),%ebx /* load next lower limb */
68 shldl %cl,%ebx,%eax /* compute result limb */ 68 shldl %cl,%ebx,%eax /* compute result limb */
69 movl %eax,(%edi,%edx,4) /* store it */ 69 movl %eax,(%edi,%edx,4) /* store it */
70 decl %edx 70 decl %edx
71L1: movl (%esi,%edx,4),%eax 71L1: movl (%esi,%edx,4),%eax
72 shldl %cl,%eax,%ebx 72 shldl %cl,%eax,%ebx
73 movl %ebx,(%edi,%edx,4) 73 movl %ebx,(%edi,%edx,4)
74 decl %edx 74 decl %edx
75 jnz Loop 75 jnz Loop
76 76
77 shll %cl,%eax /* compute least significant limb */ 77 shll %cl,%eax /* compute least significant limb */
78 movl %eax,(%edi) /* store it */ 78 movl %eax,(%edi) /* store it */
79 79
80 popl %eax /* pop carry limb */ 80 popl %eax /* pop carry limb */
81 81
82 popl %ebx 82 popl %ebx
83 popl %esi 83 popl %esi
84 popl %edi 84 popl %edi
85 ret 85 ret
86 86
87Lend: shll %cl,%ebx /* compute least significant limb */ 87Lend: shll %cl,%ebx /* compute least significant limb */
88 movl %ebx,(%edi) /* store it */ 88 movl %ebx,(%edi) /* store it */
89 89
90 popl %ebx 90 popl %ebx
91 popl %esi 91 popl %esi
92 popl %edi 92 popl %edi
93 ret 93 ret
94 94
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul1.S
index ee93d58..c9760ef 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul1.S
@@ -1,84 +1,84 @@
1/* i80386 mul_1 -- Multiply a limb vector with a limb and store 1/* i80386 mul_1 -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second limb vector.
3 * Copyright (C) 1992, 1994, 1998, 3 * Copyright (C) 1992, 1994, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 * 21 *
22 * Note: This code is heavily based on the GNU MP Library. 22 * Note: This code is heavily based on the GNU MP Library.
23 * Actually it's the same code with only minor changes in the 23 * Actually it's the same code with only minor changes in the
24 * way the data is stored; this is to support the abstraction 24 * way the data is stored; this is to support the abstraction
25 * of an optional secure memory allocation which may be used 25 * of an optional secure memory allocation which may be used
26 * to avoid revealing of sensitive data due to paging etc. 26 * to avoid revealing of sensitive data due to paging etc.
27 */ 27 */
28 28
29 29
30#include "sysdep.h" 30#include "sysdep.h"
31#include "asm-syntax.h" 31#include "asm-syntax.h"
32 32
33 33
34/******************* 34/*******************
35 * mpi_limb_t 35 * mpi_limb_t
36 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (sp + 4) 36 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (sp + 4)
37 * mpi_ptr_t s1_ptr, (sp + 8) 37 * mpi_ptr_t s1_ptr, (sp + 8)
38 * mpi_size_t s1_size, (sp + 12) 38 * mpi_size_t s1_size, (sp + 12)
39 * mpi_limb_t s2_limb) (sp + 16) 39 * mpi_limb_t s2_limb) (sp + 16)
40 */ 40 */
41 41
42#define res_ptr edi 42#define res_ptr edi
43#define s1_ptr esi 43#define s1_ptr esi
44#define size ecx 44#define size ecx
45#define s2_limb ebp 45#define s2_limb ebp
46 46
47 TEXT 47 TEXT
48 ALIGN (3) 48 ALIGN (3)
49 GLOBL C_SYMBOL_NAME(_gcry_mpih_mul_1) 49 GLOBL C_SYMBOL_NAME(_gcry_mpih_mul_1)
50C_SYMBOL_NAME(_gcry_mpih_mul_1:) 50C_SYMBOL_NAME(_gcry_mpih_mul_1:)
51 51
52 INSN1(push,l ,R(edi)) 52 INSN1(push,l ,R(edi))
53 INSN1(push,l ,R(esi)) 53 INSN1(push,l ,R(esi))
54 INSN1(push,l ,R(ebx)) 54 INSN1(push,l ,R(ebx))
55 INSN1(push,l ,R(ebp)) 55 INSN1(push,l ,R(ebp))
56 56
57 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20)) 57 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20))
58 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24)) 58 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24))
59 INSN2(mov,l ,R(size),MEM_DISP(esp,28)) 59 INSN2(mov,l ,R(size),MEM_DISP(esp,28))
60 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32)) 60 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32))
61 61
62 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4)) 62 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
63 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4)) 63 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
64 INSN1(neg,l ,R(size)) 64 INSN1(neg,l ,R(size))
65 INSN2(xor,l ,R(ebx),R(ebx)) 65 INSN2(xor,l ,R(ebx),R(ebx))
66 ALIGN (3) 66 ALIGN (3)
67Loop: 67Loop:
68 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) 68 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4))
69 INSN1(mul,l ,R(s2_limb)) 69 INSN1(mul,l ,R(s2_limb))
70 INSN2(add,l ,R(eax),R(ebx)) 70 INSN2(add,l ,R(eax),R(ebx))
71 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(eax)) 71 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(eax))
72 INSN2(adc,l ,R(edx),$0) 72 INSN2(adc,l ,R(edx),$0)
73 INSN2(mov,l ,R(ebx),R(edx)) 73 INSN2(mov,l ,R(ebx),R(edx))
74 74
75 INSN1(inc,l ,R(size)) 75 INSN1(inc,l ,R(size))
76 INSN1(jnz, ,Loop) 76 INSN1(jnz, ,Loop)
77 INSN2(mov,l ,R(eax),R(ebx)) 77 INSN2(mov,l ,R(eax),R(ebx))
78 78
79 INSN1(pop,l ,R(ebp)) 79 INSN1(pop,l ,R(ebp))
80 INSN1(pop,l ,R(ebx)) 80 INSN1(pop,l ,R(ebx))
81 INSN1(pop,l ,R(esi)) 81 INSN1(pop,l ,R(esi))
82 INSN1(pop,l ,R(edi)) 82 INSN1(pop,l ,R(edi))
83 ret 83 ret
84 84
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul2.S
index 7547f0f..9794e11 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul2.S
@@ -1,86 +1,86 @@
1/* i80386 addmul_1 -- Multiply a limb vector with a limb and add 1/* i80386 addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1998, 4 * Copyright (C) 1992, 1994, 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_addmul_1( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_addmul_1( 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_size_t s1_size, (sp + 12) 39 * mpi_size_t s1_size, (sp + 12)
40 * mpi_limb_t s2_limb) (sp + 16) 40 * mpi_limb_t s2_limb) (sp + 16)
41 */ 41 */
42 42
43#define res_ptr edi 43#define res_ptr edi
44#define s1_ptr esi 44#define s1_ptr esi
45#define size ecx 45#define size ecx
46#define s2_limb ebp 46#define s2_limb ebp
47 47
48 TEXT 48 TEXT
49 ALIGN (3) 49 ALIGN (3)
50 GLOBL C_SYMBOL_NAME(_gcry_mpih_addmul_1) 50 GLOBL C_SYMBOL_NAME(_gcry_mpih_addmul_1)
51C_SYMBOL_NAME(_gcry_mpih_addmul_1:) 51C_SYMBOL_NAME(_gcry_mpih_addmul_1:)
52 52
53 INSN1(push,l ,R(edi)) 53 INSN1(push,l ,R(edi))
54 INSN1(push,l ,R(esi)) 54 INSN1(push,l ,R(esi))
55 INSN1(push,l ,R(ebx)) 55 INSN1(push,l ,R(ebx))
56 INSN1(push,l ,R(ebp)) 56 INSN1(push,l ,R(ebp))
57 57
58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20)) 58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20))
59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24)) 59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24))
60 INSN2(mov,l ,R(size),MEM_DISP(esp,28)) 60 INSN2(mov,l ,R(size),MEM_DISP(esp,28))
61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32)) 61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32))
62 62
63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4)) 63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4)) 64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
65 INSN1(neg,l ,R(size)) 65 INSN1(neg,l ,R(size))
66 INSN2(xor,l ,R(ebx),R(ebx)) 66 INSN2(xor,l ,R(ebx),R(ebx))
67 ALIGN (3) 67 ALIGN (3)
68Loop: 68Loop:
69 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) 69 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4))
70 INSN1(mul,l ,R(s2_limb)) 70 INSN1(mul,l ,R(s2_limb))
71 INSN2(add,l ,R(eax),R(ebx)) 71 INSN2(add,l ,R(eax),R(ebx))
72 INSN2(adc,l ,R(edx),$0) 72 INSN2(adc,l ,R(edx),$0)
73 INSN2(add,l ,MEM_INDEX(res_ptr,size,4),R(eax)) 73 INSN2(add,l ,MEM_INDEX(res_ptr,size,4),R(eax))
74 INSN2(adc,l ,R(edx),$0) 74 INSN2(adc,l ,R(edx),$0)
75 INSN2(mov,l ,R(ebx),R(edx)) 75 INSN2(mov,l ,R(ebx),R(edx))
76 76
77 INSN1(inc,l ,R(size)) 77 INSN1(inc,l ,R(size))
78 INSN1(jnz, ,Loop) 78 INSN1(jnz, ,Loop)
79 INSN2(mov,l ,R(eax),R(ebx)) 79 INSN2(mov,l ,R(eax),R(ebx))
80 80
81 INSN1(pop,l ,R(ebp)) 81 INSN1(pop,l ,R(ebp))
82 INSN1(pop,l ,R(ebx)) 82 INSN1(pop,l ,R(ebx))
83 INSN1(pop,l ,R(esi)) 83 INSN1(pop,l ,R(esi))
84 INSN1(pop,l ,R(edi)) 84 INSN1(pop,l ,R(edi))
85 ret 85 ret
86 86
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul3.S
index 498052d..6df2017 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-mul3.S
@@ -1,86 +1,86 @@
1/* i80386 submul_1 -- Multiply a limb vector with a limb and add 1/* i80386 submul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1998, 4 * Copyright (C) 1992, 1994, 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_submul_1( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_submul_1( 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_size_t s1_size, (sp + 12) 39 * mpi_size_t s1_size, (sp + 12)
40 * mpi_limb_t s2_limb) (sp + 16) 40 * mpi_limb_t s2_limb) (sp + 16)
41 */ 41 */
42 42
43#define res_ptr edi 43#define res_ptr edi
44#define s1_ptr esi 44#define s1_ptr esi
45#define size ecx 45#define size ecx
46#define s2_limb ebp 46#define s2_limb ebp
47 47
48 TEXT 48 TEXT
49 ALIGN (3) 49 ALIGN (3)
50 GLOBL C_SYMBOL_NAME(_gcry_mpih_submul_1) 50 GLOBL C_SYMBOL_NAME(_gcry_mpih_submul_1)
51C_SYMBOL_NAME(_gcry_mpih_submul_1:) 51C_SYMBOL_NAME(_gcry_mpih_submul_1:)
52 52
53 INSN1(push,l ,R(edi)) 53 INSN1(push,l ,R(edi))
54 INSN1(push,l ,R(esi)) 54 INSN1(push,l ,R(esi))
55 INSN1(push,l ,R(ebx)) 55 INSN1(push,l ,R(ebx))
56 INSN1(push,l ,R(ebp)) 56 INSN1(push,l ,R(ebp))
57 57
58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20)) 58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20))
59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24)) 59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24))
60 INSN2(mov,l ,R(size),MEM_DISP(esp,28)) 60 INSN2(mov,l ,R(size),MEM_DISP(esp,28))
61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32)) 61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32))
62 62
63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4)) 63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4)) 64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
65 INSN1(neg,l ,R(size)) 65 INSN1(neg,l ,R(size))
66 INSN2(xor,l ,R(ebx),R(ebx)) 66 INSN2(xor,l ,R(ebx),R(ebx))
67 ALIGN (3) 67 ALIGN (3)
68Loop: 68Loop:
69 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) 69 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4))
70 INSN1(mul,l ,R(s2_limb)) 70 INSN1(mul,l ,R(s2_limb))
71 INSN2(add,l ,R(eax),R(ebx)) 71 INSN2(add,l ,R(eax),R(ebx))
72 INSN2(adc,l ,R(edx),$0) 72 INSN2(adc,l ,R(edx),$0)
73 INSN2(sub,l ,MEM_INDEX(res_ptr,size,4),R(eax)) 73 INSN2(sub,l ,MEM_INDEX(res_ptr,size,4),R(eax))
74 INSN2(adc,l ,R(edx),$0) 74 INSN2(adc,l ,R(edx),$0)
75 INSN2(mov,l ,R(ebx),R(edx)) 75 INSN2(mov,l ,R(ebx),R(edx))
76 76
77 INSN1(inc,l ,R(size)) 77 INSN1(inc,l ,R(size))
78 INSN1(jnz, ,Loop) 78 INSN1(jnz, ,Loop)
79 INSN2(mov,l ,R(eax),R(ebx)) 79 INSN2(mov,l ,R(eax),R(ebx))
80 80
81 INSN1(pop,l ,R(ebp)) 81 INSN1(pop,l ,R(ebp))
82 INSN1(pop,l ,R(ebx)) 82 INSN1(pop,l ,R(ebx))
83 INSN1(pop,l ,R(esi)) 83 INSN1(pop,l ,R(esi))
84 INSN1(pop,l ,R(edi)) 84 INSN1(pop,l ,R(edi))
85 ret 85 ret
86 86
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-rshift.S
index 4956854..2920e55 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-rshift.S
@@ -1,97 +1,97 @@
1/* i80386 rshift 1/* i80386 rshift
2 * 2 *
3 * Copyright (C) 1992, 1994, 1998, 3 * Copyright (C) 1992, 1994, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 * 21 *
22 * Note: This code is heavily based on the GNU MP Library. 22 * Note: This code is heavily based on the GNU MP Library.
23 * Actually it's the same code with only minor changes in the 23 * Actually it's the same code with only minor changes in the
24 * way the data is stored; this is to support the abstraction 24 * way the data is stored; this is to support the abstraction
25 * of an optional secure memory allocation which may be used 25 * of an optional secure memory allocation which may be used
26 * to avoid revealing of sensitive data due to paging etc. 26 * to avoid revealing of sensitive data due to paging etc.
27 */ 27 */
28 28
29 29
30#include "sysdep.h" 30#include "sysdep.h"
31#include "asm-syntax.h" 31#include "asm-syntax.h"
32 32
33 33
34/******************* 34/*******************
35 * mpi_limb_t 35 * mpi_limb_t
36 * _gcry_mpih_rshift( mpi_ptr_t wp, (sp + 4) 36 * _gcry_mpih_rshift( mpi_ptr_t wp, (sp + 4)
37 * mpi_ptr_t up, (sp + 8) 37 * mpi_ptr_t up, (sp + 8)
38 * mpi_size_t usize, (sp + 12) 38 * mpi_size_t usize, (sp + 12)
39 * unsigned cnt) (sp + 16) 39 * unsigned cnt) (sp + 16)
40 */ 40 */
41 41
42.text 42.text
43 ALIGN (3) 43 ALIGN (3)
44 .globl C_SYMBOL_NAME(_gcry_mpih_rshift) 44 .globl C_SYMBOL_NAME(_gcry_mpih_rshift)
45C_SYMBOL_NAME(_gcry_mpih_rshift:) 45C_SYMBOL_NAME(_gcry_mpih_rshift:)
46 pushl %edi 46 pushl %edi
47 pushl %esi 47 pushl %esi
48 pushl %ebx 48 pushl %ebx
49 49
50 movl 16(%esp),%edi /* wp */ 50 movl 16(%esp),%edi /* wp */
51 movl 20(%esp),%esi /* up */ 51 movl 20(%esp),%esi /* up */
52 movl 24(%esp),%edx /* usize */ 52 movl 24(%esp),%edx /* usize */
53 movl 28(%esp),%ecx /* cnt */ 53 movl 28(%esp),%ecx /* cnt */
54 54
55 leal -4(%edi,%edx,4),%edi 55 leal -4(%edi,%edx,4),%edi
56 leal (%esi,%edx,4),%esi 56 leal (%esi,%edx,4),%esi
57 negl %edx 57 negl %edx
58 58
59 movl (%esi,%edx,4),%ebx /* read least significant limb */ 59 movl (%esi,%edx,4),%ebx /* read least significant limb */
60 xorl %eax,%eax 60 xorl %eax,%eax
61 shrdl %cl,%ebx,%eax /* compute carry limb */ 61 shrdl %cl,%ebx,%eax /* compute carry limb */
62 incl %edx 62 incl %edx
63 jz Lend2 63 jz Lend2
64 pushl %eax /* push carry limb onto stack */ 64 pushl %eax /* push carry limb onto stack */
65 testb $1,%dl 65 testb $1,%dl
66 jnz L2 /* enter loop in the middle */ 66 jnz L2 /* enter loop in the middle */
67 movl %ebx,%eax 67 movl %ebx,%eax
68 68
69 ALIGN (3) 69 ALIGN (3)
70Loop2: movl (%esi,%edx,4),%ebx /* load next higher limb */ 70Loop2: movl (%esi,%edx,4),%ebx /* load next higher limb */
71 shrdl %cl,%ebx,%eax /* compute result limb */ 71 shrdl %cl,%ebx,%eax /* compute result limb */
72 movl %eax,(%edi,%edx,4) /* store it */ 72 movl %eax,(%edi,%edx,4) /* store it */
73 incl %edx 73 incl %edx
74L2: movl (%esi,%edx,4),%eax 74L2: movl (%esi,%edx,4),%eax
75 shrdl %cl,%eax,%ebx 75 shrdl %cl,%eax,%ebx
76 movl %ebx,(%edi,%edx,4) 76 movl %ebx,(%edi,%edx,4)
77 incl %edx 77 incl %edx
78 jnz Loop2 78 jnz Loop2
79 79
80 shrl %cl,%eax /* compute most significant limb */ 80 shrl %cl,%eax /* compute most significant limb */
81 movl %eax,(%edi) /* store it */ 81 movl %eax,(%edi) /* store it */
82 82
83 popl %eax /* pop carry limb */ 83 popl %eax /* pop carry limb */
84 84
85 popl %ebx 85 popl %ebx
86 popl %esi 86 popl %esi
87 popl %edi 87 popl %edi
88 ret 88 ret
89 89
90Lend2: shrl %cl,%ebx /* compute most significant limb */ 90Lend2: shrl %cl,%ebx /* compute most significant limb */
91 movl %ebx,(%edi) /* store it */ 91 movl %ebx,(%edi) /* store it */
92 92
93 popl %ebx 93 popl %ebx
94 popl %esi 94 popl %esi
95 popl %edi 95 popl %edi
96 ret 96 ret
97 97
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-sub1.S
index 941687a..f447f7a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/mpih-sub1.S
@@ -1,117 +1,117 @@
1/* i80386 sub_n -- Sub two limb vectors of the same length > 0 and store 1/* i80386 sub_n -- Sub 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_sub_n( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_sub_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 43
44.text 44.text
45 ALIGN (3) 45 ALIGN (3)
46 .globl C_SYMBOL_NAME(_gcry_mpih_sub_n) 46 .globl C_SYMBOL_NAME(_gcry_mpih_sub_n)
47C_SYMBOL_NAME(_gcry_mpih_sub_n:) 47C_SYMBOL_NAME(_gcry_mpih_sub_n:)
48 pushl %edi 48 pushl %edi
49 pushl %esi 49 pushl %esi
50 50
51 movl 12(%esp),%edi /* res_ptr */ 51 movl 12(%esp),%edi /* res_ptr */
52 movl 16(%esp),%esi /* s1_ptr */ 52 movl 16(%esp),%esi /* s1_ptr */
53 movl 20(%esp),%edx /* s2_ptr */ 53 movl 20(%esp),%edx /* s2_ptr */
54 movl 24(%esp),%ecx /* size */ 54 movl 24(%esp),%ecx /* size */
55 55
56 movl %ecx,%eax 56 movl %ecx,%eax
57 shrl $3,%ecx /* compute count for unrolled loop */ 57 shrl $3,%ecx /* compute count for unrolled loop */
58 negl %eax 58 negl %eax
59 andl $7,%eax /* get index where to start loop */ 59 andl $7,%eax /* get index where to start loop */
60 jz Loop /* necessary special case for 0 */ 60 jz Loop /* necessary special case for 0 */
61 incl %ecx /* adjust loop count */ 61 incl %ecx /* adjust loop count */
62 shll $2,%eax /* adjustment for pointers... */ 62 shll $2,%eax /* adjustment for pointers... */
63 subl %eax,%edi /* ... since they are offset ... */ 63 subl %eax,%edi /* ... since they are offset ... */
64 subl %eax,%esi /* ... by a constant when we ... */ 64 subl %eax,%esi /* ... by a constant when we ... */
65 subl %eax,%edx /* ... enter the loop */ 65 subl %eax,%edx /* ... enter the loop */
66 shrl $2,%eax /* restore previous value */ 66 shrl $2,%eax /* restore previous value */
67#ifdef PIC 67#ifdef PIC
68/* Calculate start address in loop for PIC. Due to limitations in some 68/* Calculate start address in loop for PIC. Due to limitations in some
69 assemblers, Loop-L0-3 cannot be put into the leal */ 69 assemblers, Loop-L0-3 cannot be put into the leal */
70 call L0 70 call L0
71L0: leal (%eax,%eax,8),%eax 71L0: leal (%eax,%eax,8),%eax
72 addl (%esp),%eax 72 addl (%esp),%eax
73 addl $(Loop-L0-3),%eax 73 addl $(Loop-L0-3),%eax
74 addl $4,%esp 74 addl $4,%esp
75#else 75#else
76/* Calculate start address in loop for non-PIC. */ 76/* Calculate start address in loop for non-PIC. */
77 leal (Loop - 3)(%eax,%eax,8),%eax 77 leal (Loop - 3)(%eax,%eax,8),%eax
78#endif 78#endif
79 jmp *%eax /* jump into loop */ 79 jmp *%eax /* jump into loop */
80 ALIGN (3) 80 ALIGN (3)
81Loop: movl (%esi),%eax 81Loop: movl (%esi),%eax
82 sbbl (%edx),%eax 82 sbbl (%edx),%eax
83 movl %eax,(%edi) 83 movl %eax,(%edi)
84 movl 4(%esi),%eax 84 movl 4(%esi),%eax
85 sbbl 4(%edx),%eax 85 sbbl 4(%edx),%eax
86 movl %eax,4(%edi) 86 movl %eax,4(%edi)
87 movl 8(%esi),%eax 87 movl 8(%esi),%eax
88 sbbl 8(%edx),%eax 88 sbbl 8(%edx),%eax
89 movl %eax,8(%edi) 89 movl %eax,8(%edi)
90 movl 12(%esi),%eax 90 movl 12(%esi),%eax
91 sbbl 12(%edx),%eax 91 sbbl 12(%edx),%eax
92 movl %eax,12(%edi) 92 movl %eax,12(%edi)
93 movl 16(%esi),%eax 93 movl 16(%esi),%eax
94 sbbl 16(%edx),%eax 94 sbbl 16(%edx),%eax
95 movl %eax,16(%edi) 95 movl %eax,16(%edi)
96 movl 20(%esi),%eax 96 movl 20(%esi),%eax
97 sbbl 20(%edx),%eax 97 sbbl 20(%edx),%eax
98 movl %eax,20(%edi) 98 movl %eax,20(%edi)
99 movl 24(%esi),%eax 99 movl 24(%esi),%eax
100 sbbl 24(%edx),%eax 100 sbbl 24(%edx),%eax
101 movl %eax,24(%edi) 101 movl %eax,24(%edi)
102 movl 28(%esi),%eax 102 movl 28(%esi),%eax
103 sbbl 28(%edx),%eax 103 sbbl 28(%edx),%eax
104 movl %eax,28(%edi) 104 movl %eax,28(%edi)
105 leal 32(%edi),%edi 105 leal 32(%edi),%edi
106 leal 32(%esi),%esi 106 leal 32(%esi),%esi
107 leal 32(%edx),%edx 107 leal 32(%edx),%edx
108 decl %ecx 108 decl %ecx
109 jnz Loop 109 jnz Loop
110 110
111 sbbl %eax,%eax 111 sbbl %eax,%eax
112 negl %eax 112 negl %eax
113 113
114 popl %esi 114 popl %esi
115 popl %edi 115 popl %edi
116 ret 116 ret
117 117
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/syntax.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/syntax.h
index ef91ed7..39ede98 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/syntax.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i386/syntax.h
@@ -1,68 +1,68 @@
1/* syntax.h -- Definitions for x86 syntax variations. 1/* syntax.h -- Definitions for x86 syntax variations.
2 * 2 *
3 * Copyright (C) 1992, 1994, 1995, 1998, 3 * Copyright (C) 1992, 1994, 1995, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 * 21 *
22 * Note: This code is heavily based on the GNU MP Library. 22 * Note: This code is heavily based on the GNU MP Library.
23 * Actually it's the same code with only minor changes in the 23 * Actually it's the same code with only minor changes in the
24 * way the data is stored; this is to support the abstraction 24 * way the data is stored; this is to support the abstraction
25 * of an optional secure memory allocation which may be used 25 * of an optional secure memory allocation which may be used
26 * to avoid revealing of sensitive data due to paging etc. 26 * to avoid revealing of sensitive data due to paging etc.
27 */ 27 */
28 28
29#undef ALIGN 29#undef ALIGN
30 30
31#if defined (BSD_SYNTAX) || defined (ELF_SYNTAX) 31#if defined (BSD_SYNTAX) || defined (ELF_SYNTAX)
32#define R(r) %r 32#define R(r) %r
33#define MEM(base)(base) 33#define MEM(base)(base)
34#define MEM_DISP(base,displacement)displacement(R(base)) 34#define MEM_DISP(base,displacement)displacement(R(base))
35#define MEM_INDEX(base,index,size)(R(base),R(index),size) 35#define MEM_INDEX(base,index,size)(R(base),R(index),size)
36#ifdef __STDC__ 36#ifdef __STDC__
37#define INSN1(mnemonic,size_suffix,dst)mnemonic##size_suffix dst 37#define INSN1(mnemonic,size_suffix,dst)mnemonic##size_suffix dst
38#define INSN2(mnemonic,size_suffix,dst,src)mnemonic##size_suffix src,dst 38#define INSN2(mnemonic,size_suffix,dst,src)mnemonic##size_suffix src,dst
39#else 39#else
40#define INSN1(mnemonic,size_suffix,dst)mnemonic/**/size_suffix dst 40#define INSN1(mnemonic,size_suffix,dst)mnemonic/**/size_suffix dst
41#define INSN2(mnemonic,size_suffix,dst,src)mnemonic/**/size_suffix src,dst 41#define INSN2(mnemonic,size_suffix,dst,src)mnemonic/**/size_suffix src,dst
42#endif 42#endif
43#define TEXT .text 43#define TEXT .text
44#if defined (BSD_SYNTAX) 44#if defined (BSD_SYNTAX)
45#define ALIGN(log) .align log 45#define ALIGN(log) .align log
46#endif 46#endif
47#if defined (ELF_SYNTAX) 47#if defined (ELF_SYNTAX)
48#define ALIGN(log) .align 1<<(log) 48#define ALIGN(log) .align 1<<(log)
49#endif 49#endif
50#define GLOBL .globl 50#define GLOBL .globl
51#endif 51#endif
52 52
53#ifdef INTEL_SYNTAX 53#ifdef INTEL_SYNTAX
54#define R(r) r 54#define R(r) r
55#define MEM(base)[base] 55#define MEM(base)[base]
56#define MEM_DISP(base,displacement)[base+(displacement)] 56#define MEM_DISP(base,displacement)[base+(displacement)]
57#define MEM_INDEX(base,index,size)[base+index*size] 57#define MEM_INDEX(base,index,size)[base+index*size]
58#define INSN1(mnemonic,size_suffix,dst)mnemonic dst 58#define INSN1(mnemonic,size_suffix,dst)mnemonic dst
59#define INSN2(mnemonic,size_suffix,dst,src)mnemonic dst,src 59#define INSN2(mnemonic,size_suffix,dst,src)mnemonic dst,src
60#define TEXT .text 60#define TEXT .text
61#define ALIGN(log) .align log 61#define ALIGN(log) .align log
62#define GLOBL .globl 62#define GLOBL .globl
63#endif 63#endif
64 64
65#ifdef X86_BROKEN_ALIGN 65#ifdef X86_BROKEN_ALIGN
66#undef ALIGN 66#undef ALIGN
67#define ALIGN(log) .align log,0x90 67#define ALIGN(log) .align log,0x90
68#endif 68#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/Manifest
index a3d6a4c..6d1d7f8 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/Manifest
@@ -1,27 +1,27 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser general Public License as 7# it under the terms of the GNU Lesser general Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-add1.S 20mpih-add1.S
21mpih-mul1.S 21mpih-mul1.S
22mpih-mul2.S 22mpih-mul2.S
23mpih-mul3.S 23mpih-mul3.S
24mpih-lshift.S 24mpih-lshift.S
25mpih-rshift.S 25mpih-rshift.S
26mpih-sub1.S 26mpih-sub1.S
27$names$ iQCVAwUAP+LmQDEAnp832S/7AQKCmgQAhG+E7X0KB4qdVf3sMb6Qr+Iv5Jlehzoub/5vxTRgePKzRuOHidCnTzSSoyzA++UcHrOjHQQDMsXnO6PqpS1d/TKkxjnGN7rE8mvMYlFAT8RsawTozSfh14mCzI0HTDbaKL9Z8pcMJtadB3XqAuqWJNO8kyECJFwurt3DRWXSWS8==Rug5 27$names$ iQCVAwUAP+LmQDEAnp832S/7AQKCmgQAhG+E7X0KB4qdVf3sMb6Qr+Iv5Jlehzoub/5vxTRgePKzRuOHidCnTzSSoyzA++UcHrOjHQQDMsXnO6PqpS1d/TKkxjnGN7rE8mvMYlFAT8RsawTozSfh14mCzI0HTDbaKL9Z8pcMJtadB3XqAuqWJNO8kyECJFwurt3DRWXSWS8==Rug5
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/README b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/README
index b698cba..d73b082 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/README
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/README
@@ -1,26 +1,26 @@
1This directory contains mpn functions optimized for Intel Pentium 1This directory contains mpn functions optimized for Intel Pentium
2processors. 2processors.
3 3
4RELEVANT OPTIMIZATION ISSUES 4RELEVANT OPTIMIZATION ISSUES
5 5
61. Pentium doesn't allocate cache lines on writes, unlike most other modern 61. Pentium doesn't allocate cache lines on writes, unlike most other modern
7processors. Since the functions in the mpn class do array writes, we have to 7processors. Since the functions in the mpn class do array writes, we have to
8handle allocating the destination cache lines by reading a word from it in the 8handle allocating the destination cache lines by reading a word from it in the
9loops, to achieve the best performance. 9loops, to achieve the best performance.
10 10
112. Pairing of memory operations requires that the two issued operations refer 112. Pairing of memory operations requires that the two issued operations refer
12to different cache banks. The simplest way to insure this is to read/write 12to different cache banks. The simplest way to insure this is to read/write
13two words from the same object. If we make operations on different objects, 13two words from the same object. If we make operations on different objects,
14they might or might not be to the same cache bank. 14they might or might not be to the same cache bank.
15 15
16STATUS 16STATUS
17 17
181. mpn_lshift and mpn_rshift run at about 6 cycles/limb, but the Pentium 181. mpn_lshift and mpn_rshift run at about 6 cycles/limb, but the Pentium
19documentation indicates that they should take only 43/8 = 5.375 cycles/limb, 19documentation indicates that they should take only 43/8 = 5.375 cycles/limb,
20or 5 cycles/limb asymptotically. 20or 5 cycles/limb asymptotically.
21 21
222. mpn_add_n and mpn_sub_n run at asymptotically 2 cycles/limb. Due to loop 222. mpn_add_n and mpn_sub_n run at asymptotically 2 cycles/limb. Due to loop
23overhead and other delays (cache refill?), they run at or near 2.5 cycles/limb. 23overhead and other delays (cache refill?), they run at or near 2.5 cycles/limb.
24 24
253. mpn_mul_1, mpn_addmul_1, mpn_submul_1 all run 1 cycle faster than they 253. mpn_mul_1, mpn_addmul_1, mpn_submul_1 all run 1 cycle faster than they
26should... 26should...
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/distfiles
index f11658e..546f777 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/distfiles
@@ -1,10 +1,10 @@
1Manifest 1Manifest
2mpih-add1.S 2mpih-add1.S
3mpih-mul1.S 3mpih-mul1.S
4mpih-mul2.S 4mpih-mul2.S
5mpih-mul3.S 5mpih-mul3.S
6mpih-lshift.S 6mpih-lshift.S
7mpih-rshift.S 7mpih-rshift.S
8mpih-sub1.S 8mpih-sub1.S
9README 9README
10 10
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-add1.S
index 6068fcb..7436d59 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-add1.S
@@ -1,135 +1,135 @@
1/* i80586 add_n -- Add two limb vectors of the same length > 0 and store 1/* i80586 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, 1996, 1998, 4 * Copyright (C) 1992, 1994, 1995, 1996, 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 23
24 24
25#include "sysdep.h" 25#include "sysdep.h"
26#include "asm-syntax.h" 26#include "asm-syntax.h"
27 27
28 28
29/******************* 29/*******************
30 * mpi_limb_t 30 * mpi_limb_t
31 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (sp + 4) 31 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (sp + 4)
32 * mpi_ptr_t s1_ptr, (sp + 8) 32 * mpi_ptr_t s1_ptr, (sp + 8)
33 * mpi_ptr_t s2_ptr, (sp + 12) 33 * mpi_ptr_t s2_ptr, (sp + 12)
34 * mpi_size_t size) (sp + 16) 34 * mpi_size_t size) (sp + 16)
35 */ 35 */
36 36
37.text 37.text
38 ALIGN (3) 38 ALIGN (3)
39 .globl C_SYMBOL_NAME(_gcry_mpih_add_n) 39 .globl C_SYMBOL_NAME(_gcry_mpih_add_n)
40C_SYMBOL_NAME(_gcry_mpih_add_n:) 40C_SYMBOL_NAME(_gcry_mpih_add_n:)
41 pushl %edi 41 pushl %edi
42 pushl %esi 42 pushl %esi
43 pushl %ebx 43 pushl %ebx
44 pushl %ebp 44 pushl %ebp
45 45
46 movl 20(%esp),%edi /* res_ptr */ 46 movl 20(%esp),%edi /* res_ptr */
47 movl 24(%esp),%esi /* s1_ptr */ 47 movl 24(%esp),%esi /* s1_ptr */
48 movl 28(%esp),%ebp /* s2_ptr */ 48 movl 28(%esp),%ebp /* s2_ptr */
49 movl 32(%esp),%ecx /* size */ 49 movl 32(%esp),%ecx /* size */
50 50
51 movl (%ebp),%ebx 51 movl (%ebp),%ebx
52 52
53 decl %ecx 53 decl %ecx
54 movl %ecx,%edx 54 movl %ecx,%edx
55 shrl $3,%ecx 55 shrl $3,%ecx
56 andl $7,%edx 56 andl $7,%edx
57 testl %ecx,%ecx /* zero carry flag */ 57 testl %ecx,%ecx /* zero carry flag */
58 jz Lend 58 jz Lend
59 pushl %edx 59 pushl %edx
60 60
61 ALIGN (3) 61 ALIGN (3)
62Loop: movl 28(%edi),%eax /* fetch destination cache line */ 62Loop: movl 28(%edi),%eax /* fetch destination cache line */
63 leal 32(%edi),%edi 63 leal 32(%edi),%edi
64 64
65L1: movl (%esi),%eax 65L1: movl (%esi),%eax
66 movl 4(%esi),%edx 66 movl 4(%esi),%edx
67 adcl %ebx,%eax 67 adcl %ebx,%eax
68 movl 4(%ebp),%ebx 68 movl 4(%ebp),%ebx
69 adcl %ebx,%edx 69 adcl %ebx,%edx
70 movl 8(%ebp),%ebx 70 movl 8(%ebp),%ebx
71 movl %eax,-32(%edi) 71 movl %eax,-32(%edi)
72 movl %edx,-28(%edi) 72 movl %edx,-28(%edi)
73 73
74L2: movl 8(%esi),%eax 74L2: movl 8(%esi),%eax
75 movl 12(%esi),%edx 75 movl 12(%esi),%edx
76 adcl %ebx,%eax 76 adcl %ebx,%eax
77 movl 12(%ebp),%ebx 77 movl 12(%ebp),%ebx
78 adcl %ebx,%edx 78 adcl %ebx,%edx
79 movl 16(%ebp),%ebx 79 movl 16(%ebp),%ebx
80 movl %eax,-24(%edi) 80 movl %eax,-24(%edi)
81 movl %edx,-20(%edi) 81 movl %edx,-20(%edi)
82 82
83L3: movl 16(%esi),%eax 83L3: movl 16(%esi),%eax
84 movl 20(%esi),%edx 84 movl 20(%esi),%edx
85 adcl %ebx,%eax 85 adcl %ebx,%eax
86 movl 20(%ebp),%ebx 86 movl 20(%ebp),%ebx
87 adcl %ebx,%edx 87 adcl %ebx,%edx
88 movl 24(%ebp),%ebx 88 movl 24(%ebp),%ebx
89 movl %eax,-16(%edi) 89 movl %eax,-16(%edi)
90 movl %edx,-12(%edi) 90 movl %edx,-12(%edi)
91 91
92L4: movl 24(%esi),%eax 92L4: movl 24(%esi),%eax
93 movl 28(%esi),%edx 93 movl 28(%esi),%edx
94 adcl %ebx,%eax 94 adcl %ebx,%eax
95 movl 28(%ebp),%ebx 95 movl 28(%ebp),%ebx
96 adcl %ebx,%edx 96 adcl %ebx,%edx
97 movl 32(%ebp),%ebx 97 movl 32(%ebp),%ebx
98 movl %eax,-8(%edi) 98 movl %eax,-8(%edi)
99 movl %edx,-4(%edi) 99 movl %edx,-4(%edi)
100 100
101 leal 32(%esi),%esi 101 leal 32(%esi),%esi
102 leal 32(%ebp),%ebp 102 leal 32(%ebp),%ebp
103 decl %ecx 103 decl %ecx
104 jnz Loop 104 jnz Loop
105 105
106 popl %edx 106 popl %edx
107Lend: 107Lend:
108 decl %edx /* test %edx w/o clobbering carry */ 108 decl %edx /* test %edx w/o clobbering carry */
109 js Lend2 109 js Lend2
110 incl %edx 110 incl %edx
111Loop2: 111Loop2:
112 leal 4(%edi),%edi 112 leal 4(%edi),%edi
113 movl (%esi),%eax 113 movl (%esi),%eax
114 adcl %ebx,%eax 114 adcl %ebx,%eax
115 movl 4(%ebp),%ebx 115 movl 4(%ebp),%ebx
116 movl %eax,-4(%edi) 116 movl %eax,-4(%edi)
117 leal 4(%esi),%esi 117 leal 4(%esi),%esi
118 leal 4(%ebp),%ebp 118 leal 4(%ebp),%ebp
119 decl %edx 119 decl %edx
120 jnz Loop2 120 jnz Loop2
121Lend2: 121Lend2:
122 movl (%esi),%eax 122 movl (%esi),%eax
123 adcl %ebx,%eax 123 adcl %ebx,%eax
124 movl %eax,(%edi) 124 movl %eax,(%edi)
125 125
126 sbbl %eax,%eax 126 sbbl %eax,%eax
127 negl %eax 127 negl %eax
128 128
129 popl %ebp 129 popl %ebp
130 popl %ebx 130 popl %ebx
131 popl %esi 131 popl %esi
132 popl %edi 132 popl %edi
133 ret 133 ret
134 134
135 135
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-lshift.S
index 8aa3224..9d25fe9 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-lshift.S
@@ -1,229 +1,229 @@
1/* i80586 lshift 1/* i80586 lshift
2 * 2 *
3 * Copyright (C) 1992, 1994, 1998, 3 * Copyright (C) 1992, 1994, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 * 21 *
22 * Note: This code is heavily based on the GNU MP Library. 22 * Note: This code is heavily based on the GNU MP Library.
23 * Actually it's the same code with only minor changes in the 23 * Actually it's the same code with only minor changes in the
24 * way the data is stored; this is to support the abstraction 24 * way the data is stored; this is to support the abstraction
25 * of an optional secure memory allocation which may be used 25 * of an optional secure memory allocation which may be used
26 * to avoid revealing of sensitive data due to paging etc. 26 * to avoid revealing of sensitive data due to paging etc.
27 */ 27 */
28 28
29 29
30#include "sysdep.h" 30#include "sysdep.h"
31#include "asm-syntax.h" 31#include "asm-syntax.h"
32 32
33 33
34/******************* 34/*******************
35 * mpi_limb_t 35 * mpi_limb_t
36 * _gcry_mpih_lshift( mpi_ptr_t wp, (sp + 4) 36 * _gcry_mpih_lshift( mpi_ptr_t wp, (sp + 4)
37 * mpi_ptr_t up, (sp + 8) 37 * mpi_ptr_t up, (sp + 8)
38 * mpi_size_t usize, (sp + 12) 38 * mpi_size_t usize, (sp + 12)
39 * unsigned cnt) (sp + 16) 39 * unsigned cnt) (sp + 16)
40 */ 40 */
41 41
42.text 42.text
43 ALIGN (3) 43 ALIGN (3)
44 .globl C_SYMBOL_NAME(_gcry_mpih_lshift) 44 .globl C_SYMBOL_NAME(_gcry_mpih_lshift)
45C_SYMBOL_NAME(_gcry_mpih_lshift:) 45C_SYMBOL_NAME(_gcry_mpih_lshift:)
46 46
47 pushl %edi 47 pushl %edi
48 pushl %esi 48 pushl %esi
49 pushl %ebx 49 pushl %ebx
50 pushl %ebp 50 pushl %ebp
51 51
52 movl 20(%esp),%edi /* res_ptr */ 52 movl 20(%esp),%edi /* res_ptr */
53 movl 24(%esp),%esi /* s_ptr */ 53 movl 24(%esp),%esi /* s_ptr */
54 movl 28(%esp),%ebp /* size */ 54 movl 28(%esp),%ebp /* size */
55 movl 32(%esp),%ecx /* cnt */ 55 movl 32(%esp),%ecx /* cnt */
56 56
57/* We can use faster code for shift-by-1 under certain conditions. */ 57/* We can use faster code for shift-by-1 under certain conditions. */
58 cmp $1,%ecx 58 cmp $1,%ecx
59 jne Lnormal 59 jne Lnormal
60 leal 4(%esi),%eax 60 leal 4(%esi),%eax
61 cmpl %edi,%eax 61 cmpl %edi,%eax
62 jnc Lspecial /* jump if s_ptr + 1 >= res_ptr */ 62 jnc Lspecial /* jump if s_ptr + 1 >= res_ptr */
63 leal (%esi,%ebp,4),%eax 63 leal (%esi,%ebp,4),%eax
64 cmpl %eax,%edi 64 cmpl %eax,%edi
65 jnc Lspecial /* jump if res_ptr >= s_ptr + size */ 65 jnc Lspecial /* jump if res_ptr >= s_ptr + size */
66 66
67Lnormal: 67Lnormal:
68 leal -4(%edi,%ebp,4),%edi 68 leal -4(%edi,%ebp,4),%edi
69 leal -4(%esi,%ebp,4),%esi 69 leal -4(%esi,%ebp,4),%esi
70 70
71 movl (%esi),%edx 71 movl (%esi),%edx
72 subl $4,%esi 72 subl $4,%esi
73 xorl %eax,%eax 73 xorl %eax,%eax
74 shldl %cl,%edx,%eax /* compute carry limb */ 74 shldl %cl,%edx,%eax /* compute carry limb */
75 pushl %eax /* push carry limb onto stack */ 75 pushl %eax /* push carry limb onto stack */
76 76
77 decl %ebp 77 decl %ebp
78 pushl %ebp 78 pushl %ebp
79 shrl $3,%ebp 79 shrl $3,%ebp
80 jz Lend 80 jz Lend
81 81
82 movl (%edi),%eax /* fetch destination cache line */ 82 movl (%edi),%eax /* fetch destination cache line */
83 83
84 ALIGN (2) 84 ALIGN (2)
85Loop: movl -28(%edi),%eax /* fetch destination cache line */ 85Loop: movl -28(%edi),%eax /* fetch destination cache line */
86 movl %edx,%ebx 86 movl %edx,%ebx
87 87
88 movl (%esi),%eax 88 movl (%esi),%eax
89 movl -4(%esi),%edx 89 movl -4(%esi),%edx
90 shldl %cl,%eax,%ebx 90 shldl %cl,%eax,%ebx
91 shldl %cl,%edx,%eax 91 shldl %cl,%edx,%eax
92 movl %ebx,(%edi) 92 movl %ebx,(%edi)
93 movl %eax,-4(%edi) 93 movl %eax,-4(%edi)
94 94
95 movl -8(%esi),%ebx 95 movl -8(%esi),%ebx
96 movl -12(%esi),%eax 96 movl -12(%esi),%eax
97 shldl %cl,%ebx,%edx 97 shldl %cl,%ebx,%edx
98 shldl %cl,%eax,%ebx 98 shldl %cl,%eax,%ebx
99 movl %edx,-8(%edi) 99 movl %edx,-8(%edi)
100 movl %ebx,-12(%edi) 100 movl %ebx,-12(%edi)
101 101
102 movl -16(%esi),%edx 102 movl -16(%esi),%edx
103 movl -20(%esi),%ebx 103 movl -20(%esi),%ebx
104 shldl %cl,%edx,%eax 104 shldl %cl,%edx,%eax
105 shldl %cl,%ebx,%edx 105 shldl %cl,%ebx,%edx
106 movl %eax,-16(%edi) 106 movl %eax,-16(%edi)
107 movl %edx,-20(%edi) 107 movl %edx,-20(%edi)
108 108
109 movl -24(%esi),%eax 109 movl -24(%esi),%eax
110 movl -28(%esi),%edx 110 movl -28(%esi),%edx
111 shldl %cl,%eax,%ebx 111 shldl %cl,%eax,%ebx
112 shldl %cl,%edx,%eax 112 shldl %cl,%edx,%eax
113 movl %ebx,-24(%edi) 113 movl %ebx,-24(%edi)
114 movl %eax,-28(%edi) 114 movl %eax,-28(%edi)
115 115
116 subl $32,%esi 116 subl $32,%esi
117 subl $32,%edi 117 subl $32,%edi
118 decl %ebp 118 decl %ebp
119 jnz Loop 119 jnz Loop
120 120
121Lend: popl %ebp 121Lend: popl %ebp
122 andl $7,%ebp 122 andl $7,%ebp
123 jz Lend2 123 jz Lend2
124Loop2: movl (%esi),%eax 124Loop2: movl (%esi),%eax
125 shldl %cl,%eax,%edx 125 shldl %cl,%eax,%edx
126 movl %edx,(%edi) 126 movl %edx,(%edi)
127 movl %eax,%edx 127 movl %eax,%edx
128 subl $4,%esi 128 subl $4,%esi
129 subl $4,%edi 129 subl $4,%edi
130 decl %ebp 130 decl %ebp
131 jnz Loop2 131 jnz Loop2
132 132
133Lend2: shll %cl,%edx /* compute least significant limb */ 133Lend2: shll %cl,%edx /* compute least significant limb */
134 movl %edx,(%edi) /* store it */ 134 movl %edx,(%edi) /* store it */
135 135
136 popl %eax /* pop carry limb */ 136 popl %eax /* pop carry limb */
137 137
138 popl %ebp 138 popl %ebp
139 popl %ebx 139 popl %ebx
140 popl %esi 140 popl %esi
141 popl %edi 141 popl %edi
142 ret 142 ret
143 143
144/* We loop from least significant end of the arrays, which is only 144/* We loop from least significant end of the arrays, which is only
145 permissable if the source and destination don't overlap, since the 145 permissable if the source and destination don't overlap, since the
146 function is documented to work for overlapping source and destination. 146 function is documented to work for overlapping source and destination.
147*/ 147*/
148 148
149Lspecial: 149Lspecial:
150 movl (%esi),%edx 150 movl (%esi),%edx
151 addl $4,%esi 151 addl $4,%esi
152 152
153 decl %ebp 153 decl %ebp
154 pushl %ebp 154 pushl %ebp
155 shrl $3,%ebp 155 shrl $3,%ebp
156 156
157 addl %edx,%edx 157 addl %edx,%edx
158 incl %ebp 158 incl %ebp
159 decl %ebp 159 decl %ebp
160 jz LLend 160 jz LLend
161 161
162 movl (%edi),%eax /* fetch destination cache line */ 162 movl (%edi),%eax /* fetch destination cache line */
163 163
164 ALIGN (2) 164 ALIGN (2)
165LLoop: movl 28(%edi),%eax /* fetch destination cache line */ 165LLoop: movl 28(%edi),%eax /* fetch destination cache line */
166 movl %edx,%ebx 166 movl %edx,%ebx
167 167
168 movl (%esi),%eax 168 movl (%esi),%eax
169 movl 4(%esi),%edx 169 movl 4(%esi),%edx
170 adcl %eax,%eax 170 adcl %eax,%eax
171 movl %ebx,(%edi) 171 movl %ebx,(%edi)
172 adcl %edx,%edx 172 adcl %edx,%edx
173 movl %eax,4(%edi) 173 movl %eax,4(%edi)
174 174
175 movl 8(%esi),%ebx 175 movl 8(%esi),%ebx
176 movl 12(%esi),%eax 176 movl 12(%esi),%eax
177 adcl %ebx,%ebx 177 adcl %ebx,%ebx
178 movl %edx,8(%edi) 178 movl %edx,8(%edi)
179 adcl %eax,%eax 179 adcl %eax,%eax
180 movl %ebx,12(%edi) 180 movl %ebx,12(%edi)
181 181
182 movl 16(%esi),%edx 182 movl 16(%esi),%edx
183 movl 20(%esi),%ebx 183 movl 20(%esi),%ebx
184 adcl %edx,%edx 184 adcl %edx,%edx
185 movl %eax,16(%edi) 185 movl %eax,16(%edi)
186 adcl %ebx,%ebx 186 adcl %ebx,%ebx
187 movl %edx,20(%edi) 187 movl %edx,20(%edi)
188 188
189 movl 24(%esi),%eax 189 movl 24(%esi),%eax
190 movl 28(%esi),%edx 190 movl 28(%esi),%edx
191 adcl %eax,%eax 191 adcl %eax,%eax
192 movl %ebx,24(%edi) 192 movl %ebx,24(%edi)
193 adcl %edx,%edx 193 adcl %edx,%edx
194 movl %eax,28(%edi) 194 movl %eax,28(%edi)
195 195
196 leal 32(%esi),%esi /* use leal not to clobber carry */ 196 leal 32(%esi),%esi /* use leal not to clobber carry */
197 leal 32(%edi),%edi 197 leal 32(%edi),%edi
198 decl %ebp 198 decl %ebp
199 jnz LLoop 199 jnz LLoop
200 200
201LLend: popl %ebp 201LLend: popl %ebp
202 sbbl %eax,%eax /* save carry in %eax */ 202 sbbl %eax,%eax /* save carry in %eax */
203 andl $7,%ebp 203 andl $7,%ebp
204 jz LLend2 204 jz LLend2
205 addl %eax,%eax /* restore carry from eax */ 205 addl %eax,%eax /* restore carry from eax */
206LLoop2: movl %edx,%ebx 206LLoop2: movl %edx,%ebx
207 movl (%esi),%edx 207 movl (%esi),%edx
208 adcl %edx,%edx 208 adcl %edx,%edx
209 movl %ebx,(%edi) 209 movl %ebx,(%edi)
210 210
211 leal 4(%esi),%esi /* use leal not to clobber carry */ 211 leal 4(%esi),%esi /* use leal not to clobber carry */
212 leal 4(%edi),%edi 212 leal 4(%edi),%edi
213 decl %ebp 213 decl %ebp
214 jnz LLoop2 214 jnz LLoop2
215 215
216 jmp LL1 216 jmp LL1
217LLend2: addl %eax,%eax /* restore carry from eax */ 217LLend2: addl %eax,%eax /* restore carry from eax */
218LL1: movl %edx,(%edi) /* store last limb */ 218LL1: movl %edx,(%edi) /* store last limb */
219 219
220 sbbl %eax,%eax 220 sbbl %eax,%eax
221 negl %eax 221 negl %eax
222 222
223 popl %ebp 223 popl %ebp
224 popl %ebx 224 popl %ebx
225 popl %esi 225 popl %esi
226 popl %edi 226 popl %edi
227 ret 227 ret
228 228
229 229
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul1.S
index 2e32460..3601d96 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul1.S
@@ -1,89 +1,89 @@
1/* i80586 mul_1 -- Multiply a limb vector with a limb and store 1/* i80586 mul_1 -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1996, 1998, 4 * Copyright (C) 1992, 1994, 1996, 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_mul_1( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_mul_1( 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_size_t s1_size, (sp + 12) 39 * mpi_size_t s1_size, (sp + 12)
40 * mpi_limb_t s2_limb) (sp + 16) 40 * mpi_limb_t s2_limb) (sp + 16)
41 */ 41 */
42 42
43#define res_ptr edi 43#define res_ptr edi
44#define s1_ptr esi 44#define s1_ptr esi
45#define size ecx 45#define size ecx
46#define s2_limb ebp 46#define s2_limb ebp
47 47
48 TEXT 48 TEXT
49 ALIGN (3) 49 ALIGN (3)
50 GLOBL C_SYMBOL_NAME(_gcry_mpih_mul_1) 50 GLOBL C_SYMBOL_NAME(_gcry_mpih_mul_1)
51C_SYMBOL_NAME(_gcry_mpih_mul_1:) 51C_SYMBOL_NAME(_gcry_mpih_mul_1:)
52 52
53 INSN1(push,l ,R(edi)) 53 INSN1(push,l ,R(edi))
54 INSN1(push,l ,R(esi)) 54 INSN1(push,l ,R(esi))
55 INSN1(push,l ,R(ebx)) 55 INSN1(push,l ,R(ebx))
56 INSN1(push,l ,R(ebp)) 56 INSN1(push,l ,R(ebp))
57 57
58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20)) 58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20))
59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24)) 59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24))
60 INSN2(mov,l ,R(size),MEM_DISP(esp,28)) 60 INSN2(mov,l ,R(size),MEM_DISP(esp,28))
61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32)) 61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32))
62 62
63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4)) 63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4)) 64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
65 INSN1(neg,l ,R(size)) 65 INSN1(neg,l ,R(size))
66 INSN2(xor,l ,R(ebx),R(ebx)) 66 INSN2(xor,l ,R(ebx),R(ebx))
67 ALIGN (3) 67 ALIGN (3)
68 68
69Loop: INSN2(adc,l ,R(ebx),$0) 69Loop: INSN2(adc,l ,R(ebx),$0)
70 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) 70 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4))
71 71
72 INSN1(mul,l ,R(s2_limb)) 72 INSN1(mul,l ,R(s2_limb))
73 73
74 INSN2(add,l ,R(ebx),R(eax)) 74 INSN2(add,l ,R(ebx),R(eax))
75 75
76 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(ebx)) 76 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(ebx))
77 INSN1(inc,l ,R(size)) 77 INSN1(inc,l ,R(size))
78 78
79 INSN2(mov,l ,R(ebx),R(edx)) 79 INSN2(mov,l ,R(ebx),R(edx))
80 INSN1(jnz, ,Loop) 80 INSN1(jnz, ,Loop)
81 81
82 INSN2(adc,l ,R(ebx),$0) 82 INSN2(adc,l ,R(ebx),$0)
83 INSN2(mov,l ,R(eax),R(ebx)) 83 INSN2(mov,l ,R(eax),R(ebx))
84 INSN1(pop,l ,R(ebp)) 84 INSN1(pop,l ,R(ebp))
85 INSN1(pop,l ,R(ebx)) 85 INSN1(pop,l ,R(ebx))
86 INSN1(pop,l ,R(esi)) 86 INSN1(pop,l ,R(esi))
87 INSN1(pop,l ,R(edi)) 87 INSN1(pop,l ,R(edi))
88 ret 88 ret
89 89
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul2.S
index 47b0ec4..f32d363 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul2.S
@@ -1,93 +1,93 @@
1/* i80586 addmul_1 -- Multiply a limb vector with a limb and add 1/* i80586 addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1998, 4 * Copyright (C) 1992, 1994, 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_addmul_1( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_addmul_1( 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_size_t s1_size, (sp + 12) 39 * mpi_size_t s1_size, (sp + 12)
40 * mpi_limb_t s2_limb) (sp + 16) 40 * mpi_limb_t s2_limb) (sp + 16)
41 */ 41 */
42 42
43#define res_ptr edi 43#define res_ptr edi
44#define s1_ptr esi 44#define s1_ptr esi
45#define size ecx 45#define size ecx
46#define s2_limb ebp 46#define s2_limb ebp
47 47
48 TEXT 48 TEXT
49 ALIGN (3) 49 ALIGN (3)
50 GLOBL C_SYMBOL_NAME(_gcry_mpih_addmul_1) 50 GLOBL C_SYMBOL_NAME(_gcry_mpih_addmul_1)
51C_SYMBOL_NAME(_gcry_mpih_addmul_1:) 51C_SYMBOL_NAME(_gcry_mpih_addmul_1:)
52 52
53 INSN1(push,l ,R(edi)) 53 INSN1(push,l ,R(edi))
54 INSN1(push,l ,R(esi)) 54 INSN1(push,l ,R(esi))
55 INSN1(push,l ,R(ebx)) 55 INSN1(push,l ,R(ebx))
56 INSN1(push,l ,R(ebp)) 56 INSN1(push,l ,R(ebp))
57 57
58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20)) 58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20))
59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24)) 59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24))
60 INSN2(mov,l ,R(size),MEM_DISP(esp,28)) 60 INSN2(mov,l ,R(size),MEM_DISP(esp,28))
61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32)) 61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32))
62 62
63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4)) 63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4)) 64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
65 INSN1(neg,l ,R(size)) 65 INSN1(neg,l ,R(size))
66 INSN2(xor,l ,R(ebx),R(ebx)) 66 INSN2(xor,l ,R(ebx),R(ebx))
67 ALIGN (3) 67 ALIGN (3)
68 68
69Loop: INSN2(adc,l ,R(ebx),$0) 69Loop: INSN2(adc,l ,R(ebx),$0)
70 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) 70 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4))
71 71
72 INSN1(mul,l ,R(s2_limb)) 72 INSN1(mul,l ,R(s2_limb))
73 73
74 INSN2(add,l ,R(eax),R(ebx)) 74 INSN2(add,l ,R(eax),R(ebx))
75 INSN2(mov,l ,R(ebx),MEM_INDEX(res_ptr,size,4)) 75 INSN2(mov,l ,R(ebx),MEM_INDEX(res_ptr,size,4))
76 76
77 INSN2(adc,l ,R(edx),$0) 77 INSN2(adc,l ,R(edx),$0)
78 INSN2(add,l ,R(ebx),R(eax)) 78 INSN2(add,l ,R(ebx),R(eax))
79 79
80 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(ebx)) 80 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(ebx))
81 INSN1(inc,l ,R(size)) 81 INSN1(inc,l ,R(size))
82 82
83 INSN2(mov,l ,R(ebx),R(edx)) 83 INSN2(mov,l ,R(ebx),R(edx))
84 INSN1(jnz, ,Loop) 84 INSN1(jnz, ,Loop)
85 85
86 INSN2(adc,l ,R(ebx),$0) 86 INSN2(adc,l ,R(ebx),$0)
87 INSN2(mov,l ,R(eax),R(ebx)) 87 INSN2(mov,l ,R(eax),R(ebx))
88 INSN1(pop,l ,R(ebp)) 88 INSN1(pop,l ,R(ebp))
89 INSN1(pop,l ,R(ebx)) 89 INSN1(pop,l ,R(ebx))
90 INSN1(pop,l ,R(esi)) 90 INSN1(pop,l ,R(esi))
91 INSN1(pop,l ,R(edi)) 91 INSN1(pop,l ,R(edi))
92 ret 92 ret
93 93
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul3.S
index 4c1bd83..fa27d4e 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-mul3.S
@@ -1,93 +1,93 @@
1/* i80586 submul_1 -- Multiply a limb vector with a limb and add 1/* i80586 submul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1998, 4 * Copyright (C) 1992, 1994, 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_submul_1( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_submul_1( 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_size_t s1_size, (sp + 12) 39 * mpi_size_t s1_size, (sp + 12)
40 * mpi_limb_t s2_limb) (sp + 16) 40 * mpi_limb_t s2_limb) (sp + 16)
41 */ 41 */
42 42
43#define res_ptr edi 43#define res_ptr edi
44#define s1_ptr esi 44#define s1_ptr esi
45#define size ecx 45#define size ecx
46#define s2_limb ebp 46#define s2_limb ebp
47 47
48 TEXT 48 TEXT
49 ALIGN (3) 49 ALIGN (3)
50 GLOBL C_SYMBOL_NAME(_gcry_mpih_submul_1) 50 GLOBL C_SYMBOL_NAME(_gcry_mpih_submul_1)
51C_SYMBOL_NAME(_gcry_mpih_submul_1:) 51C_SYMBOL_NAME(_gcry_mpih_submul_1:)
52 52
53 INSN1(push,l ,R(edi)) 53 INSN1(push,l ,R(edi))
54 INSN1(push,l ,R(esi)) 54 INSN1(push,l ,R(esi))
55 INSN1(push,l ,R(ebx)) 55 INSN1(push,l ,R(ebx))
56 INSN1(push,l ,R(ebp)) 56 INSN1(push,l ,R(ebp))
57 57
58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20)) 58 INSN2(mov,l ,R(res_ptr),MEM_DISP(esp,20))
59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24)) 59 INSN2(mov,l ,R(s1_ptr),MEM_DISP(esp,24))
60 INSN2(mov,l ,R(size),MEM_DISP(esp,28)) 60 INSN2(mov,l ,R(size),MEM_DISP(esp,28))
61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32)) 61 INSN2(mov,l ,R(s2_limb),MEM_DISP(esp,32))
62 62
63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4)) 63 INSN2(lea,l ,R(res_ptr),MEM_INDEX(res_ptr,size,4))
64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4)) 64 INSN2(lea,l ,R(s1_ptr),MEM_INDEX(s1_ptr,size,4))
65 INSN1(neg,l ,R(size)) 65 INSN1(neg,l ,R(size))
66 INSN2(xor,l ,R(ebx),R(ebx)) 66 INSN2(xor,l ,R(ebx),R(ebx))
67 ALIGN (3) 67 ALIGN (3)
68 68
69Loop: INSN2(adc,l ,R(ebx),$0) 69Loop: INSN2(adc,l ,R(ebx),$0)
70 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4)) 70 INSN2(mov,l ,R(eax),MEM_INDEX(s1_ptr,size,4))
71 71
72 INSN1(mul,l ,R(s2_limb)) 72 INSN1(mul,l ,R(s2_limb))
73 73
74 INSN2(add,l ,R(eax),R(ebx)) 74 INSN2(add,l ,R(eax),R(ebx))
75 INSN2(mov,l ,R(ebx),MEM_INDEX(res_ptr,size,4)) 75 INSN2(mov,l ,R(ebx),MEM_INDEX(res_ptr,size,4))
76 76
77 INSN2(adc,l ,R(edx),$0) 77 INSN2(adc,l ,R(edx),$0)
78 INSN2(sub,l ,R(ebx),R(eax)) 78 INSN2(sub,l ,R(ebx),R(eax))
79 79
80 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(ebx)) 80 INSN2(mov,l ,MEM_INDEX(res_ptr,size,4),R(ebx))
81 INSN1(inc,l ,R(size)) 81 INSN1(inc,l ,R(size))
82 82
83 INSN2(mov,l ,R(ebx),R(edx)) 83 INSN2(mov,l ,R(ebx),R(edx))
84 INSN1(jnz, ,Loop) 84 INSN1(jnz, ,Loop)
85 85
86 INSN2(adc,l ,R(ebx),$0) 86 INSN2(adc,l ,R(ebx),$0)
87 INSN2(mov,l ,R(eax),R(ebx)) 87 INSN2(mov,l ,R(eax),R(ebx))
88 INSN1(pop,l ,R(ebp)) 88 INSN1(pop,l ,R(ebp))
89 INSN1(pop,l ,R(ebx)) 89 INSN1(pop,l ,R(ebx))
90 INSN1(pop,l ,R(esi)) 90 INSN1(pop,l ,R(esi))
91 INSN1(pop,l ,R(edi)) 91 INSN1(pop,l ,R(edi))
92 ret 92 ret
93 93
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-rshift.S
index fec2025..c661e3d 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-rshift.S
@@ -1,228 +1,228 @@
1/* i80586 rshift 1/* i80586 rshift
2 * 2 *
3 * Copyright (C) 1992, 1994, 1998, 3 * Copyright (C) 1992, 1994, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 * 21 *
22 * Note: This code is heavily based on the GNU MP Library. 22 * Note: This code is heavily based on the GNU MP Library.
23 * Actually it's the same code with only minor changes in the 23 * Actually it's the same code with only minor changes in the
24 * way the data is stored; this is to support the abstraction 24 * way the data is stored; this is to support the abstraction
25 * of an optional secure memory allocation which may be used 25 * of an optional secure memory allocation which may be used
26 * to avoid revealing of sensitive data due to paging etc. 26 * to avoid revealing of sensitive data due to paging etc.
27 */ 27 */
28 28
29 29
30#include "sysdep.h" 30#include "sysdep.h"
31#include "asm-syntax.h" 31#include "asm-syntax.h"
32 32
33 33
34 34
35/******************* 35/*******************
36 * mpi_limb_t 36 * mpi_limb_t
37 * _gcry_mpih_rshift( mpi_ptr_t wp, (sp + 4) 37 * _gcry_mpih_rshift( mpi_ptr_t wp, (sp + 4)
38 * mpi_ptr_t up, (sp + 8) 38 * mpi_ptr_t up, (sp + 8)
39 * mpi_size_t usize, (sp + 12) 39 * mpi_size_t usize, (sp + 12)
40 * unsigned cnt) (sp + 16) 40 * unsigned cnt) (sp + 16)
41 */ 41 */
42 42
43.text 43.text
44 ALIGN (3) 44 ALIGN (3)
45 .globl C_SYMBOL_NAME(_gcry_mpih_rshift) 45 .globl C_SYMBOL_NAME(_gcry_mpih_rshift)
46C_SYMBOL_NAME(_gcry_mpih_rshift:) 46C_SYMBOL_NAME(_gcry_mpih_rshift:)
47 pushl %edi 47 pushl %edi
48 pushl %esi 48 pushl %esi
49 pushl %ebx 49 pushl %ebx
50 pushl %ebp 50 pushl %ebp
51 51
52 movl 20(%esp),%edi /* res_ptr */ 52 movl 20(%esp),%edi /* res_ptr */
53 movl 24(%esp),%esi /* s_ptr */ 53 movl 24(%esp),%esi /* s_ptr */
54 movl 28(%esp),%ebp /* size */ 54 movl 28(%esp),%ebp /* size */
55 movl 32(%esp),%ecx /* cnt */ 55 movl 32(%esp),%ecx /* cnt */
56 56
57/* We can use faster code for shift-by-1 under certain conditions. */ 57/* We can use faster code for shift-by-1 under certain conditions. */
58 cmp $1,%ecx 58 cmp $1,%ecx
59 jne Rnormal 59 jne Rnormal
60 leal 4(%edi),%eax 60 leal 4(%edi),%eax
61 cmpl %esi,%eax 61 cmpl %esi,%eax
62 jnc Rspecial /* jump if res_ptr + 1 >= s_ptr */ 62 jnc Rspecial /* jump if res_ptr + 1 >= s_ptr */
63 leal (%edi,%ebp,4),%eax 63 leal (%edi,%ebp,4),%eax
64 cmpl %eax,%esi 64 cmpl %eax,%esi
65 jnc Rspecial /* jump if s_ptr >= res_ptr + size */ 65 jnc Rspecial /* jump if s_ptr >= res_ptr + size */
66 66
67Rnormal: 67Rnormal:
68 movl (%esi),%edx 68 movl (%esi),%edx
69 addl $4,%esi 69 addl $4,%esi
70 xorl %eax,%eax 70 xorl %eax,%eax
71 shrdl %cl,%edx,%eax /* compute carry limb */ 71 shrdl %cl,%edx,%eax /* compute carry limb */
72 pushl %eax /* push carry limb onto stack */ 72 pushl %eax /* push carry limb onto stack */
73 73
74 decl %ebp 74 decl %ebp
75 pushl %ebp 75 pushl %ebp
76 shrl $3,%ebp 76 shrl $3,%ebp
77 jz Rend 77 jz Rend
78 78
79 movl (%edi),%eax /* fetch destination cache line */ 79 movl (%edi),%eax /* fetch destination cache line */
80 80
81 ALIGN (2) 81 ALIGN (2)
82Roop: movl 28(%edi),%eax /* fetch destination cache line */ 82Roop: movl 28(%edi),%eax /* fetch destination cache line */
83 movl %edx,%ebx 83 movl %edx,%ebx
84 84
85 movl (%esi),%eax 85 movl (%esi),%eax
86 movl 4(%esi),%edx 86 movl 4(%esi),%edx
87 shrdl %cl,%eax,%ebx 87 shrdl %cl,%eax,%ebx
88 shrdl %cl,%edx,%eax 88 shrdl %cl,%edx,%eax
89 movl %ebx,(%edi) 89 movl %ebx,(%edi)
90 movl %eax,4(%edi) 90 movl %eax,4(%edi)
91 91
92 movl 8(%esi),%ebx 92 movl 8(%esi),%ebx
93 movl 12(%esi),%eax 93 movl 12(%esi),%eax
94 shrdl %cl,%ebx,%edx 94 shrdl %cl,%ebx,%edx
95 shrdl %cl,%eax,%ebx 95 shrdl %cl,%eax,%ebx
96 movl %edx,8(%edi) 96 movl %edx,8(%edi)
97 movl %ebx,12(%edi) 97 movl %ebx,12(%edi)
98 98
99 movl 16(%esi),%edx 99 movl 16(%esi),%edx
100 movl 20(%esi),%ebx 100 movl 20(%esi),%ebx
101 shrdl %cl,%edx,%eax 101 shrdl %cl,%edx,%eax
102 shrdl %cl,%ebx,%edx 102 shrdl %cl,%ebx,%edx
103 movl %eax,16(%edi) 103 movl %eax,16(%edi)
104 movl %edx,20(%edi) 104 movl %edx,20(%edi)
105 105
106 movl 24(%esi),%eax 106 movl 24(%esi),%eax
107 movl 28(%esi),%edx 107 movl 28(%esi),%edx
108 shrdl %cl,%eax,%ebx 108 shrdl %cl,%eax,%ebx
109 shrdl %cl,%edx,%eax 109 shrdl %cl,%edx,%eax
110 movl %ebx,24(%edi) 110 movl %ebx,24(%edi)
111 movl %eax,28(%edi) 111 movl %eax,28(%edi)
112 112
113 addl $32,%esi 113 addl $32,%esi
114 addl $32,%edi 114 addl $32,%edi
115 decl %ebp 115 decl %ebp
116 jnz Roop 116 jnz Roop
117 117
118Rend: popl %ebp 118Rend: popl %ebp
119 andl $7,%ebp 119 andl $7,%ebp
120 jz Rend2 120 jz Rend2
121Roop2: movl (%esi),%eax 121Roop2: movl (%esi),%eax
122 shrdl %cl,%eax,%edx /* compute result limb */ 122 shrdl %cl,%eax,%edx /* compute result limb */
123 movl %edx,(%edi) 123 movl %edx,(%edi)
124 movl %eax,%edx 124 movl %eax,%edx
125 addl $4,%esi 125 addl $4,%esi
126 addl $4,%edi 126 addl $4,%edi
127 decl %ebp 127 decl %ebp
128 jnz Roop2 128 jnz Roop2
129 129
130Rend2: shrl %cl,%edx /* compute most significant limb */ 130Rend2: shrl %cl,%edx /* compute most significant limb */
131 movl %edx,(%edi) /* store it */ 131 movl %edx,(%edi) /* store it */
132 132
133 popl %eax /* pop carry limb */ 133 popl %eax /* pop carry limb */
134 134
135 popl %ebp 135 popl %ebp
136 popl %ebx 136 popl %ebx
137 popl %esi 137 popl %esi
138 popl %edi 138 popl %edi
139 ret 139 ret
140 140
141/* We loop from least significant end of the arrays, which is only 141/* We loop from least significant end of the arrays, which is only
142 permissable if the source and destination don't overlap, since the 142 permissable if the source and destination don't overlap, since the
143 function is documented to work for overlapping source and destination. 143 function is documented to work for overlapping source and destination.
144*/ 144*/
145 145
146Rspecial: 146Rspecial:
147 leal -4(%edi,%ebp,4),%edi 147 leal -4(%edi,%ebp,4),%edi
148 leal -4(%esi,%ebp,4),%esi 148 leal -4(%esi,%ebp,4),%esi
149 149
150 movl (%esi),%edx 150 movl (%esi),%edx
151 subl $4,%esi 151 subl $4,%esi
152 152
153 decl %ebp 153 decl %ebp
154 pushl %ebp 154 pushl %ebp
155 shrl $3,%ebp 155 shrl $3,%ebp
156 156
157 shrl $1,%edx 157 shrl $1,%edx
158 incl %ebp 158 incl %ebp
159 decl %ebp 159 decl %ebp
160 jz RLend 160 jz RLend
161 161
162 movl (%edi),%eax /* fetch destination cache line */ 162 movl (%edi),%eax /* fetch destination cache line */
163 163
164 ALIGN (2) 164 ALIGN (2)
165RLoop: movl -28(%edi),%eax /* fetch destination cache line */ 165RLoop: movl -28(%edi),%eax /* fetch destination cache line */
166 movl %edx,%ebx 166 movl %edx,%ebx
167 167
168 movl (%esi),%eax 168 movl (%esi),%eax
169 movl -4(%esi),%edx 169 movl -4(%esi),%edx
170 rcrl $1,%eax 170 rcrl $1,%eax
171 movl %ebx,(%edi) 171 movl %ebx,(%edi)
172 rcrl $1,%edx 172 rcrl $1,%edx
173 movl %eax,-4(%edi) 173 movl %eax,-4(%edi)
174 174
175 movl -8(%esi),%ebx 175 movl -8(%esi),%ebx
176 movl -12(%esi),%eax 176 movl -12(%esi),%eax
177 rcrl $1,%ebx 177 rcrl $1,%ebx
178 movl %edx,-8(%edi) 178 movl %edx,-8(%edi)
179 rcrl $1,%eax 179 rcrl $1,%eax
180 movl %ebx,-12(%edi) 180 movl %ebx,-12(%edi)
181 181
182 movl -16(%esi),%edx 182 movl -16(%esi),%edx
183 movl -20(%esi),%ebx 183 movl -20(%esi),%ebx
184 rcrl $1,%edx 184 rcrl $1,%edx
185 movl %eax,-16(%edi) 185 movl %eax,-16(%edi)
186 rcrl $1,%ebx 186 rcrl $1,%ebx
187 movl %edx,-20(%edi) 187 movl %edx,-20(%edi)
188 188
189 movl -24(%esi),%eax 189 movl -24(%esi),%eax
190 movl -28(%esi),%edx 190 movl -28(%esi),%edx
191 rcrl $1,%eax 191 rcrl $1,%eax
192 movl %ebx,-24(%edi) 192 movl %ebx,-24(%edi)
193 rcrl $1,%edx 193 rcrl $1,%edx
194 movl %eax,-28(%edi) 194 movl %eax,-28(%edi)
195 195
196 leal -32(%esi),%esi /* use leal not to clobber carry */ 196 leal -32(%esi),%esi /* use leal not to clobber carry */
197 leal -32(%edi),%edi 197 leal -32(%edi),%edi
198 decl %ebp 198 decl %ebp
199 jnz RLoop 199 jnz RLoop
200 200
201RLend: popl %ebp 201RLend: popl %ebp
202 sbbl %eax,%eax /* save carry in %eax */ 202 sbbl %eax,%eax /* save carry in %eax */
203 andl $7,%ebp 203 andl $7,%ebp
204 jz RLend2 204 jz RLend2
205 addl %eax,%eax /* restore carry from eax */ 205 addl %eax,%eax /* restore carry from eax */
206RLoop2: movl %edx,%ebx 206RLoop2: movl %edx,%ebx
207 movl (%esi),%edx 207 movl (%esi),%edx
208 rcrl $1,%edx 208 rcrl $1,%edx
209 movl %ebx,(%edi) 209 movl %ebx,(%edi)
210 210
211 leal -4(%esi),%esi /* use leal not to clobber carry */ 211 leal -4(%esi),%esi /* use leal not to clobber carry */
212 leal -4(%edi),%edi 212 leal -4(%edi),%edi
213 decl %ebp 213 decl %ebp
214 jnz RLoop2 214 jnz RLoop2
215 215
216 jmp RL1 216 jmp RL1
217RLend2: addl %eax,%eax /* restore carry from eax */ 217RLend2: addl %eax,%eax /* restore carry from eax */
218RL1: movl %edx,(%edi) /* store last limb */ 218RL1: movl %edx,(%edi) /* store last limb */
219 219
220 movl $0,%eax 220 movl $0,%eax
221 rcrl $1,%eax 221 rcrl $1,%eax
222 222
223 popl %ebp 223 popl %ebp
224 popl %ebx 224 popl %ebx
225 popl %esi 225 popl %esi
226 popl %edi 226 popl %edi
227 ret 227 ret
228 228
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-sub1.S
index 4197428..ef2d580 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/i586/mpih-sub1.S
@@ -1,142 +1,142 @@
1/* i80586 sub_n -- Sub two limb vectors of the same length > 0 and store 1/* i80586 sub_n -- Sub 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_sub_n( mpi_ptr_t res_ptr, (sp + 4) 37 * _gcry_mpih_sub_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 43
44.text 44.text
45 ALIGN (3) 45 ALIGN (3)
46 .globl C_SYMBOL_NAME(_gcry_mpih_sub_n) 46 .globl C_SYMBOL_NAME(_gcry_mpih_sub_n)
47C_SYMBOL_NAME(_gcry_mpih_sub_n:) 47C_SYMBOL_NAME(_gcry_mpih_sub_n:)
48 48
49 pushl %edi 49 pushl %edi
50 pushl %esi 50 pushl %esi
51 pushl %ebx 51 pushl %ebx
52 pushl %ebp 52 pushl %ebp
53 53
54 movl 20(%esp),%edi /* res_ptr */ 54 movl 20(%esp),%edi /* res_ptr */
55 movl 24(%esp),%esi /* s1_ptr */ 55 movl 24(%esp),%esi /* s1_ptr */
56 movl 28(%esp),%ebp /* s2_ptr */ 56 movl 28(%esp),%ebp /* s2_ptr */
57 movl 32(%esp),%ecx /* size */ 57 movl 32(%esp),%ecx /* size */
58 58
59 movl (%ebp),%ebx 59 movl (%ebp),%ebx
60 60
61 decl %ecx 61 decl %ecx
62 movl %ecx,%edx 62 movl %ecx,%edx
63 shrl $3,%ecx 63 shrl $3,%ecx
64 andl $7,%edx 64 andl $7,%edx
65 testl %ecx,%ecx /* zero carry flag */ 65 testl %ecx,%ecx /* zero carry flag */
66 jz Lend 66 jz Lend
67 pushl %edx 67 pushl %edx
68 68
69 ALIGN (3) 69 ALIGN (3)
70Loop: movl 28(%edi),%eax /* fetch destination cache line */ 70Loop: movl 28(%edi),%eax /* fetch destination cache line */
71 leal 32(%edi),%edi 71 leal 32(%edi),%edi
72 72
73L1: movl (%esi),%eax 73L1: movl (%esi),%eax
74 movl 4(%esi),%edx 74 movl 4(%esi),%edx
75 sbbl %ebx,%eax 75 sbbl %ebx,%eax
76 movl 4(%ebp),%ebx 76 movl 4(%ebp),%ebx
77 sbbl %ebx,%edx 77 sbbl %ebx,%edx
78 movl 8(%ebp),%ebx 78 movl 8(%ebp),%ebx
79 movl %eax,-32(%edi) 79 movl %eax,-32(%edi)
80 movl %edx,-28(%edi) 80 movl %edx,-28(%edi)
81 81
82L2: movl 8(%esi),%eax 82L2: movl 8(%esi),%eax
83 movl 12(%esi),%edx 83 movl 12(%esi),%edx
84 sbbl %ebx,%eax 84 sbbl %ebx,%eax
85 movl 12(%ebp),%ebx 85 movl 12(%ebp),%ebx
86 sbbl %ebx,%edx 86 sbbl %ebx,%edx
87 movl 16(%ebp),%ebx 87 movl 16(%ebp),%ebx
88 movl %eax,-24(%edi) 88 movl %eax,-24(%edi)
89 movl %edx,-20(%edi) 89 movl %edx,-20(%edi)
90 90
91L3: movl 16(%esi),%eax 91L3: movl 16(%esi),%eax
92 movl 20(%esi),%edx 92 movl 20(%esi),%edx
93 sbbl %ebx,%eax 93 sbbl %ebx,%eax
94 movl 20(%ebp),%ebx 94 movl 20(%ebp),%ebx
95 sbbl %ebx,%edx 95 sbbl %ebx,%edx
96 movl 24(%ebp),%ebx 96 movl 24(%ebp),%ebx
97 movl %eax,-16(%edi) 97 movl %eax,-16(%edi)
98 movl %edx,-12(%edi) 98 movl %edx,-12(%edi)
99 99
100L4: movl 24(%esi),%eax 100L4: movl 24(%esi),%eax
101 movl 28(%esi),%edx 101 movl 28(%esi),%edx
102 sbbl %ebx,%eax 102 sbbl %ebx,%eax
103 movl 28(%ebp),%ebx 103 movl 28(%ebp),%ebx
104 sbbl %ebx,%edx 104 sbbl %ebx,%edx
105 movl 32(%ebp),%ebx 105 movl 32(%ebp),%ebx
106 movl %eax,-8(%edi) 106 movl %eax,-8(%edi)
107 movl %edx,-4(%edi) 107 movl %edx,-4(%edi)
108 108
109 leal 32(%esi),%esi 109 leal 32(%esi),%esi
110 leal 32(%ebp),%ebp 110 leal 32(%ebp),%ebp
111 decl %ecx 111 decl %ecx
112 jnz Loop 112 jnz Loop
113 113
114 popl %edx 114 popl %edx
115Lend: 115Lend:
116 decl %edx /* test %edx w/o clobbering carry */ 116 decl %edx /* test %edx w/o clobbering carry */
117 js Lend2 117 js Lend2
118 incl %edx 118 incl %edx
119Loop2: 119Loop2:
120 leal 4(%edi),%edi 120 leal 4(%edi),%edi
121 movl (%esi),%eax 121 movl (%esi),%eax
122 sbbl %ebx,%eax 122 sbbl %ebx,%eax
123 movl 4(%ebp),%ebx 123 movl 4(%ebp),%ebx
124 movl %eax,-4(%edi) 124 movl %eax,-4(%edi)
125 leal 4(%esi),%esi 125 leal 4(%esi),%esi
126 leal 4(%ebp),%ebp 126 leal 4(%ebp),%ebp
127 decl %edx 127 decl %edx
128 jnz Loop2 128 jnz Loop2
129Lend2: 129Lend2:
130 movl (%esi),%eax 130 movl (%esi),%eax
131 sbbl %ebx,%eax 131 sbbl %ebx,%eax
132 movl %eax,(%edi) 132 movl %eax,(%edi)
133 133
134 sbbl %eax,%eax 134 sbbl %eax,%eax
135 negl %eax 135 negl %eax
136 136
137 popl %ebp 137 popl %ebp
138 popl %ebx 138 popl %ebx
139 popl %esi 139 popl %esi
140 popl %edi 140 popl %edi
141 ret 141 ret
142 142
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/longlong.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/longlong.h
index ed297f4..34bd50c 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/longlong.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/longlong.h
@@ -1,1561 +1,1561 @@
1/* longlong.h -- definitions for mixed size 32/64 bit arithmetic. 1/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
2 Note: I added some stuff for use with gnupg 2 Note: I added some stuff for use with gnupg
3 3
4Copyright (C) 1991, 1992, 1993, 1994, 1996, 1998, 4Copyright (C) 1991, 1992, 1993, 1994, 1996, 1998,
5 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 5 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
6 6
7This file is free software; you can redistribute it and/or modify 7This file is free software; you can redistribute it and/or modify
8it under the terms of the GNU Lesser General Public License as published by 8it under the terms of the GNU Lesser General Public License as published by
9the Free Software Foundation; either version 2.1 of the License, or (at your 9the Free Software Foundation; either version 2.1 of the License, or (at your
10option) any later version. 10option) any later version.
11 11
12This file is distributed in the hope that it will be useful, but 12This file is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 14or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15License for more details. 15License for more details.
16 16
17You should have received a copy of the GNU Library General Public License 17You should have received a copy of the GNU Library General Public License
18along with this file; see the file COPYING.LIB. If not, write to 18along with this file; see the file COPYING.LIB. If not, write to
19the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 19the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20MA 02111-1307, USA. */ 20MA 02111-1307, USA. */
21 21
22/* You have to define the following before including this file: 22/* You have to define the following before including this file:
23 23
24 UWtype -- An unsigned type, default type for operations (typically a "word") 24 UWtype -- An unsigned type, default type for operations (typically a "word")
25 UHWtype -- An unsigned type, at least half the size of UWtype. 25 UHWtype -- An unsigned type, at least half the size of UWtype.
26 UDWtype -- An unsigned type, at least twice as large a UWtype 26 UDWtype -- An unsigned type, at least twice as large a UWtype
27 W_TYPE_SIZE -- size in bits of UWtype 27 W_TYPE_SIZE -- size in bits of UWtype
28 28
29 SItype, USItype -- Signed and unsigned 32 bit types. 29 SItype, USItype -- Signed and unsigned 32 bit types.
30 DItype, UDItype -- Signed and unsigned 64 bit types. 30 DItype, UDItype -- Signed and unsigned 64 bit types.
31 31
32 On a 32 bit machine UWtype should typically be USItype; 32 On a 32 bit machine UWtype should typically be USItype;
33 on a 64 bit machine, UWtype should typically be UDItype. 33 on a 64 bit machine, UWtype should typically be UDItype.
34*/ 34*/
35 35
36#define __BITS4 (W_TYPE_SIZE / 4) 36#define __BITS4 (W_TYPE_SIZE / 4)
37#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2)) 37#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2))
38#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1)) 38#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1))
39#define __ll_highpart(t) ((UWtype) (t) >> (W_TYPE_SIZE / 2)) 39#define __ll_highpart(t) ((UWtype) (t) >> (W_TYPE_SIZE / 2))
40 40
41/* This is used to make sure no undesirable sharing between different libraries 41/* This is used to make sure no undesirable sharing between different libraries
42 that use this file takes place. */ 42 that use this file takes place. */
43#ifndef __MPN 43#ifndef __MPN
44#define __MPN(x) __##x 44#define __MPN(x) __##x
45#endif 45#endif
46 46
47/* Define auxiliary asm macros. 47/* Define auxiliary asm macros.
48 48
49 1) umul_ppmm(high_prod, low_prod, multipler, multiplicand) multiplies two 49 1) umul_ppmm(high_prod, low_prod, multipler, multiplicand) multiplies two
50 UWtype integers MULTIPLER and MULTIPLICAND, and generates a two UWtype 50 UWtype integers MULTIPLER and MULTIPLICAND, and generates a two UWtype
51 word product in HIGH_PROD and LOW_PROD. 51 word product in HIGH_PROD and LOW_PROD.
52 52
53 2) __umulsidi3(a,b) multiplies two UWtype integers A and B, and returns a 53 2) __umulsidi3(a,b) multiplies two UWtype integers A and B, and returns a
54 UDWtype product. This is just a variant of umul_ppmm. 54 UDWtype product. This is just a variant of umul_ppmm.
55 55
56 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator, 56 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
57 denominator) divides a UDWtype, composed by the UWtype integers 57 denominator) divides a UDWtype, composed by the UWtype integers
58 HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and places the quotient 58 HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and places the quotient
59 in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less 59 in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less
60 than DENOMINATOR for correct operation. If, in addition, the most 60 than DENOMINATOR for correct operation. If, in addition, the most
61 significant bit of DENOMINATOR must be 1, then the pre-processor symbol 61 significant bit of DENOMINATOR must be 1, then the pre-processor symbol
62 UDIV_NEEDS_NORMALIZATION is defined to 1. 62 UDIV_NEEDS_NORMALIZATION is defined to 1.
63 63
64 4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator, 64 4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
65 denominator). Like udiv_qrnnd but the numbers are signed. The quotient 65 denominator). Like udiv_qrnnd but the numbers are signed. The quotient
66 is rounded towards 0. 66 is rounded towards 0.
67 67
68 5) count_leading_zeros(count, x) counts the number of zero-bits from the 68 5) count_leading_zeros(count, x) counts the number of zero-bits from the
69 msb to the first non-zero bit in the UWtype X. This is the number of 69 msb to the first non-zero bit in the UWtype X. This is the number of
70 steps X needs to be shifted left to set the msb. Undefined for X == 0, 70 steps X needs to be shifted left to set the msb. Undefined for X == 0,
71 unless the symbol COUNT_LEADING_ZEROS_0 is defined to some value. 71 unless the symbol COUNT_LEADING_ZEROS_0 is defined to some value.
72 72
73 6) count_trailing_zeros(count, x) like count_leading_zeros, but counts 73 6) count_trailing_zeros(count, x) like count_leading_zeros, but counts
74 from the least significant end. 74 from the least significant end.
75 75
76 7) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1, 76 7) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1,
77 high_addend_2, low_addend_2) adds two UWtype integers, composed by 77 high_addend_2, low_addend_2) adds two UWtype integers, composed by
78 HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and LOW_ADDEND_2 78 HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and LOW_ADDEND_2
79 respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow 79 respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow
80 (i.e. carry out) is not stored anywhere, and is lost. 80 (i.e. carry out) is not stored anywhere, and is lost.
81 81
82 8) sub_ddmmss(high_difference, low_difference, high_minuend, low_minuend, 82 8) sub_ddmmss(high_difference, low_difference, high_minuend, low_minuend,
83 high_subtrahend, low_subtrahend) subtracts two two-word UWtype integers, 83 high_subtrahend, low_subtrahend) subtracts two two-word UWtype integers,
84 composed by HIGH_MINUEND_1 and LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and 84 composed by HIGH_MINUEND_1 and LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and
85 LOW_SUBTRAHEND_2 respectively. The result is placed in HIGH_DIFFERENCE 85 LOW_SUBTRAHEND_2 respectively. The result is placed in HIGH_DIFFERENCE
86 and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere, 86 and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere,
87 and is lost. 87 and is lost.
88 88
89 If any of these macros are left undefined for a particular CPU, 89 If any of these macros are left undefined for a particular CPU,
90 C macros are used. */ 90 C macros are used. */
91 91
92/* The CPUs come in alphabetical order below. 92/* The CPUs come in alphabetical order below.
93 93
94 Please add support for more CPUs here, or improve the current support 94 Please add support for more CPUs here, or improve the current support
95 for the CPUs below! */ 95 for the CPUs below! */
96 96
97#ifdef __riscos__ 97#ifdef __riscos__
98#pragma continue_after_hash_error 98#pragma continue_after_hash_error
99#else /* !__riscos__ */ 99#else /* !__riscos__ */
100#if defined (__GNUC__) && !defined (NO_ASM) 100#if defined (__GNUC__) && !defined (NO_ASM)
101 101
102/* We sometimes need to clobber "cc" with gcc2, but that would not be 102/* We sometimes need to clobber "cc" with gcc2, but that would not be
103 understood by gcc1. Use cpp to avoid major code duplication. */ 103 understood by gcc1. Use cpp to avoid major code duplication. */
104#if __GNUC__ < 2 104#if __GNUC__ < 2
105#define __CLOBBER_CC 105#define __CLOBBER_CC
106#define __AND_CLOBBER_CC 106#define __AND_CLOBBER_CC
107#else /* __GNUC__ >= 2 */ 107#else /* __GNUC__ >= 2 */
108#define __CLOBBER_CC : "cc" 108#define __CLOBBER_CC : "cc"
109#define __AND_CLOBBER_CC , "cc" 109#define __AND_CLOBBER_CC , "cc"
110#endif /* __GNUC__ < 2 */ 110#endif /* __GNUC__ < 2 */
111 111
112 112
113/*************************************** 113/***************************************
114 ************** A29K ***************** 114 ************** A29K *****************
115 ***************************************/ 115 ***************************************/
116#if (defined (__a29k__) || defined (_AM29K)) && W_TYPE_SIZE == 32 116#if (defined (__a29k__) || defined (_AM29K)) && W_TYPE_SIZE == 32
117#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 117#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
118 __asm__ ("add %1,%4,%5\n" \ 118 __asm__ ("add %1,%4,%5\n" \
119 "addc %0,%2,%3" \ 119 "addc %0,%2,%3" \
120 : "=r" ((USItype)(sh)), \ 120 : "=r" ((USItype)(sh)), \
121 "=&r" ((USItype)(sl)) \ 121 "=&r" ((USItype)(sl)) \
122 : "%r" ((USItype)(ah)), \ 122 : "%r" ((USItype)(ah)), \
123 "rI" ((USItype)(bh)), \ 123 "rI" ((USItype)(bh)), \
124 "%r" ((USItype)(al)), \ 124 "%r" ((USItype)(al)), \
125 "rI" ((USItype)(bl))) 125 "rI" ((USItype)(bl)))
126#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 126#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
127 __asm__ ("sub %1,%4,%5\n" \ 127 __asm__ ("sub %1,%4,%5\n" \
128 "subc %0,%2,%3" \ 128 "subc %0,%2,%3" \
129 : "=r" ((USItype)(sh)), \ 129 : "=r" ((USItype)(sh)), \
130 "=&r" ((USItype)(sl)) \ 130 "=&r" ((USItype)(sl)) \
131 : "r" ((USItype)(ah)), \ 131 : "r" ((USItype)(ah)), \
132 "rI" ((USItype)(bh)), \ 132 "rI" ((USItype)(bh)), \
133 "r" ((USItype)(al)), \ 133 "r" ((USItype)(al)), \
134 "rI" ((USItype)(bl))) 134 "rI" ((USItype)(bl)))
135#define umul_ppmm(xh, xl, m0, m1) \ 135#define umul_ppmm(xh, xl, m0, m1) \
136 do { \ 136 do { \
137 USItype __m0 = (m0), __m1 = (m1); \ 137 USItype __m0 = (m0), __m1 = (m1); \
138 __asm__ ("multiplu %0,%1,%2" \ 138 __asm__ ("multiplu %0,%1,%2" \
139 : "=r" ((USItype)(xl)) \ 139 : "=r" ((USItype)(xl)) \
140 : "r" (__m0), \ 140 : "r" (__m0), \
141 "r" (__m1)); \ 141 "r" (__m1)); \
142 __asm__ ("multmu %0,%1,%2" \ 142 __asm__ ("multmu %0,%1,%2" \
143 : "=r" ((USItype)(xh)) \ 143 : "=r" ((USItype)(xh)) \
144 : "r" (__m0), \ 144 : "r" (__m0), \
145 "r" (__m1)); \ 145 "r" (__m1)); \
146 } while (0) 146 } while (0)
147#define udiv_qrnnd(q, r, n1, n0, d) \ 147#define udiv_qrnnd(q, r, n1, n0, d) \
148 __asm__ ("dividu %0,%3,%4" \ 148 __asm__ ("dividu %0,%3,%4" \
149 : "=r" ((USItype)(q)), \ 149 : "=r" ((USItype)(q)), \
150 "=q" ((USItype)(r)) \ 150 "=q" ((USItype)(r)) \
151 : "1" ((USItype)(n1)), \ 151 : "1" ((USItype)(n1)), \
152 "r" ((USItype)(n0)), \ 152 "r" ((USItype)(n0)), \
153 "r" ((USItype)(d))) 153 "r" ((USItype)(d)))
154#define count_leading_zeros(count, x) \ 154#define count_leading_zeros(count, x) \
155 __asm__ ("clz %0,%1" \ 155 __asm__ ("clz %0,%1" \
156 : "=r" ((USItype)(count)) \ 156 : "=r" ((USItype)(count)) \
157 : "r" ((USItype)(x))) 157 : "r" ((USItype)(x)))
158#define COUNT_LEADING_ZEROS_0 32 158#define COUNT_LEADING_ZEROS_0 32
159#endif /* __a29k__ */ 159#endif /* __a29k__ */
160 160
161 161
162#if defined (__alpha) && W_TYPE_SIZE == 64 162#if defined (__alpha) && W_TYPE_SIZE == 64
163#define umul_ppmm(ph, pl, m0, m1) \ 163#define umul_ppmm(ph, pl, m0, m1) \
164 do { \ 164 do { \
165 UDItype __m0 = (m0), __m1 = (m1); \ 165 UDItype __m0 = (m0), __m1 = (m1); \
166 __asm__ ("umulh %r1,%2,%0" \ 166 __asm__ ("umulh %r1,%2,%0" \
167 : "=r" ((UDItype) ph) \ 167 : "=r" ((UDItype) ph) \
168 : "%rJ" (__m0), \ 168 : "%rJ" (__m0), \
169 "rI" (__m1)); \ 169 "rI" (__m1)); \
170 (pl) = __m0 * __m1; \ 170 (pl) = __m0 * __m1; \
171 } while (0) 171 } while (0)
172#define UMUL_TIME 46 172#define UMUL_TIME 46
173#ifndef LONGLONG_STANDALONE 173#ifndef LONGLONG_STANDALONE
174#define udiv_qrnnd(q, r, n1, n0, d) \ 174#define udiv_qrnnd(q, r, n1, n0, d) \
175 do { UDItype __r; \ 175 do { UDItype __r; \
176 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ 176 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
177 (r) = __r; \ 177 (r) = __r; \
178 } while (0) 178 } while (0)
179extern UDItype __udiv_qrnnd (); 179extern UDItype __udiv_qrnnd ();
180#define UDIV_TIME 220 180#define UDIV_TIME 220
181#endif /* LONGLONG_STANDALONE */ 181#endif /* LONGLONG_STANDALONE */
182#endif /* __alpha */ 182#endif /* __alpha */
183 183
184/*************************************** 184/***************************************
185 ************** ARM ****************** 185 ************** ARM ******************
186 ***************************************/ 186 ***************************************/
187#if defined (__arm__) && W_TYPE_SIZE == 32 187#if defined (__arm__) && W_TYPE_SIZE == 32
188#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 188#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
189 __asm__ ("adds %1, %4, %5\n" \ 189 __asm__ ("adds %1, %4, %5\n" \
190 "adc %0, %2, %3" \ 190 "adc %0, %2, %3" \
191 : "=r" ((USItype)(sh)), \ 191 : "=r" ((USItype)(sh)), \
192 "=&r" ((USItype)(sl)) \ 192 "=&r" ((USItype)(sl)) \
193 : "%r" ((USItype)(ah)), \ 193 : "%r" ((USItype)(ah)), \
194 "rI" ((USItype)(bh)), \ 194 "rI" ((USItype)(bh)), \
195 "%r" ((USItype)(al)), \ 195 "%r" ((USItype)(al)), \
196 "rI" ((USItype)(bl))) 196 "rI" ((USItype)(bl)))
197#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 197#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
198 __asm__ ("subs %1, %4, %5\n" \ 198 __asm__ ("subs %1, %4, %5\n" \
199 "sbc %0, %2, %3" \ 199 "sbc %0, %2, %3" \
200 : "=r" ((USItype)(sh)), \ 200 : "=r" ((USItype)(sh)), \
201 "=&r" ((USItype)(sl)) \ 201 "=&r" ((USItype)(sl)) \
202 : "r" ((USItype)(ah)), \ 202 : "r" ((USItype)(ah)), \
203 "rI" ((USItype)(bh)), \ 203 "rI" ((USItype)(bh)), \
204 "r" ((USItype)(al)), \ 204 "r" ((USItype)(al)), \
205 "rI" ((USItype)(bl))) 205 "rI" ((USItype)(bl)))
206#if defined __ARM_ARCH_2__ || defined __ARM_ARCH_3__ 206#if defined __ARM_ARCH_2__ || defined __ARM_ARCH_3__
207#define umul_ppmm(xh, xl, a, b) \ 207#define umul_ppmm(xh, xl, a, b) \
208 __asm__ ("%@ Inlined umul_ppmm\n" \ 208 __asm__ ("%@ Inlined umul_ppmm\n" \
209 "mov %|r0, %2, lsr #16 @ AAAA\n" \ 209 "mov %|r0, %2, lsr #16 @ AAAA\n" \
210 "mov %|r2, %3, lsr #16 @ BBBB\n" \ 210 "mov %|r2, %3, lsr #16 @ BBBB\n" \
211 "bic %|r1, %2, %|r0, lsl #16 @ aaaa\n" \ 211 "bic %|r1, %2, %|r0, lsl #16 @ aaaa\n" \
212 "bic %0, %3, %|r2, lsl #16 @ bbbb\n" \ 212 "bic %0, %3, %|r2, lsl #16 @ bbbb\n" \
213 "mul %1, %|r1, %|r2 @ aaaa * BBBB\n" \ 213 "mul %1, %|r1, %|r2 @ aaaa * BBBB\n" \
214 "mul %|r2, %|r0, %|r2 @ AAAA * BBBB\n" \ 214 "mul %|r2, %|r0, %|r2 @ AAAA * BBBB\n" \
215 "mul %|r1, %0, %|r1 @ aaaa * bbbb\n" \ 215 "mul %|r1, %0, %|r1 @ aaaa * bbbb\n" \
216 "mul %0, %|r0, %0 @ AAAA * bbbb\n" \ 216 "mul %0, %|r0, %0 @ AAAA * bbbb\n" \
217 "adds %|r0, %1, %0 @ central sum\n" \ 217 "adds %|r0, %1, %0 @ central sum\n" \
218 "addcs %|r2, %|r2, #65536\n" \ 218 "addcs %|r2, %|r2, #65536\n" \
219 "adds %1, %|r1, %|r0, lsl #16\n" \ 219 "adds %1, %|r1, %|r0, lsl #16\n" \
220 "adc %0, %|r2, %|r0, lsr #16" \ 220 "adc %0, %|r2, %|r0, lsr #16" \
221 : "=&r" ((USItype)(xh)), \ 221 : "=&r" ((USItype)(xh)), \
222 "=r" ((USItype)(xl)) \ 222 "=r" ((USItype)(xl)) \
223 : "r" ((USItype)(a)), \ 223 : "r" ((USItype)(a)), \
224 "r" ((USItype)(b)) \ 224 "r" ((USItype)(b)) \
225 : "r0", "r1", "r2") 225 : "r0", "r1", "r2")
226#else 226#else
227#define umul_ppmm(xh, xl, a, b) \ 227#define umul_ppmm(xh, xl, a, b) \
228 __asm__ ("%@ Inlined umul_ppmm\n" \ 228 __asm__ ("%@ Inlined umul_ppmm\n" \
229 "umull %r1, %r0, %r2, %r3" \ 229 "umull %r1, %r0, %r2, %r3" \
230 : "=&r" ((USItype)(xh)), \ 230 : "=&r" ((USItype)(xh)), \
231 "=r" ((USItype)(xl)) \ 231 "=r" ((USItype)(xl)) \
232 : "r" ((USItype)(a)), \ 232 : "r" ((USItype)(a)), \
233 "r" ((USItype)(b)) \ 233 "r" ((USItype)(b)) \
234 : "r0", "r1") 234 : "r0", "r1")
235#endif 235#endif
236#define UMUL_TIME 20 236#define UMUL_TIME 20
237#define UDIV_TIME 100 237#define UDIV_TIME 100
238#endif /* __arm__ */ 238#endif /* __arm__ */
239 239
240/*************************************** 240/***************************************
241 ************** CLIPPER ************** 241 ************** CLIPPER **************
242 ***************************************/ 242 ***************************************/
243#if defined (__clipper__) && W_TYPE_SIZE == 32 243#if defined (__clipper__) && W_TYPE_SIZE == 32
244#define umul_ppmm(w1, w0, u, v) \ 244#define umul_ppmm(w1, w0, u, v) \
245 ({union {UDItype __ll; \ 245 ({union {UDItype __ll; \
246 struct {USItype __l, __h;} __i; \ 246 struct {USItype __l, __h;} __i; \
247 } __xx; \ 247 } __xx; \
248 __asm__ ("mulwux %2,%0" \ 248 __asm__ ("mulwux %2,%0" \
249 : "=r" (__xx.__ll) \ 249 : "=r" (__xx.__ll) \
250 : "%0" ((USItype)(u)), \ 250 : "%0" ((USItype)(u)), \
251 "r" ((USItype)(v))); \ 251 "r" ((USItype)(v))); \
252 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;}) 252 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
253#define smul_ppmm(w1, w0, u, v) \ 253#define smul_ppmm(w1, w0, u, v) \
254 ({union {DItype __ll; \ 254 ({union {DItype __ll; \
255 struct {SItype __l, __h;} __i; \ 255 struct {SItype __l, __h;} __i; \
256 } __xx; \ 256 } __xx; \
257 __asm__ ("mulwx %2,%0" \ 257 __asm__ ("mulwx %2,%0" \
258 : "=r" (__xx.__ll) \ 258 : "=r" (__xx.__ll) \
259 : "%0" ((SItype)(u)), \ 259 : "%0" ((SItype)(u)), \
260 "r" ((SItype)(v))); \ 260 "r" ((SItype)(v))); \
261 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;}) 261 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
262#define __umulsidi3(u, v) \ 262#define __umulsidi3(u, v) \
263 ({UDItype __w; \ 263 ({UDItype __w; \
264 __asm__ ("mulwux %2,%0" \ 264 __asm__ ("mulwux %2,%0" \
265 : "=r" (__w) \ 265 : "=r" (__w) \
266 : "%0" ((USItype)(u)), \ 266 : "%0" ((USItype)(u)), \
267 "r" ((USItype)(v))); \ 267 "r" ((USItype)(v))); \
268 __w; }) 268 __w; })
269#endif /* __clipper__ */ 269#endif /* __clipper__ */
270 270
271 271
272/*************************************** 272/***************************************
273 ************** GMICRO *************** 273 ************** GMICRO ***************
274 ***************************************/ 274 ***************************************/
275#if defined (__gmicro__) && W_TYPE_SIZE == 32 275#if defined (__gmicro__) && W_TYPE_SIZE == 32
276#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 276#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
277 __asm__ ("add.w %5,%1\n" \ 277 __asm__ ("add.w %5,%1\n" \
278 "addx %3,%0" \ 278 "addx %3,%0" \
279 : "=g" ((USItype)(sh)), \ 279 : "=g" ((USItype)(sh)), \
280 "=&g" ((USItype)(sl)) \ 280 "=&g" ((USItype)(sl)) \
281 : "%0" ((USItype)(ah)), \ 281 : "%0" ((USItype)(ah)), \
282 "g" ((USItype)(bh)), \ 282 "g" ((USItype)(bh)), \
283 "%1" ((USItype)(al)), \ 283 "%1" ((USItype)(al)), \
284 "g" ((USItype)(bl))) 284 "g" ((USItype)(bl)))
285#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 285#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
286 __asm__ ("sub.w %5,%1\n" \ 286 __asm__ ("sub.w %5,%1\n" \
287 "subx %3,%0" \ 287 "subx %3,%0" \
288 : "=g" ((USItype)(sh)), \ 288 : "=g" ((USItype)(sh)), \
289 "=&g" ((USItype)(sl)) \ 289 "=&g" ((USItype)(sl)) \
290 : "0" ((USItype)(ah)), \ 290 : "0" ((USItype)(ah)), \
291 "g" ((USItype)(bh)), \ 291 "g" ((USItype)(bh)), \
292 "1" ((USItype)(al)), \ 292 "1" ((USItype)(al)), \
293 "g" ((USItype)(bl))) 293 "g" ((USItype)(bl)))
294#define umul_ppmm(ph, pl, m0, m1) \ 294#define umul_ppmm(ph, pl, m0, m1) \
295 __asm__ ("mulx %3,%0,%1" \ 295 __asm__ ("mulx %3,%0,%1" \
296 : "=g" ((USItype)(ph)), \ 296 : "=g" ((USItype)(ph)), \
297 "=r" ((USItype)(pl)) \ 297 "=r" ((USItype)(pl)) \
298 : "%0" ((USItype)(m0)), \ 298 : "%0" ((USItype)(m0)), \
299 "g" ((USItype)(m1))) 299 "g" ((USItype)(m1)))
300#define udiv_qrnnd(q, r, nh, nl, d) \ 300#define udiv_qrnnd(q, r, nh, nl, d) \
301 __asm__ ("divx %4,%0,%1" \ 301 __asm__ ("divx %4,%0,%1" \
302 : "=g" ((USItype)(q)), \ 302 : "=g" ((USItype)(q)), \
303 "=r" ((USItype)(r)) \ 303 "=r" ((USItype)(r)) \
304 : "1" ((USItype)(nh)), \ 304 : "1" ((USItype)(nh)), \
305 "0" ((USItype)(nl)), \ 305 "0" ((USItype)(nl)), \
306 "g" ((USItype)(d))) 306 "g" ((USItype)(d)))
307#define count_leading_zeros(count, x) \ 307#define count_leading_zeros(count, x) \
308 __asm__ ("bsch/1 %1,%0" \ 308 __asm__ ("bsch/1 %1,%0" \
309 : "=g" (count) \ 309 : "=g" (count) \
310 : "g" ((USItype)(x)), \ 310 : "g" ((USItype)(x)), \
311 "0" ((USItype)0)) 311 "0" ((USItype)0))
312#endif 312#endif
313 313
314 314
315/*************************************** 315/***************************************
316 ************** HPPA ***************** 316 ************** HPPA *****************
317 ***************************************/ 317 ***************************************/
318#if defined (__hppa) && W_TYPE_SIZE == 32 318#if defined (__hppa) && W_TYPE_SIZE == 32
319#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 319#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
320 __asm__ (" add %4,%5,%1\n" \ 320 __asm__ (" add %4,%5,%1\n" \
321 " addc %2,%3,%0" \ 321 " addc %2,%3,%0" \
322 : "=r" ((USItype)(sh)), \ 322 : "=r" ((USItype)(sh)), \
323 "=&r" ((USItype)(sl)) \ 323 "=&r" ((USItype)(sl)) \
324 : "%rM" ((USItype)(ah)), \ 324 : "%rM" ((USItype)(ah)), \
325 "rM" ((USItype)(bh)), \ 325 "rM" ((USItype)(bh)), \
326 "%rM" ((USItype)(al)), \ 326 "%rM" ((USItype)(al)), \
327 "rM" ((USItype)(bl))) 327 "rM" ((USItype)(bl)))
328#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 328#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
329 __asm__ (" sub %4,%5,%1\n" \ 329 __asm__ (" sub %4,%5,%1\n" \
330 " subb %2,%3,%0" \ 330 " subb %2,%3,%0" \
331 : "=r" ((USItype)(sh)), \ 331 : "=r" ((USItype)(sh)), \
332 "=&r" ((USItype)(sl)) \ 332 "=&r" ((USItype)(sl)) \
333 : "rM" ((USItype)(ah)), \ 333 : "rM" ((USItype)(ah)), \
334 "rM" ((USItype)(bh)), \ 334 "rM" ((USItype)(bh)), \
335 "rM" ((USItype)(al)), \ 335 "rM" ((USItype)(al)), \
336 "rM" ((USItype)(bl))) 336 "rM" ((USItype)(bl)))
337#if defined (_PA_RISC1_1) 337#if defined (_PA_RISC1_1)
338#define umul_ppmm(wh, wl, u, v) \ 338#define umul_ppmm(wh, wl, u, v) \
339 do { \ 339 do { \
340 union {UDItype __ll; \ 340 union {UDItype __ll; \
341 struct {USItype __h, __l;} __i; \ 341 struct {USItype __h, __l;} __i; \
342 } __xx; \ 342 } __xx; \
343 __asm__ (" xmpyu %1,%2,%0" \ 343 __asm__ (" xmpyu %1,%2,%0" \
344 : "=*f" (__xx.__ll) \ 344 : "=*f" (__xx.__ll) \
345 : "*f" ((USItype)(u)), \ 345 : "*f" ((USItype)(u)), \
346 "*f" ((USItype)(v))); \ 346 "*f" ((USItype)(v))); \
347 (wh) = __xx.__i.__h; \ 347 (wh) = __xx.__i.__h; \
348 (wl) = __xx.__i.__l; \ 348 (wl) = __xx.__i.__l; \
349 } while (0) 349 } while (0)
350#define UMUL_TIME 8 350#define UMUL_TIME 8
351#define UDIV_TIME 60 351#define UDIV_TIME 60
352#else 352#else
353#define UMUL_TIME 40 353#define UMUL_TIME 40
354#define UDIV_TIME 80 354#define UDIV_TIME 80
355#endif 355#endif
356#ifndef LONGLONG_STANDALONE 356#ifndef LONGLONG_STANDALONE
357#define udiv_qrnnd(q, r, n1, n0, d) \ 357#define udiv_qrnnd(q, r, n1, n0, d) \
358 do { USItype __r; \ 358 do { USItype __r; \
359 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ 359 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
360 (r) = __r; \ 360 (r) = __r; \
361 } while (0) 361 } while (0)
362extern USItype __udiv_qrnnd (); 362extern USItype __udiv_qrnnd ();
363#endif /* LONGLONG_STANDALONE */ 363#endif /* LONGLONG_STANDALONE */
364#define count_leading_zeros(count, x) \ 364#define count_leading_zeros(count, x) \
365 do { \ 365 do { \
366 USItype __tmp; \ 366 USItype __tmp; \
367 __asm__ ( \ 367 __asm__ ( \
368 " ldi 1,%0 \n" \ 368 " ldi 1,%0 \n" \
369 " extru,= %1,15,16,%%r0 ; Bits 31..16 zero? \n" \ 369 " extru,= %1,15,16,%%r0 ; Bits 31..16 zero? \n" \
370 " extru,tr %1,15,16,%1 ; No. Shift down, skip add.\n" \ 370 " extru,tr %1,15,16,%1 ; No. Shift down, skip add.\n" \
371 " ldo 16(%0),%0 ; Yes. Perform add. \n" \ 371 " ldo 16(%0),%0 ; Yes. Perform add. \n" \
372 " extru,= %1,23,8,%%r0 ; Bits 15..8 zero? \n" \ 372 " extru,= %1,23,8,%%r0 ; Bits 15..8 zero? \n" \
373 " extru,tr %1,23,8,%1 ; No. Shift down, skip add.\n" \ 373 " extru,tr %1,23,8,%1 ; No. Shift down, skip add.\n" \
374 " ldo 8(%0),%0 ; Yes. Perform add. \n" \ 374 " ldo 8(%0),%0 ; Yes. Perform add. \n" \
375 " extru,= %1,27,4,%%r0 ; Bits 7..4 zero? \n" \ 375 " extru,= %1,27,4,%%r0 ; Bits 7..4 zero? \n" \
376 " extru,tr %1,27,4,%1 ; No. Shift down, skip add.\n" \ 376 " extru,tr %1,27,4,%1 ; No. Shift down, skip add.\n" \
377 " ldo 4(%0),%0 ; Yes. Perform add. \n" \ 377 " ldo 4(%0),%0 ; Yes. Perform add. \n" \
378 " extru,= %1,29,2,%%r0 ; Bits 3..2 zero? \n" \ 378 " extru,= %1,29,2,%%r0 ; Bits 3..2 zero? \n" \
379 " extru,tr %1,29,2,%1 ; No. Shift down, skip add.\n" \ 379 " extru,tr %1,29,2,%1 ; No. Shift down, skip add.\n" \
380 " ldo 2(%0),%0 ; Yes. Perform add. \n" \ 380 " ldo 2(%0),%0 ; Yes. Perform add. \n" \
381 " extru %1,30,1,%1 ; Extract bit 1. \n" \ 381 " extru %1,30,1,%1 ; Extract bit 1. \n" \
382 " sub %0,%1,%0 ; Subtract it. " \ 382 " sub %0,%1,%0 ; Subtract it. " \
383 : "=r" (count), "=r" (__tmp) : "1" (x)); \ 383 : "=r" (count), "=r" (__tmp) : "1" (x)); \
384 } while (0) 384 } while (0)
385#endif /* hppa */ 385#endif /* hppa */
386 386
387 387
388/*************************************** 388/***************************************
389 ************** I370 ***************** 389 ************** I370 *****************
390 ***************************************/ 390 ***************************************/
391#if (defined (__i370__) || defined (__mvs__)) && W_TYPE_SIZE == 32 391#if (defined (__i370__) || defined (__mvs__)) && W_TYPE_SIZE == 32
392#define umul_ppmm(xh, xl, m0, m1) \ 392#define umul_ppmm(xh, xl, m0, m1) \
393 do { \ 393 do { \
394 union {UDItype __ll; \ 394 union {UDItype __ll; \
395 struct {USItype __h, __l;} __i; \ 395 struct {USItype __h, __l;} __i; \
396 } __xx; \ 396 } __xx; \
397 USItype __m0 = (m0), __m1 = (m1); \ 397 USItype __m0 = (m0), __m1 = (m1); \
398 __asm__ ("mr %0,%3" \ 398 __asm__ ("mr %0,%3" \
399 : "=r" (__xx.__i.__h), \ 399 : "=r" (__xx.__i.__h), \
400 "=r" (__xx.__i.__l) \ 400 "=r" (__xx.__i.__l) \
401 : "%1" (__m0), \ 401 : "%1" (__m0), \
402 "r" (__m1)); \ 402 "r" (__m1)); \
403 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \ 403 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \
404 (xh) += ((((SItype) __m0 >> 31) & __m1) \ 404 (xh) += ((((SItype) __m0 >> 31) & __m1) \
405 + (((SItype) __m1 >> 31) & __m0)); \ 405 + (((SItype) __m1 >> 31) & __m0)); \
406 } while (0) 406 } while (0)
407#define smul_ppmm(xh, xl, m0, m1) \ 407#define smul_ppmm(xh, xl, m0, m1) \
408 do { \ 408 do { \
409 union {DItype __ll; \ 409 union {DItype __ll; \
410 struct {USItype __h, __l;} __i; \ 410 struct {USItype __h, __l;} __i; \
411 } __xx; \ 411 } __xx; \
412 __asm__ ("mr %0,%3" \ 412 __asm__ ("mr %0,%3" \
413 : "=r" (__xx.__i.__h), \ 413 : "=r" (__xx.__i.__h), \
414 "=r" (__xx.__i.__l) \ 414 "=r" (__xx.__i.__l) \
415 : "%1" (m0), \ 415 : "%1" (m0), \
416 "r" (m1)); \ 416 "r" (m1)); \
417 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \ 417 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \
418 } while (0) 418 } while (0)
419#define sdiv_qrnnd(q, r, n1, n0, d) \ 419#define sdiv_qrnnd(q, r, n1, n0, d) \
420 do { \ 420 do { \
421 union {DItype __ll; \ 421 union {DItype __ll; \
422 struct {USItype __h, __l;} __i; \ 422 struct {USItype __h, __l;} __i; \
423 } __xx; \ 423 } __xx; \
424 __xx.__i.__h = n1; __xx.__i.__l = n0; \ 424 __xx.__i.__h = n1; __xx.__i.__l = n0; \
425 __asm__ ("dr %0,%2" \ 425 __asm__ ("dr %0,%2" \
426 : "=r" (__xx.__ll) \ 426 : "=r" (__xx.__ll) \
427 : "0" (__xx.__ll), "r" (d)); \ 427 : "0" (__xx.__ll), "r" (d)); \
428 (q) = __xx.__i.__l; (r) = __xx.__i.__h; \ 428 (q) = __xx.__i.__l; (r) = __xx.__i.__h; \
429 } while (0) 429 } while (0)
430#endif 430#endif
431 431
432 432
433/*************************************** 433/***************************************
434 ************** I386 ***************** 434 ************** I386 *****************
435 ***************************************/ 435 ***************************************/
436#if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32 436#if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
437#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 437#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
438 __asm__ ("addl %5,%1\n" \ 438 __asm__ ("addl %5,%1\n" \
439 "adcl %3,%0" \ 439 "adcl %3,%0" \
440 : "=r" ((USItype)(sh)), \ 440 : "=r" ((USItype)(sh)), \
441 "=&r" ((USItype)(sl)) \ 441 "=&r" ((USItype)(sl)) \
442 : "%0" ((USItype)(ah)), \ 442 : "%0" ((USItype)(ah)), \
443 "g" ((USItype)(bh)), \ 443 "g" ((USItype)(bh)), \
444 "%1" ((USItype)(al)), \ 444 "%1" ((USItype)(al)), \
445 "g" ((USItype)(bl))) 445 "g" ((USItype)(bl)))
446#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 446#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
447 __asm__ ("subl %5,%1\n" \ 447 __asm__ ("subl %5,%1\n" \
448 "sbbl %3,%0" \ 448 "sbbl %3,%0" \
449 : "=r" ((USItype)(sh)), \ 449 : "=r" ((USItype)(sh)), \
450 "=&r" ((USItype)(sl)) \ 450 "=&r" ((USItype)(sl)) \
451 : "0" ((USItype)(ah)), \ 451 : "0" ((USItype)(ah)), \
452 "g" ((USItype)(bh)), \ 452 "g" ((USItype)(bh)), \
453 "1" ((USItype)(al)), \ 453 "1" ((USItype)(al)), \
454 "g" ((USItype)(bl))) 454 "g" ((USItype)(bl)))
455#define umul_ppmm(w1, w0, u, v) \ 455#define umul_ppmm(w1, w0, u, v) \
456 __asm__ ("mull %3" \ 456 __asm__ ("mull %3" \
457 : "=a" ((USItype)(w0)), \ 457 : "=a" ((USItype)(w0)), \
458 "=d" ((USItype)(w1)) \ 458 "=d" ((USItype)(w1)) \
459 : "%0" ((USItype)(u)), \ 459 : "%0" ((USItype)(u)), \
460 "rm" ((USItype)(v))) 460 "rm" ((USItype)(v)))
461#define udiv_qrnnd(q, r, n1, n0, d) \ 461#define udiv_qrnnd(q, r, n1, n0, d) \
462 __asm__ ("divl %4" \ 462 __asm__ ("divl %4" \
463 : "=a" ((USItype)(q)), \ 463 : "=a" ((USItype)(q)), \
464 "=d" ((USItype)(r)) \ 464 "=d" ((USItype)(r)) \
465 : "0" ((USItype)(n0)), \ 465 : "0" ((USItype)(n0)), \
466 "1" ((USItype)(n1)), \ 466 "1" ((USItype)(n1)), \
467 "rm" ((USItype)(d))) 467 "rm" ((USItype)(d)))
468#define count_leading_zeros(count, x) \ 468#define count_leading_zeros(count, x) \
469 do { \ 469 do { \
470 USItype __cbtmp; \ 470 USItype __cbtmp; \
471 __asm__ ("bsrl %1,%0" \ 471 __asm__ ("bsrl %1,%0" \
472 : "=r" (__cbtmp) : "rm" ((USItype)(x))); \ 472 : "=r" (__cbtmp) : "rm" ((USItype)(x))); \
473 (count) = __cbtmp ^ 31; \ 473 (count) = __cbtmp ^ 31; \
474 } while (0) 474 } while (0)
475#define count_trailing_zeros(count, x) \ 475#define count_trailing_zeros(count, x) \
476 __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x))) 476 __asm__ ("bsfl %1,%0" : "=r" (count) : "rm" ((USItype)(x)))
477#ifndef UMUL_TIME 477#ifndef UMUL_TIME
478#define UMUL_TIME 40 478#define UMUL_TIME 40
479#endif 479#endif
480#ifndef UDIV_TIME 480#ifndef UDIV_TIME
481#define UDIV_TIME 40 481#define UDIV_TIME 40
482#endif 482#endif
483#endif /* 80x86 */ 483#endif /* 80x86 */
484 484
485 485
486/*************************************** 486/***************************************
487 ************** I860 ***************** 487 ************** I860 *****************
488 ***************************************/ 488 ***************************************/
489#if defined (__i860__) && W_TYPE_SIZE == 32 489#if defined (__i860__) && W_TYPE_SIZE == 32
490#define rshift_rhlc(r,h,l,c) \ 490#define rshift_rhlc(r,h,l,c) \
491 __asm__ ("shr %3,r0,r0\n" \ 491 __asm__ ("shr %3,r0,r0\n" \
492 "shrd %1,%2,%0" \ 492 "shrd %1,%2,%0" \
493 "=r" (r) : "r" (h), "r" (l), "rn" (c)) 493 "=r" (r) : "r" (h), "r" (l), "rn" (c))
494#endif /* i860 */ 494#endif /* i860 */
495 495
496/*************************************** 496/***************************************
497 ************** I960 ***************** 497 ************** I960 *****************
498 ***************************************/ 498 ***************************************/
499#if defined (__i960__) && W_TYPE_SIZE == 32 499#if defined (__i960__) && W_TYPE_SIZE == 32
500#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 500#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
501 __asm__ ("cmpo 1,0\n" \ 501 __asm__ ("cmpo 1,0\n" \
502 "addc %5,%4,%1\n" \ 502 "addc %5,%4,%1\n" \
503 "addc %3,%2,%0" \ 503 "addc %3,%2,%0" \
504 : "=r" ((USItype)(sh)), \ 504 : "=r" ((USItype)(sh)), \
505 "=&r" ((USItype)(sl)) \ 505 "=&r" ((USItype)(sl)) \
506 : "%dI" ((USItype)(ah)), \ 506 : "%dI" ((USItype)(ah)), \
507 "dI" ((USItype)(bh)), \ 507 "dI" ((USItype)(bh)), \
508 "%dI" ((USItype)(al)), \ 508 "%dI" ((USItype)(al)), \
509 "dI" ((USItype)(bl))) 509 "dI" ((USItype)(bl)))
510#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 510#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
511 __asm__ ("cmpo 0,0\n" \ 511 __asm__ ("cmpo 0,0\n" \
512 "subc %5,%4,%1\n" \ 512 "subc %5,%4,%1\n" \
513 "subc %3,%2,%0" \ 513 "subc %3,%2,%0" \
514 : "=r" ((USItype)(sh)), \ 514 : "=r" ((USItype)(sh)), \
515 "=&r" ((USItype)(sl)) \ 515 "=&r" ((USItype)(sl)) \
516 : "dI" ((USItype)(ah)), \ 516 : "dI" ((USItype)(ah)), \
517 "dI" ((USItype)(bh)), \ 517 "dI" ((USItype)(bh)), \
518 "dI" ((USItype)(al)), \ 518 "dI" ((USItype)(al)), \
519 "dI" ((USItype)(bl))) 519 "dI" ((USItype)(bl)))
520#define umul_ppmm(w1, w0, u, v) \ 520#define umul_ppmm(w1, w0, u, v) \
521 ({union {UDItype __ll; \ 521 ({union {UDItype __ll; \
522 struct {USItype __l, __h;} __i; \ 522 struct {USItype __l, __h;} __i; \
523 } __xx; \ 523 } __xx; \
524 __asm__ ("emul %2,%1,%0" \ 524 __asm__ ("emul %2,%1,%0" \
525 : "=d" (__xx.__ll) \ 525 : "=d" (__xx.__ll) \
526 : "%dI" ((USItype)(u)), \ 526 : "%dI" ((USItype)(u)), \
527 "dI" ((USItype)(v))); \ 527 "dI" ((USItype)(v))); \
528 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;}) 528 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
529#define __umulsidi3(u, v) \ 529#define __umulsidi3(u, v) \
530 ({UDItype __w; \ 530 ({UDItype __w; \
531 __asm__ ("emul %2,%1,%0" \ 531 __asm__ ("emul %2,%1,%0" \
532 : "=d" (__w) \ 532 : "=d" (__w) \
533 : "%dI" ((USItype)(u)), \ 533 : "%dI" ((USItype)(u)), \
534 "dI" ((USItype)(v))); \ 534 "dI" ((USItype)(v))); \
535 __w; }) 535 __w; })
536#define udiv_qrnnd(q, r, nh, nl, d) \ 536#define udiv_qrnnd(q, r, nh, nl, d) \
537 do { \ 537 do { \
538 union {UDItype __ll; \ 538 union {UDItype __ll; \
539 struct {USItype __l, __h;} __i; \ 539 struct {USItype __l, __h;} __i; \
540 } __nn; \ 540 } __nn; \
541 __nn.__i.__h = (nh); __nn.__i.__l = (nl); \ 541 __nn.__i.__h = (nh); __nn.__i.__l = (nl); \
542 __asm__ ("ediv %d,%n,%0" \ 542 __asm__ ("ediv %d,%n,%0" \
543 : "=d" (__rq.__ll) \ 543 : "=d" (__rq.__ll) \
544 : "dI" (__nn.__ll), \ 544 : "dI" (__nn.__ll), \
545 "dI" ((USItype)(d))); \ 545 "dI" ((USItype)(d))); \
546 (r) = __rq.__i.__l; (q) = __rq.__i.__h; \ 546 (r) = __rq.__i.__l; (q) = __rq.__i.__h; \
547 } while (0) 547 } while (0)
548#define count_leading_zeros(count, x) \ 548#define count_leading_zeros(count, x) \
549 do { \ 549 do { \
550 USItype __cbtmp; \ 550 USItype __cbtmp; \
551 __asm__ ("scanbit %1,%0" \ 551 __asm__ ("scanbit %1,%0" \
552 : "=r" (__cbtmp) \ 552 : "=r" (__cbtmp) \
553 : "r" ((USItype)(x))); \ 553 : "r" ((USItype)(x))); \
554 (count) = __cbtmp ^ 31; \ 554 (count) = __cbtmp ^ 31; \
555 } while (0) 555 } while (0)
556#define COUNT_LEADING_ZEROS_0 (-32) /* sic */ 556#define COUNT_LEADING_ZEROS_0 (-32) /* sic */
557#if defined (__i960mx) /* what is the proper symbol to test??? */ 557#if defined (__i960mx) /* what is the proper symbol to test??? */
558#define rshift_rhlc(r,h,l,c) \ 558#define rshift_rhlc(r,h,l,c) \
559 do { \ 559 do { \
560 union {UDItype __ll; \ 560 union {UDItype __ll; \
561 struct {USItype __l, __h;} __i; \ 561 struct {USItype __l, __h;} __i; \
562 } __nn; \ 562 } __nn; \
563 __nn.__i.__h = (h); __nn.__i.__l = (l); \ 563 __nn.__i.__h = (h); __nn.__i.__l = (l); \
564 __asm__ ("shre %2,%1,%0" \ 564 __asm__ ("shre %2,%1,%0" \
565 : "=d" (r) : "dI" (__nn.__ll), "dI" (c)); \ 565 : "=d" (r) : "dI" (__nn.__ll), "dI" (c)); \
566 } 566 }
567#endif /* i960mx */ 567#endif /* i960mx */
568#endif /* i960 */ 568#endif /* i960 */
569 569
570 570
571/*************************************** 571/***************************************
572 ************** 68000 **************** 572 ************** 68000 ****************
573 ***************************************/ 573 ***************************************/
574#if (defined (__mc68000__) || defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) && W_TYPE_SIZE == 32 574#if (defined (__mc68000__) || defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) && W_TYPE_SIZE == 32
575#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 575#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
576 __asm__ ("add%.l %5,%1\n" \ 576 __asm__ ("add%.l %5,%1\n" \
577 "addx%.l %3,%0" \ 577 "addx%.l %3,%0" \
578 : "=d" ((USItype)(sh)), \ 578 : "=d" ((USItype)(sh)), \
579 "=&d" ((USItype)(sl)) \ 579 "=&d" ((USItype)(sl)) \
580 : "%0" ((USItype)(ah)), \ 580 : "%0" ((USItype)(ah)), \
581 "d" ((USItype)(bh)), \ 581 "d" ((USItype)(bh)), \
582 "%1" ((USItype)(al)), \ 582 "%1" ((USItype)(al)), \
583 "g" ((USItype)(bl))) 583 "g" ((USItype)(bl)))
584#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 584#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
585 __asm__ ("sub%.l %5,%1\n" \ 585 __asm__ ("sub%.l %5,%1\n" \
586 "subx%.l %3,%0" \ 586 "subx%.l %3,%0" \
587 : "=d" ((USItype)(sh)), \ 587 : "=d" ((USItype)(sh)), \
588 "=&d" ((USItype)(sl)) \ 588 "=&d" ((USItype)(sl)) \
589 : "0" ((USItype)(ah)), \ 589 : "0" ((USItype)(ah)), \
590 "d" ((USItype)(bh)), \ 590 "d" ((USItype)(bh)), \
591 "1" ((USItype)(al)), \ 591 "1" ((USItype)(al)), \
592 "g" ((USItype)(bl))) 592 "g" ((USItype)(bl)))
593#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) 593#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020))
594#define umul_ppmm(w1, w0, u, v) \ 594#define umul_ppmm(w1, w0, u, v) \
595 __asm__ ("mulu%.l %3,%1:%0" \ 595 __asm__ ("mulu%.l %3,%1:%0" \
596 : "=d" ((USItype)(w0)), \ 596 : "=d" ((USItype)(w0)), \
597 "=d" ((USItype)(w1)) \ 597 "=d" ((USItype)(w1)) \
598 : "%0" ((USItype)(u)), \ 598 : "%0" ((USItype)(u)), \
599 "dmi" ((USItype)(v))) 599 "dmi" ((USItype)(v)))
600#define UMUL_TIME 45 600#define UMUL_TIME 45
601#define udiv_qrnnd(q, r, n1, n0, d) \ 601#define udiv_qrnnd(q, r, n1, n0, d) \
602 __asm__ ("divu%.l %4,%1:%0" \ 602 __asm__ ("divu%.l %4,%1:%0" \
603 : "=d" ((USItype)(q)), \ 603 : "=d" ((USItype)(q)), \
604 "=d" ((USItype)(r)) \ 604 "=d" ((USItype)(r)) \
605 : "0" ((USItype)(n0)), \ 605 : "0" ((USItype)(n0)), \
606 "1" ((USItype)(n1)), \ 606 "1" ((USItype)(n1)), \
607 "dmi" ((USItype)(d))) 607 "dmi" ((USItype)(d)))
608#define UDIV_TIME 90 608#define UDIV_TIME 90
609#define sdiv_qrnnd(q, r, n1, n0, d) \ 609#define sdiv_qrnnd(q, r, n1, n0, d) \
610 __asm__ ("divs%.l %4,%1:%0" \ 610 __asm__ ("divs%.l %4,%1:%0" \
611 : "=d" ((USItype)(q)), \ 611 : "=d" ((USItype)(q)), \
612 "=d" ((USItype)(r)) \ 612 "=d" ((USItype)(r)) \
613 : "0" ((USItype)(n0)), \ 613 : "0" ((USItype)(n0)), \
614 "1" ((USItype)(n1)), \ 614 "1" ((USItype)(n1)), \
615 "dmi" ((USItype)(d))) 615 "dmi" ((USItype)(d)))
616#define count_leading_zeros(count, x) \ 616#define count_leading_zeros(count, x) \
617 __asm__ ("bfffo %1{%b2:%b2},%0" \ 617 __asm__ ("bfffo %1{%b2:%b2},%0" \
618 : "=d" ((USItype)(count)) \ 618 : "=d" ((USItype)(count)) \
619 : "od" ((USItype)(x)), "n" (0)) 619 : "od" ((USItype)(x)), "n" (0))
620#define COUNT_LEADING_ZEROS_0 32 620#define COUNT_LEADING_ZEROS_0 32
621#else /* not mc68020 */ 621#else /* not mc68020 */
622#define umul_ppmm(xh, xl, a, b) \ 622#define umul_ppmm(xh, xl, a, b) \
623 do { USItype __umul_tmp1, __umul_tmp2; \ 623 do { USItype __umul_tmp1, __umul_tmp2; \
624 __asm__ ("| Inlined umul_ppmm \n" \ 624 __asm__ ("| Inlined umul_ppmm \n" \
625 " move%.l %5,%3 \n" \ 625 " move%.l %5,%3 \n" \
626 " move%.l %2,%0 \n" \ 626 " move%.l %2,%0 \n" \
627 " move%.w %3,%1 \n" \ 627 " move%.w %3,%1 \n" \
628 " swap %3 \n" \ 628 " swap %3 \n" \
629 " swap %0 \n" \ 629 " swap %0 \n" \
630 " mulu %2,%1 \n" \ 630 " mulu %2,%1 \n" \
631 " mulu %3,%0 \n" \ 631 " mulu %3,%0 \n" \
632 " mulu %2,%3 \n" \ 632 " mulu %2,%3 \n" \
633 " swap %2 \n" \ 633 " swap %2 \n" \
634 " mulu %5,%2 \n" \ 634 " mulu %5,%2 \n" \
635 " add%.l %3,%2 \n" \ 635 " add%.l %3,%2 \n" \
636 " jcc 1f \n" \ 636 " jcc 1f \n" \
637 " add%.l %#0x10000,%0 \n" \ 637 " add%.l %#0x10000,%0 \n" \
638 "1: move%.l %2,%3 \n" \ 638 "1: move%.l %2,%3 \n" \
639 " clr%.w %2 \n" \ 639 " clr%.w %2 \n" \
640 " swap %2 \n" \ 640 " swap %2 \n" \
641 " swap %3 \n" \ 641 " swap %3 \n" \
642 " clr%.w %3 \n" \ 642 " clr%.w %3 \n" \
643 " add%.l %3,%1 \n" \ 643 " add%.l %3,%1 \n" \
644 " addx%.l %2,%0 \n" \ 644 " addx%.l %2,%0 \n" \
645 " | End inlined umul_ppmm" \ 645 " | End inlined umul_ppmm" \
646 : "=&d" ((USItype)(xh)), "=&d" ((USItype)(xl)), \ 646 : "=&d" ((USItype)(xh)), "=&d" ((USItype)(xl)), \
647 "=d" (__umul_tmp1), "=&d" (__umul_tmp2) \ 647 "=d" (__umul_tmp1), "=&d" (__umul_tmp2) \
648 : "%2" ((USItype)(a)), "d" ((USItype)(b))); \ 648 : "%2" ((USItype)(a)), "d" ((USItype)(b))); \
649 } while (0) 649 } while (0)
650#define UMUL_TIME 100 650#define UMUL_TIME 100
651#define UDIV_TIME 400 651#define UDIV_TIME 400
652#endif /* not mc68020 */ 652#endif /* not mc68020 */
653#endif /* mc68000 */ 653#endif /* mc68000 */
654 654
655 655
656/*************************************** 656/***************************************
657 ************** 88000 **************** 657 ************** 88000 ****************
658 ***************************************/ 658 ***************************************/
659#if defined (__m88000__) && W_TYPE_SIZE == 32 659#if defined (__m88000__) && W_TYPE_SIZE == 32
660#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 660#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
661 __asm__ ("addu.co %1,%r4,%r5\n" \ 661 __asm__ ("addu.co %1,%r4,%r5\n" \
662 "addu.ci %0,%r2,%r3" \ 662 "addu.ci %0,%r2,%r3" \
663 : "=r" ((USItype)(sh)), \ 663 : "=r" ((USItype)(sh)), \
664 "=&r" ((USItype)(sl)) \ 664 "=&r" ((USItype)(sl)) \
665 : "%rJ" ((USItype)(ah)), \ 665 : "%rJ" ((USItype)(ah)), \
666 "rJ" ((USItype)(bh)), \ 666 "rJ" ((USItype)(bh)), \
667 "%rJ" ((USItype)(al)), \ 667 "%rJ" ((USItype)(al)), \
668 "rJ" ((USItype)(bl))) 668 "rJ" ((USItype)(bl)))
669#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 669#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
670 __asm__ ("subu.co %1,%r4,%r5\n" \ 670 __asm__ ("subu.co %1,%r4,%r5\n" \
671 "subu.ci %0,%r2,%r3" \ 671 "subu.ci %0,%r2,%r3" \
672 : "=r" ((USItype)(sh)), \ 672 : "=r" ((USItype)(sh)), \
673 "=&r" ((USItype)(sl)) \ 673 "=&r" ((USItype)(sl)) \
674 : "rJ" ((USItype)(ah)), \ 674 : "rJ" ((USItype)(ah)), \
675 "rJ" ((USItype)(bh)), \ 675 "rJ" ((USItype)(bh)), \
676 "rJ" ((USItype)(al)), \ 676 "rJ" ((USItype)(al)), \
677 "rJ" ((USItype)(bl))) 677 "rJ" ((USItype)(bl)))
678#define count_leading_zeros(count, x) \ 678#define count_leading_zeros(count, x) \
679 do { \ 679 do { \
680 USItype __cbtmp; \ 680 USItype __cbtmp; \
681 __asm__ ("ff1 %0,%1" \ 681 __asm__ ("ff1 %0,%1" \
682 : "=r" (__cbtmp) \ 682 : "=r" (__cbtmp) \
683 : "r" ((USItype)(x))); \ 683 : "r" ((USItype)(x))); \
684 (count) = __cbtmp ^ 31; \ 684 (count) = __cbtmp ^ 31; \
685 } while (0) 685 } while (0)
686#define COUNT_LEADING_ZEROS_0 63 /* sic */ 686#define COUNT_LEADING_ZEROS_0 63 /* sic */
687#if defined (__m88110__) 687#if defined (__m88110__)
688#define umul_ppmm(wh, wl, u, v) \ 688#define umul_ppmm(wh, wl, u, v) \
689 do { \ 689 do { \
690 union {UDItype __ll; \ 690 union {UDItype __ll; \
691 struct {USItype __h, __l;} __i; \ 691 struct {USItype __h, __l;} __i; \
692 } __x; \ 692 } __x; \
693 __asm__ ("mulu.d %0,%1,%2" : "=r" (__x.__ll) : "r" (u), "r" (v)); \ 693 __asm__ ("mulu.d %0,%1,%2" : "=r" (__x.__ll) : "r" (u), "r" (v)); \
694 (wh) = __x.__i.__h; \ 694 (wh) = __x.__i.__h; \
695 (wl) = __x.__i.__l; \ 695 (wl) = __x.__i.__l; \
696 } while (0) 696 } while (0)
697#define udiv_qrnnd(q, r, n1, n0, d) \ 697#define udiv_qrnnd(q, r, n1, n0, d) \
698 ({union {UDItype __ll; \ 698 ({union {UDItype __ll; \
699 struct {USItype __h, __l;} __i; \ 699 struct {USItype __h, __l;} __i; \
700 } __x, __q; \ 700 } __x, __q; \
701 __x.__i.__h = (n1); __x.__i.__l = (n0); \ 701 __x.__i.__h = (n1); __x.__i.__l = (n0); \
702 __asm__ ("divu.d %0,%1,%2" \ 702 __asm__ ("divu.d %0,%1,%2" \
703 : "=r" (__q.__ll) : "r" (__x.__ll), "r" (d)); \ 703 : "=r" (__q.__ll) : "r" (__x.__ll), "r" (d)); \
704 (r) = (n0) - __q.__l * (d); (q) = __q.__l; }) 704 (r) = (n0) - __q.__l * (d); (q) = __q.__l; })
705#define UMUL_TIME 5 705#define UMUL_TIME 5
706#define UDIV_TIME 25 706#define UDIV_TIME 25
707#else 707#else
708#define UMUL_TIME 17 708#define UMUL_TIME 17
709#define UDIV_TIME 150 709#define UDIV_TIME 150
710#endif /* __m88110__ */ 710#endif /* __m88110__ */
711#endif /* __m88000__ */ 711#endif /* __m88000__ */
712 712
713/*************************************** 713/***************************************
714 ************** MIPS ***************** 714 ************** MIPS *****************
715 ***************************************/ 715 ***************************************/
716#if defined (__mips__) && W_TYPE_SIZE == 32 716#if defined (__mips__) && W_TYPE_SIZE == 32
717#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 717#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
718#define umul_ppmm(w1, w0, u, v) \ 718#define umul_ppmm(w1, w0, u, v) \
719 __asm__ ("multu %2,%3" \ 719 __asm__ ("multu %2,%3" \
720 : "=l" ((USItype)(w0)), \ 720 : "=l" ((USItype)(w0)), \
721 "=h" ((USItype)(w1)) \ 721 "=h" ((USItype)(w1)) \
722 : "d" ((USItype)(u)), \ 722 : "d" ((USItype)(u)), \
723 "d" ((USItype)(v))) 723 "d" ((USItype)(v)))
724#else 724#else
725#define umul_ppmm(w1, w0, u, v) \ 725#define umul_ppmm(w1, w0, u, v) \
726 __asm__ ("multu %2,%3 \n" \ 726 __asm__ ("multu %2,%3 \n" \
727 "mflo %0 \n" \ 727 "mflo %0 \n" \
728 "mfhi %1" \ 728 "mfhi %1" \
729 : "=d" ((USItype)(w0)), \ 729 : "=d" ((USItype)(w0)), \
730 "=d" ((USItype)(w1)) \ 730 "=d" ((USItype)(w1)) \
731 : "d" ((USItype)(u)), \ 731 : "d" ((USItype)(u)), \
732 "d" ((USItype)(v))) 732 "d" ((USItype)(v)))
733#endif 733#endif
734#define UMUL_TIME 10 734#define UMUL_TIME 10
735#define UDIV_TIME 100 735#define UDIV_TIME 100
736#endif /* __mips__ */ 736#endif /* __mips__ */
737 737
738/*************************************** 738/***************************************
739 ************** MIPS/64 ************** 739 ************** MIPS/64 **************
740 ***************************************/ 740 ***************************************/
741#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64 741#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
742#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 742#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
743#define umul_ppmm(w1, w0, u, v) \ 743#define umul_ppmm(w1, w0, u, v) \
744 __asm__ ("dmultu %2,%3" \ 744 __asm__ ("dmultu %2,%3" \
745 : "=l" ((UDItype)(w0)), \ 745 : "=l" ((UDItype)(w0)), \
746 "=h" ((UDItype)(w1)) \ 746 "=h" ((UDItype)(w1)) \
747 : "d" ((UDItype)(u)), \ 747 : "d" ((UDItype)(u)), \
748 "d" ((UDItype)(v))) 748 "d" ((UDItype)(v)))
749#else 749#else
750#define umul_ppmm(w1, w0, u, v) \ 750#define umul_ppmm(w1, w0, u, v) \
751 __asm__ ("dmultu %2,%3 \n" \ 751 __asm__ ("dmultu %2,%3 \n" \
752 "mflo %0 \n" \ 752 "mflo %0 \n" \
753 "mfhi %1" \ 753 "mfhi %1" \
754 : "=d" ((UDItype)(w0)), \ 754 : "=d" ((UDItype)(w0)), \
755 "=d" ((UDItype)(w1)) \ 755 "=d" ((UDItype)(w1)) \
756 : "d" ((UDItype)(u)), \ 756 : "d" ((UDItype)(u)), \
757 "d" ((UDItype)(v))) 757 "d" ((UDItype)(v)))
758#endif 758#endif
759#define UMUL_TIME 20 759#define UMUL_TIME 20
760#define UDIV_TIME 140 760#define UDIV_TIME 140
761#endif /* __mips__ */ 761#endif /* __mips__ */
762 762
763 763
764/*************************************** 764/***************************************
765 ************** 32000 **************** 765 ************** 32000 ****************
766 ***************************************/ 766 ***************************************/
767#if defined (__ns32000__) && W_TYPE_SIZE == 32 767#if defined (__ns32000__) && W_TYPE_SIZE == 32
768#define umul_ppmm(w1, w0, u, v) \ 768#define umul_ppmm(w1, w0, u, v) \
769 ({union {UDItype __ll; \ 769 ({union {UDItype __ll; \
770 struct {USItype __l, __h;} __i; \ 770 struct {USItype __l, __h;} __i; \
771 } __xx; \ 771 } __xx; \
772 __asm__ ("meid %2,%0" \ 772 __asm__ ("meid %2,%0" \
773 : "=g" (__xx.__ll) \ 773 : "=g" (__xx.__ll) \
774 : "%0" ((USItype)(u)), \ 774 : "%0" ((USItype)(u)), \
775 "g" ((USItype)(v))); \ 775 "g" ((USItype)(v))); \
776 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;}) 776 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
777#define __umulsidi3(u, v) \ 777#define __umulsidi3(u, v) \
778 ({UDItype __w; \ 778 ({UDItype __w; \
779 __asm__ ("meid %2,%0" \ 779 __asm__ ("meid %2,%0" \
780 : "=g" (__w) \ 780 : "=g" (__w) \
781 : "%0" ((USItype)(u)), \ 781 : "%0" ((USItype)(u)), \
782 "g" ((USItype)(v))); \ 782 "g" ((USItype)(v))); \
783 __w; }) 783 __w; })
784#define udiv_qrnnd(q, r, n1, n0, d) \ 784#define udiv_qrnnd(q, r, n1, n0, d) \
785 ({union {UDItype __ll; \ 785 ({union {UDItype __ll; \
786 struct {USItype __l, __h;} __i; \ 786 struct {USItype __l, __h;} __i; \
787 } __xx; \ 787 } __xx; \
788 __xx.__i.__h = (n1); __xx.__i.__l = (n0); \ 788 __xx.__i.__h = (n1); __xx.__i.__l = (n0); \
789 __asm__ ("deid %2,%0" \ 789 __asm__ ("deid %2,%0" \
790 : "=g" (__xx.__ll) \ 790 : "=g" (__xx.__ll) \
791 : "0" (__xx.__ll), \ 791 : "0" (__xx.__ll), \
792 "g" ((USItype)(d))); \ 792 "g" ((USItype)(d))); \
793 (r) = __xx.__i.__l; (q) = __xx.__i.__h; }) 793 (r) = __xx.__i.__l; (q) = __xx.__i.__h; })
794#define count_trailing_zeros(count,x) \ 794#define count_trailing_zeros(count,x) \
795 do { 795 do {
796 __asm__ ("ffsd %2,%0" \ 796 __asm__ ("ffsd %2,%0" \
797 : "=r" ((USItype) (count)) \ 797 : "=r" ((USItype) (count)) \
798 : "0" ((USItype) 0), \ 798 : "0" ((USItype) 0), \
799 "r" ((USItype) (x))); \ 799 "r" ((USItype) (x))); \
800 } while (0) 800 } while (0)
801#endif /* __ns32000__ */ 801#endif /* __ns32000__ */
802 802
803 803
804/*************************************** 804/***************************************
805 ************** PPC ****************** 805 ************** PPC ******************
806 ***************************************/ 806 ***************************************/
807#if (defined (_ARCH_PPC) || defined (_IBMR2)) && W_TYPE_SIZE == 32 807#if (defined (_ARCH_PPC) || defined (_IBMR2)) && W_TYPE_SIZE == 32
808#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 808#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
809 do { \ 809 do { \
810 if (__builtin_constant_p (bh) && (bh) == 0) \ 810 if (__builtin_constant_p (bh) && (bh) == 0) \
811 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ 811 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
812 : "=r" ((USItype)(sh)), \ 812 : "=r" ((USItype)(sh)), \
813 "=&r" ((USItype)(sl)) \ 813 "=&r" ((USItype)(sl)) \
814 : "%r" ((USItype)(ah)), \ 814 : "%r" ((USItype)(ah)), \
815 "%r" ((USItype)(al)), \ 815 "%r" ((USItype)(al)), \
816 "rI" ((USItype)(bl))); \ 816 "rI" ((USItype)(bl))); \
817 else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \ 817 else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \
818 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ 818 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
819 : "=r" ((USItype)(sh)), \ 819 : "=r" ((USItype)(sh)), \
820 "=&r" ((USItype)(sl)) \ 820 "=&r" ((USItype)(sl)) \
821 : "%r" ((USItype)(ah)), \ 821 : "%r" ((USItype)(ah)), \
822 "%r" ((USItype)(al)), \ 822 "%r" ((USItype)(al)), \
823 "rI" ((USItype)(bl))); \ 823 "rI" ((USItype)(bl))); \
824 else \ 824 else \
825 __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ 825 __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
826 : "=r" ((USItype)(sh)), \ 826 : "=r" ((USItype)(sh)), \
827 "=&r" ((USItype)(sl)) \ 827 "=&r" ((USItype)(sl)) \
828 : "%r" ((USItype)(ah)), \ 828 : "%r" ((USItype)(ah)), \
829 "r" ((USItype)(bh)), \ 829 "r" ((USItype)(bh)), \
830 "%r" ((USItype)(al)), \ 830 "%r" ((USItype)(al)), \
831 "rI" ((USItype)(bl))); \ 831 "rI" ((USItype)(bl))); \
832 } while (0) 832 } while (0)
833#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 833#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
834 do { \ 834 do { \
835 if (__builtin_constant_p (ah) && (ah) == 0) \ 835 if (__builtin_constant_p (ah) && (ah) == 0) \
836 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ 836 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
837 : "=r" ((USItype)(sh)), \ 837 : "=r" ((USItype)(sh)), \
838 "=&r" ((USItype)(sl)) \ 838 "=&r" ((USItype)(sl)) \
839 : "r" ((USItype)(bh)), \ 839 : "r" ((USItype)(bh)), \
840 "rI" ((USItype)(al)), \ 840 "rI" ((USItype)(al)), \
841 "r" ((USItype)(bl))); \ 841 "r" ((USItype)(bl))); \
842 else if (__builtin_constant_p (ah) && (ah) ==~(USItype) 0) \ 842 else if (__builtin_constant_p (ah) && (ah) ==~(USItype) 0) \
843 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ 843 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
844 : "=r" ((USItype)(sh)), \ 844 : "=r" ((USItype)(sh)), \
845 "=&r" ((USItype)(sl)) \ 845 "=&r" ((USItype)(sl)) \
846 : "r" ((USItype)(bh)), \ 846 : "r" ((USItype)(bh)), \
847 "rI" ((USItype)(al)), \ 847 "rI" ((USItype)(al)), \
848 "r" ((USItype)(bl))); \ 848 "r" ((USItype)(bl))); \
849 else if (__builtin_constant_p (bh) && (bh) == 0) \ 849 else if (__builtin_constant_p (bh) && (bh) == 0) \
850 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ 850 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
851 : "=r" ((USItype)(sh)), \ 851 : "=r" ((USItype)(sh)), \
852 "=&r" ((USItype)(sl)) \ 852 "=&r" ((USItype)(sl)) \
853 : "r" ((USItype)(ah)), \ 853 : "r" ((USItype)(ah)), \
854 "rI" ((USItype)(al)), \ 854 "rI" ((USItype)(al)), \
855 "r" ((USItype)(bl))); \ 855 "r" ((USItype)(bl))); \
856 else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \ 856 else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \
857 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ 857 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
858 : "=r" ((USItype)(sh)), \ 858 : "=r" ((USItype)(sh)), \
859 "=&r" ((USItype)(sl)) \ 859 "=&r" ((USItype)(sl)) \
860 : "r" ((USItype)(ah)), \ 860 : "r" ((USItype)(ah)), \
861 "rI" ((USItype)(al)), \ 861 "rI" ((USItype)(al)), \
862 "r" ((USItype)(bl))); \ 862 "r" ((USItype)(bl))); \
863 else \ 863 else \
864 __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ 864 __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
865 : "=r" ((USItype)(sh)), \ 865 : "=r" ((USItype)(sh)), \
866 "=&r" ((USItype)(sl)) \ 866 "=&r" ((USItype)(sl)) \
867 : "r" ((USItype)(ah)), \ 867 : "r" ((USItype)(ah)), \
868 "r" ((USItype)(bh)), \ 868 "r" ((USItype)(bh)), \
869 "rI" ((USItype)(al)), \ 869 "rI" ((USItype)(al)), \
870 "r" ((USItype)(bl))); \ 870 "r" ((USItype)(bl))); \
871 } while (0) 871 } while (0)
872#define count_leading_zeros(count, x) \ 872#define count_leading_zeros(count, x) \
873 __asm__ ("{cntlz|cntlzw} %0,%1" \ 873 __asm__ ("{cntlz|cntlzw} %0,%1" \
874 : "=r" ((USItype)(count)) \ 874 : "=r" ((USItype)(count)) \
875 : "r" ((USItype)(x))) 875 : "r" ((USItype)(x)))
876#define COUNT_LEADING_ZEROS_0 32 876#define COUNT_LEADING_ZEROS_0 32
877#if defined (_ARCH_PPC) 877#if defined (_ARCH_PPC)
878#define umul_ppmm(ph, pl, m0, m1) \ 878#define umul_ppmm(ph, pl, m0, m1) \
879 do { \ 879 do { \
880 USItype __m0 = (m0), __m1 = (m1); \ 880 USItype __m0 = (m0), __m1 = (m1); \
881 __asm__ ("mulhwu %0,%1,%2" \ 881 __asm__ ("mulhwu %0,%1,%2" \
882 : "=r" ((USItype) ph) \ 882 : "=r" ((USItype) ph) \
883 : "%r" (__m0), \ 883 : "%r" (__m0), \
884 "r" (__m1)); \ 884 "r" (__m1)); \
885 (pl) = __m0 * __m1; \ 885 (pl) = __m0 * __m1; \
886 } while (0) 886 } while (0)
887#define UMUL_TIME 15 887#define UMUL_TIME 15
888#define smul_ppmm(ph, pl, m0, m1) \ 888#define smul_ppmm(ph, pl, m0, m1) \
889 do { \ 889 do { \
890 SItype __m0 = (m0), __m1 = (m1); \ 890 SItype __m0 = (m0), __m1 = (m1); \
891 __asm__ ("mulhw %0,%1,%2" \ 891 __asm__ ("mulhw %0,%1,%2" \
892 : "=r" ((SItype) ph) \ 892 : "=r" ((SItype) ph) \
893 : "%r" (__m0), \ 893 : "%r" (__m0), \
894 "r" (__m1)); \ 894 "r" (__m1)); \
895 (pl) = __m0 * __m1; \ 895 (pl) = __m0 * __m1; \
896 } while (0) 896 } while (0)
897#define SMUL_TIME 14 897#define SMUL_TIME 14
898#define UDIV_TIME 120 898#define UDIV_TIME 120
899#else 899#else
900#define umul_ppmm(xh, xl, m0, m1) \ 900#define umul_ppmm(xh, xl, m0, m1) \
901 do { \ 901 do { \
902 USItype __m0 = (m0), __m1 = (m1); \ 902 USItype __m0 = (m0), __m1 = (m1); \
903 __asm__ ("mul %0,%2,%3" \ 903 __asm__ ("mul %0,%2,%3" \
904 : "=r" ((USItype)(xh)), \ 904 : "=r" ((USItype)(xh)), \
905 "=q" ((USItype)(xl)) \ 905 "=q" ((USItype)(xl)) \
906 : "r" (__m0), \ 906 : "r" (__m0), \
907 "r" (__m1)); \ 907 "r" (__m1)); \
908 (xh) += ((((SItype) __m0 >> 31) & __m1) \ 908 (xh) += ((((SItype) __m0 >> 31) & __m1) \
909 + (((SItype) __m1 >> 31) & __m0)); \ 909 + (((SItype) __m1 >> 31) & __m0)); \
910 } while (0) 910 } while (0)
911#define UMUL_TIME 8 911#define UMUL_TIME 8
912#define smul_ppmm(xh, xl, m0, m1) \ 912#define smul_ppmm(xh, xl, m0, m1) \
913 __asm__ ("mul %0,%2,%3" \ 913 __asm__ ("mul %0,%2,%3" \
914 : "=r" ((SItype)(xh)), \ 914 : "=r" ((SItype)(xh)), \
915 "=q" ((SItype)(xl)) \ 915 "=q" ((SItype)(xl)) \
916 : "r" (m0), \ 916 : "r" (m0), \
917 "r" (m1)) 917 "r" (m1))
918#define SMUL_TIME 4 918#define SMUL_TIME 4
919#define sdiv_qrnnd(q, r, nh, nl, d) \ 919#define sdiv_qrnnd(q, r, nh, nl, d) \
920 __asm__ ("div %0,%2,%4" \ 920 __asm__ ("div %0,%2,%4" \
921 : "=r" ((SItype)(q)), "=q" ((SItype)(r)) \ 921 : "=r" ((SItype)(q)), "=q" ((SItype)(r)) \
922 : "r" ((SItype)(nh)), "1" ((SItype)(nl)), "r" ((SItype)(d))) 922 : "r" ((SItype)(nh)), "1" ((SItype)(nl)), "r" ((SItype)(d)))
923#define UDIV_TIME 100 923#define UDIV_TIME 100
924#endif 924#endif
925#endif /* Power architecture variants. */ 925#endif /* Power architecture variants. */
926 926
927/* Powerpc 64 bit support taken from gmp-4.1.2. */ 927/* Powerpc 64 bit support taken from gmp-4.1.2. */
928/* We should test _IBMR2 here when we add assembly support for the system 928/* We should test _IBMR2 here when we add assembly support for the system
929 vendor compilers. */ 929 vendor compilers. */
930#if 0 /* Not yet enabled becuase we don't have hardware for a test. */ 930#if 0 /* Not yet enabled becuase we don't have hardware for a test. */
931#if (defined (_ARCH_PPC) || defined (__powerpc__)) && W_TYPE_SIZE == 64 931#if (defined (_ARCH_PPC) || defined (__powerpc__)) && W_TYPE_SIZE == 64
932#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 932#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
933 do { \ 933 do { \
934 if (__builtin_constant_p (bh) && (bh) == 0) \ 934 if (__builtin_constant_p (bh) && (bh) == 0) \
935 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ 935 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
936 : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ 936 : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
937 else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \ 937 else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
938 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ 938 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
939 : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ 939 : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
940 else \ 940 else \
941 __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ 941 __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
942 : "=r" (sh), "=&r" (sl) \ 942 : "=r" (sh), "=&r" (sl) \
943 : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \ 943 : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
944 } while (0) 944 } while (0)
945#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 945#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
946 do { \ 946 do { \
947 if (__builtin_constant_p (ah) && (ah) == 0) \ 947 if (__builtin_constant_p (ah) && (ah) == 0) \
948 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ 948 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
949 : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\ 949 : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
950 else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \ 950 else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
951 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ 951 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
952 : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\ 952 : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
953 else if (__builtin_constant_p (bh) && (bh) == 0) \ 953 else if (__builtin_constant_p (bh) && (bh) == 0) \
954 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ 954 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
955 : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\ 955 : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
956 else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \ 956 else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
957 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ 957 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
958 : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\ 958 : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
959 else \ 959 else \
960 __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ 960 __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
961 : "=r" (sh), "=&r" (sl) \ 961 : "=r" (sh), "=&r" (sl) \
962 : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \ 962 : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
963 } while (0) 963 } while (0)
964#define count_leading_zeros(count, x) \ 964#define count_leading_zeros(count, x) \
965 __asm__ ("cntlzd %0,%1" : "=r" (count) : "r" (x)) 965 __asm__ ("cntlzd %0,%1" : "=r" (count) : "r" (x))
966#define COUNT_LEADING_ZEROS_0 64 966#define COUNT_LEADING_ZEROS_0 64
967#define umul_ppmm(ph, pl, m0, m1) \ 967#define umul_ppmm(ph, pl, m0, m1) \
968 do { \ 968 do { \
969 UDItype __m0 = (m0), __m1 = (m1); \ 969 UDItype __m0 = (m0), __m1 = (m1); \
970 __asm__ ("mulhdu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \ 970 __asm__ ("mulhdu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
971 (pl) = __m0 * __m1; \ 971 (pl) = __m0 * __m1; \
972 } while (0) 972 } while (0)
973#define UMUL_TIME 15 973#define UMUL_TIME 15
974#define smul_ppmm(ph, pl, m0, m1) \ 974#define smul_ppmm(ph, pl, m0, m1) \
975 do { \ 975 do { \
976 DItype __m0 = (m0), __m1 = (m1); \ 976 DItype __m0 = (m0), __m1 = (m1); \
977 __asm__ ("mulhd %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \ 977 __asm__ ("mulhd %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
978 (pl) = __m0 * __m1; \ 978 (pl) = __m0 * __m1; \
979 } while (0) 979 } while (0)
980#define SMUL_TIME 14 /* ??? */ 980#define SMUL_TIME 14 /* ??? */
981#define UDIV_TIME 120 /* ??? */ 981#define UDIV_TIME 120 /* ??? */
982#endif /* 64-bit PowerPC. */ 982#endif /* 64-bit PowerPC. */
983#endif /* if 0 */ 983#endif /* if 0 */
984 984
985/*************************************** 985/***************************************
986 ************** PYR ****************** 986 ************** PYR ******************
987 ***************************************/ 987 ***************************************/
988#if defined (__pyr__) && W_TYPE_SIZE == 32 988#if defined (__pyr__) && W_TYPE_SIZE == 32
989#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 989#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
990 __asm__ ("addw %5,%1 \n" \ 990 __asm__ ("addw %5,%1 \n" \
991 "addwc %3,%0" \ 991 "addwc %3,%0" \
992 : "=r" ((USItype)(sh)), \ 992 : "=r" ((USItype)(sh)), \
993 "=&r" ((USItype)(sl)) \ 993 "=&r" ((USItype)(sl)) \
994 : "%0" ((USItype)(ah)), \ 994 : "%0" ((USItype)(ah)), \
995 "g" ((USItype)(bh)), \ 995 "g" ((USItype)(bh)), \
996 "%1" ((USItype)(al)), \ 996 "%1" ((USItype)(al)), \
997 "g" ((USItype)(bl))) 997 "g" ((USItype)(bl)))
998#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 998#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
999 __asm__ ("subw %5,%1 \n" \ 999 __asm__ ("subw %5,%1 \n" \
1000 "subwb %3,%0" \ 1000 "subwb %3,%0" \
1001 : "=r" ((USItype)(sh)), \ 1001 : "=r" ((USItype)(sh)), \
1002 "=&r" ((USItype)(sl)) \ 1002 "=&r" ((USItype)(sl)) \
1003 : "0" ((USItype)(ah)), \ 1003 : "0" ((USItype)(ah)), \
1004 "g" ((USItype)(bh)), \ 1004 "g" ((USItype)(bh)), \
1005 "1" ((USItype)(al)), \ 1005 "1" ((USItype)(al)), \
1006 "g" ((USItype)(bl))) 1006 "g" ((USItype)(bl)))
1007/* This insn works on Pyramids with AP, XP, or MI CPUs, but not with SP. */ 1007/* This insn works on Pyramids with AP, XP, or MI CPUs, but not with SP. */
1008#define umul_ppmm(w1, w0, u, v) \ 1008#define umul_ppmm(w1, w0, u, v) \
1009 ({union {UDItype __ll; \ 1009 ({union {UDItype __ll; \
1010 struct {USItype __h, __l;} __i; \ 1010 struct {USItype __h, __l;} __i; \
1011 } __xx; \ 1011 } __xx; \
1012 __asm__ ("movw %1,%R0 \n" \ 1012 __asm__ ("movw %1,%R0 \n" \
1013 "uemul %2,%0" \ 1013 "uemul %2,%0" \
1014 : "=&r" (__xx.__ll) \ 1014 : "=&r" (__xx.__ll) \
1015 : "g" ((USItype) (u)), \ 1015 : "g" ((USItype) (u)), \
1016 "g" ((USItype)(v))); \ 1016 "g" ((USItype)(v))); \
1017 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;}) 1017 (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
1018#endif /* __pyr__ */ 1018#endif /* __pyr__ */
1019 1019
1020 1020
1021/*************************************** 1021/***************************************
1022 ************** RT/ROMP ************** 1022 ************** RT/ROMP **************
1023 ***************************************/ 1023 ***************************************/
1024#if defined (__ibm032__) /* RT/ROMP */ && W_TYPE_SIZE == 32 1024#if defined (__ibm032__) /* RT/ROMP */ && W_TYPE_SIZE == 32
1025#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 1025#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
1026 __asm__ ("a %1,%5 \n" \ 1026 __asm__ ("a %1,%5 \n" \
1027 "ae %0,%3" \ 1027 "ae %0,%3" \
1028 : "=r" ((USItype)(sh)), \ 1028 : "=r" ((USItype)(sh)), \
1029 "=&r" ((USItype)(sl)) \ 1029 "=&r" ((USItype)(sl)) \
1030 : "%0" ((USItype)(ah)), \ 1030 : "%0" ((USItype)(ah)), \
1031 "r" ((USItype)(bh)), \ 1031 "r" ((USItype)(bh)), \
1032 "%1" ((USItype)(al)), \ 1032 "%1" ((USItype)(al)), \
1033 "r" ((USItype)(bl))) 1033 "r" ((USItype)(bl)))
1034#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 1034#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
1035 __asm__ ("s %1,%5\n" \ 1035 __asm__ ("s %1,%5\n" \
1036 "se %0,%3" \ 1036 "se %0,%3" \
1037 : "=r" ((USItype)(sh)), \ 1037 : "=r" ((USItype)(sh)), \
1038 "=&r" ((USItype)(sl)) \ 1038 "=&r" ((USItype)(sl)) \
1039 : "0" ((USItype)(ah)), \ 1039 : "0" ((USItype)(ah)), \
1040 "r" ((USItype)(bh)), \ 1040 "r" ((USItype)(bh)), \
1041 "1" ((USItype)(al)), \ 1041 "1" ((USItype)(al)), \
1042 "r" ((USItype)(bl))) 1042 "r" ((USItype)(bl)))
1043#define umul_ppmm(ph, pl, m0, m1) \ 1043#define umul_ppmm(ph, pl, m0, m1) \
1044 do { \ 1044 do { \
1045 USItype __m0 = (m0), __m1 = (m1); \ 1045 USItype __m0 = (m0), __m1 = (m1); \
1046 __asm__ ( \ 1046 __asm__ ( \
1047 "s r2,r2 \n" \ 1047 "s r2,r2 \n" \
1048 "mts r10,%2 \n" \ 1048 "mts r10,%2 \n" \
1049 "m r2,%3 \n" \ 1049 "m r2,%3 \n" \
1050 "m r2,%3 \n" \ 1050 "m r2,%3 \n" \
1051 "m r2,%3 \n" \ 1051 "m r2,%3 \n" \
1052 "m r2,%3 \n" \ 1052 "m r2,%3 \n" \
1053 "m r2,%3 \n" \ 1053 "m r2,%3 \n" \
1054 "m r2,%3 \n" \ 1054 "m r2,%3 \n" \
1055 "m r2,%3 \n" \ 1055 "m r2,%3 \n" \
1056 "m r2,%3 \n" \ 1056 "m r2,%3 \n" \
1057 "m r2,%3 \n" \ 1057 "m r2,%3 \n" \
1058 "m r2,%3 \n" \ 1058 "m r2,%3 \n" \
1059 "m r2,%3 \n" \ 1059 "m r2,%3 \n" \
1060 "m r2,%3 \n" \ 1060 "m r2,%3 \n" \
1061 "m r2,%3 \n" \ 1061 "m r2,%3 \n" \
1062 "m r2,%3 \n" \ 1062 "m r2,%3 \n" \
1063 "m r2,%3 \n" \ 1063 "m r2,%3 \n" \
1064 "m r2,%3 \n" \ 1064 "m r2,%3 \n" \
1065 "cas %0,r2,r0 \n" \ 1065 "cas %0,r2,r0 \n" \
1066 "mfs r10,%1" \ 1066 "mfs r10,%1" \
1067 : "=r" ((USItype)(ph)), \ 1067 : "=r" ((USItype)(ph)), \
1068 "=r" ((USItype)(pl)) \ 1068 "=r" ((USItype)(pl)) \
1069 : "%r" (__m0), \ 1069 : "%r" (__m0), \
1070 "r" (__m1) \ 1070 "r" (__m1) \
1071 : "r2"); \ 1071 : "r2"); \
1072 (ph) += ((((SItype) __m0 >> 31) & __m1) \ 1072 (ph) += ((((SItype) __m0 >> 31) & __m1) \
1073 + (((SItype) __m1 >> 31) & __m0)); \ 1073 + (((SItype) __m1 >> 31) & __m0)); \
1074 } while (0) 1074 } while (0)
1075#define UMUL_TIME 20 1075#define UMUL_TIME 20
1076#define UDIV_TIME 200 1076#define UDIV_TIME 200
1077#define count_leading_zeros(count, x) \ 1077#define count_leading_zeros(count, x) \
1078 do { \ 1078 do { \
1079 if ((x) >= 0x10000) \ 1079 if ((x) >= 0x10000) \
1080 __asm__ ("clz %0,%1" \ 1080 __asm__ ("clz %0,%1" \
1081 : "=r" ((USItype)(count)) \ 1081 : "=r" ((USItype)(count)) \
1082 : "r" ((USItype)(x) >> 16)); \ 1082 : "r" ((USItype)(x) >> 16)); \
1083 else \ 1083 else \
1084 { \ 1084 { \
1085 __asm__ ("clz %0,%1" \ 1085 __asm__ ("clz %0,%1" \
1086 : "=r" ((USItype)(count)) \ 1086 : "=r" ((USItype)(count)) \
1087 : "r" ((USItype)(x))); \ 1087 : "r" ((USItype)(x))); \
1088 (count) += 16; \ 1088 (count) += 16; \
1089 } \ 1089 } \
1090 } while (0) 1090 } while (0)
1091#endif /* RT/ROMP */ 1091#endif /* RT/ROMP */
1092 1092
1093 1093
1094/*************************************** 1094/***************************************
1095 ************** SH2 ****************** 1095 ************** SH2 ******************
1096 ***************************************/ 1096 ***************************************/
1097#if (defined (__sh2__) || defined(__sh3__) || defined(__SH4__) ) \ 1097#if (defined (__sh2__) || defined(__sh3__) || defined(__SH4__) ) \
1098 && W_TYPE_SIZE == 32 1098 && W_TYPE_SIZE == 32
1099#define umul_ppmm(w1, w0, u, v) \ 1099#define umul_ppmm(w1, w0, u, v) \
1100 __asm__ ( \ 1100 __asm__ ( \
1101 "dmulu.l %2,%3\n" \ 1101 "dmulu.l %2,%3\n" \
1102 "sts macl,%1\n" \ 1102 "sts macl,%1\n" \
1103 "sts mach,%0" \ 1103 "sts mach,%0" \
1104 : "=r" ((USItype)(w1)), \ 1104 : "=r" ((USItype)(w1)), \
1105 "=r" ((USItype)(w0)) \ 1105 "=r" ((USItype)(w0)) \
1106 : "r" ((USItype)(u)), \ 1106 : "r" ((USItype)(u)), \
1107 "r" ((USItype)(v)) \ 1107 "r" ((USItype)(v)) \
1108 : "macl", "mach") 1108 : "macl", "mach")
1109#define UMUL_TIME 5 1109#define UMUL_TIME 5
1110#endif 1110#endif
1111 1111
1112/*************************************** 1112/***************************************
1113 ************** SPARC **************** 1113 ************** SPARC ****************
1114 ***************************************/ 1114 ***************************************/
1115#if defined (__sparc__) && W_TYPE_SIZE == 32 1115#if defined (__sparc__) && W_TYPE_SIZE == 32
1116#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 1116#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
1117 __asm__ ("addcc %r4,%5,%1\n" \ 1117 __asm__ ("addcc %r4,%5,%1\n" \
1118 "addx %r2,%3,%0" \ 1118 "addx %r2,%3,%0" \
1119 : "=r" ((USItype)(sh)), \ 1119 : "=r" ((USItype)(sh)), \
1120 "=&r" ((USItype)(sl)) \ 1120 "=&r" ((USItype)(sl)) \
1121 : "%rJ" ((USItype)(ah)), \ 1121 : "%rJ" ((USItype)(ah)), \
1122 "rI" ((USItype)(bh)), \ 1122 "rI" ((USItype)(bh)), \
1123 "%rJ" ((USItype)(al)), \ 1123 "%rJ" ((USItype)(al)), \
1124 "rI" ((USItype)(bl)) \ 1124 "rI" ((USItype)(bl)) \
1125 __CLOBBER_CC) 1125 __CLOBBER_CC)
1126#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 1126#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
1127 __asm__ ("subcc %r4,%5,%1\n" \ 1127 __asm__ ("subcc %r4,%5,%1\n" \
1128 "subx %r2,%3,%0" \ 1128 "subx %r2,%3,%0" \
1129 : "=r" ((USItype)(sh)), \ 1129 : "=r" ((USItype)(sh)), \
1130 "=&r" ((USItype)(sl)) \ 1130 "=&r" ((USItype)(sl)) \
1131 : "rJ" ((USItype)(ah)), \ 1131 : "rJ" ((USItype)(ah)), \
1132 "rI" ((USItype)(bh)), \ 1132 "rI" ((USItype)(bh)), \
1133 "rJ" ((USItype)(al)), \ 1133 "rJ" ((USItype)(al)), \
1134 "rI" ((USItype)(bl)) \ 1134 "rI" ((USItype)(bl)) \
1135 __CLOBBER_CC) 1135 __CLOBBER_CC)
1136#if defined (__sparc_v8__) 1136#if defined (__sparc_v8__)
1137/* Don't match immediate range because, 1) it is not often useful, 1137/* Don't match immediate range because, 1) it is not often useful,
1138 2) the 'I' flag thinks of the range as a 13 bit signed interval, 1138 2) the 'I' flag thinks of the range as a 13 bit signed interval,
1139 while we want to match a 13 bit interval, sign extended to 32 bits, 1139 while we want to match a 13 bit interval, sign extended to 32 bits,
1140 but INTERPRETED AS UNSIGNED. */ 1140 but INTERPRETED AS UNSIGNED. */
1141#define umul_ppmm(w1, w0, u, v) \ 1141#define umul_ppmm(w1, w0, u, v) \
1142 __asm__ ("umul %2,%3,%1;rd %%y,%0" \ 1142 __asm__ ("umul %2,%3,%1;rd %%y,%0" \
1143 : "=r" ((USItype)(w1)), \ 1143 : "=r" ((USItype)(w1)), \
1144 "=r" ((USItype)(w0)) \ 1144 "=r" ((USItype)(w0)) \
1145 : "r" ((USItype)(u)), \ 1145 : "r" ((USItype)(u)), \
1146 "r" ((USItype)(v))) 1146 "r" ((USItype)(v)))
1147#define UMUL_TIME 5 1147#define UMUL_TIME 5
1148#ifndef SUPERSPARC /* SuperSPARC's udiv only handles 53 bit dividends */ 1148#ifndef SUPERSPARC /* SuperSPARC's udiv only handles 53 bit dividends */
1149#define udiv_qrnnd(q, r, n1, n0, d) \ 1149#define udiv_qrnnd(q, r, n1, n0, d) \
1150 do { \ 1150 do { \
1151 USItype __q; \ 1151 USItype __q; \
1152 __asm__ ("mov %1,%%y;nop;nop;nop;udiv %2,%3,%0" \ 1152 __asm__ ("mov %1,%%y;nop;nop;nop;udiv %2,%3,%0" \
1153 : "=r" ((USItype)(__q)) \ 1153 : "=r" ((USItype)(__q)) \
1154 : "r" ((USItype)(n1)), \ 1154 : "r" ((USItype)(n1)), \
1155 "r" ((USItype)(n0)), \ 1155 "r" ((USItype)(n0)), \
1156 "r" ((USItype)(d))); \ 1156 "r" ((USItype)(d))); \
1157 (r) = (n0) - __q * (d); \ 1157 (r) = (n0) - __q * (d); \
1158 (q) = __q; \ 1158 (q) = __q; \
1159 } while (0) 1159 } while (0)
1160#define UDIV_TIME 25 1160#define UDIV_TIME 25
1161#endif /* SUPERSPARC */ 1161#endif /* SUPERSPARC */
1162#else /* ! __sparc_v8__ */ 1162#else /* ! __sparc_v8__ */
1163#if defined (__sparclite__) 1163#if defined (__sparclite__)
1164/* This has hardware multiply but not divide. It also has two additional 1164/* This has hardware multiply but not divide. It also has two additional
1165 instructions scan (ffs from high bit) and divscc. */ 1165 instructions scan (ffs from high bit) and divscc. */
1166#define umul_ppmm(w1, w0, u, v) \ 1166#define umul_ppmm(w1, w0, u, v) \
1167 __asm__ ("umul %2,%3,%1;rd %%y,%0" \ 1167 __asm__ ("umul %2,%3,%1;rd %%y,%0" \
1168 : "=r" ((USItype)(w1)), \ 1168 : "=r" ((USItype)(w1)), \
1169 "=r" ((USItype)(w0)) \ 1169 "=r" ((USItype)(w0)) \
1170 : "r" ((USItype)(u)), \ 1170 : "r" ((USItype)(u)), \
1171 "r" ((USItype)(v))) 1171 "r" ((USItype)(v)))
1172#define UMUL_TIME 5 1172#define UMUL_TIME 5
1173#define udiv_qrnnd(q, r, n1, n0, d) \ 1173#define udiv_qrnnd(q, r, n1, n0, d) \
1174 __asm__ ("! Inlined udiv_qrnnd \n" \ 1174 __asm__ ("! Inlined udiv_qrnnd \n" \
1175 " wr %%g0,%2,%%y ! Not a delayed write for sparclite \n" \ 1175 " wr %%g0,%2,%%y ! Not a delayed write for sparclite \n" \
1176 " tst %%g0 \n" \ 1176 " tst %%g0 \n" \
1177 " divscc %3,%4,%%g1 \n" \ 1177 " divscc %3,%4,%%g1 \n" \
1178 " divscc %%g1,%4,%%g1 \n" \ 1178 " divscc %%g1,%4,%%g1 \n" \
1179 " divscc %%g1,%4,%%g1 \n" \ 1179 " divscc %%g1,%4,%%g1 \n" \
1180 " divscc %%g1,%4,%%g1 \n" \ 1180 " divscc %%g1,%4,%%g1 \n" \
1181 " divscc %%g1,%4,%%g1 \n" \ 1181 " divscc %%g1,%4,%%g1 \n" \
1182 " divscc %%g1,%4,%%g1 \n" \ 1182 " divscc %%g1,%4,%%g1 \n" \
1183 " divscc %%g1,%4,%%g1 \n" \ 1183 " divscc %%g1,%4,%%g1 \n" \
1184 " divscc %%g1,%4,%%g1 \n" \ 1184 " divscc %%g1,%4,%%g1 \n" \
1185 " divscc %%g1,%4,%%g1 \n" \ 1185 " divscc %%g1,%4,%%g1 \n" \
1186 " divscc %%g1,%4,%%g1 \n" \ 1186 " divscc %%g1,%4,%%g1 \n" \
1187 " divscc %%g1,%4,%%g1 \n" \ 1187 " divscc %%g1,%4,%%g1 \n" \
1188 " divscc %%g1,%4,%%g1 \n" \ 1188 " divscc %%g1,%4,%%g1 \n" \
1189 " divscc %%g1,%4,%%g1 \n" \ 1189 " divscc %%g1,%4,%%g1 \n" \
1190 " divscc %%g1,%4,%%g1 \n" \ 1190 " divscc %%g1,%4,%%g1 \n" \
1191 " divscc %%g1,%4,%%g1 \n" \ 1191 " divscc %%g1,%4,%%g1 \n" \
1192 " divscc %%g1,%4,%%g1 \n" \ 1192 " divscc %%g1,%4,%%g1 \n" \
1193 " divscc %%g1,%4,%%g1 \n" \ 1193 " divscc %%g1,%4,%%g1 \n" \
1194 " divscc %%g1,%4,%%g1 \n" \ 1194 " divscc %%g1,%4,%%g1 \n" \
1195 " divscc %%g1,%4,%%g1 \n" \ 1195 " divscc %%g1,%4,%%g1 \n" \
1196 " divscc %%g1,%4,%%g1 \n" \ 1196 " divscc %%g1,%4,%%g1 \n" \
1197 " divscc %%g1,%4,%%g1 \n" \ 1197 " divscc %%g1,%4,%%g1 \n" \
1198 " divscc %%g1,%4,%%g1 \n" \ 1198 " divscc %%g1,%4,%%g1 \n" \
1199 " divscc %%g1,%4,%%g1 \n" \ 1199 " divscc %%g1,%4,%%g1 \n" \
1200 " divscc %%g1,%4,%%g1 \n" \ 1200 " divscc %%g1,%4,%%g1 \n" \
1201 " divscc %%g1,%4,%%g1 \n" \ 1201 " divscc %%g1,%4,%%g1 \n" \
1202 " divscc %%g1,%4,%%g1 \n" \ 1202 " divscc %%g1,%4,%%g1 \n" \
1203 " divscc %%g1,%4,%%g1 \n" \ 1203 " divscc %%g1,%4,%%g1 \n" \
1204 " divscc %%g1,%4,%%g1 \n" \ 1204 " divscc %%g1,%4,%%g1 \n" \
1205 " divscc %%g1,%4,%%g1 \n" \ 1205 " divscc %%g1,%4,%%g1 \n" \
1206 " divscc %%g1,%4,%%g1 \n" \ 1206 " divscc %%g1,%4,%%g1 \n" \
1207 " divscc %%g1,%4,%%g1 \n" \ 1207 " divscc %%g1,%4,%%g1 \n" \
1208 " divscc %%g1,%4,%0 \n" \ 1208 " divscc %%g1,%4,%0 \n" \
1209 " rd %%y,%1 \n" \ 1209 " rd %%y,%1 \n" \
1210 " bl,a 1f \n" \ 1210 " bl,a 1f \n" \
1211 " add %1,%4,%1 \n" \ 1211 " add %1,%4,%1 \n" \
1212 "1: ! End of inline udiv_qrnnd" \ 1212 "1: ! End of inline udiv_qrnnd" \
1213 : "=r" ((USItype)(q)), \ 1213 : "=r" ((USItype)(q)), \
1214 "=r" ((USItype)(r)) \ 1214 "=r" ((USItype)(r)) \
1215 : "r" ((USItype)(n1)), \ 1215 : "r" ((USItype)(n1)), \
1216 "r" ((USItype)(n0)), \ 1216 "r" ((USItype)(n0)), \
1217 "rI" ((USItype)(d)) \ 1217 "rI" ((USItype)(d)) \
1218 : "%g1" __AND_CLOBBER_CC) 1218 : "%g1" __AND_CLOBBER_CC)
1219#define UDIV_TIME 37 1219#define UDIV_TIME 37
1220#define count_leading_zeros(count, x) \ 1220#define count_leading_zeros(count, x) \
1221 __asm__ ("scan %1,0,%0" \ 1221 __asm__ ("scan %1,0,%0" \
1222 : "=r" ((USItype)(x)) \ 1222 : "=r" ((USItype)(x)) \
1223 : "r" ((USItype)(count))) 1223 : "r" ((USItype)(count)))
1224/* Early sparclites return 63 for an argument of 0, but they warn that future 1224/* Early sparclites return 63 for an argument of 0, but they warn that future
1225 implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0 1225 implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0
1226 undefined. */ 1226 undefined. */
1227#endif /* __sparclite__ */ 1227#endif /* __sparclite__ */
1228#endif /* __sparc_v8__ */ 1228#endif /* __sparc_v8__ */
1229/* Default to sparc v7 versions of umul_ppmm and udiv_qrnnd. */ 1229/* Default to sparc v7 versions of umul_ppmm and udiv_qrnnd. */
1230#ifndef umul_ppmm 1230#ifndef umul_ppmm
1231#define umul_ppmm(w1, w0, u, v) \ 1231#define umul_ppmm(w1, w0, u, v) \
1232 __asm__ ("! Inlined umul_ppmm \n" \ 1232 __asm__ ("! Inlined umul_ppmm \n" \
1233 " wr %%g0,%2,%%y ! SPARC has 0-3 delay insn after a wr \n" \ 1233 " wr %%g0,%2,%%y ! SPARC has 0-3 delay insn after a wr \n" \
1234 " sra %3,31,%%g2 ! Don't move this insn \n" \ 1234 " sra %3,31,%%g2 ! Don't move this insn \n" \
1235 " and %2,%%g2,%%g2 ! Don't move this insn \n" \ 1235 " and %2,%%g2,%%g2 ! Don't move this insn \n" \
1236 " andcc %%g0,0,%%g1 ! Don't move this insn \n" \ 1236 " andcc %%g0,0,%%g1 ! Don't move this insn \n" \
1237 " mulscc %%g1,%3,%%g1 \n" \ 1237 " mulscc %%g1,%3,%%g1 \n" \
1238 " mulscc %%g1,%3,%%g1 \n" \ 1238 " mulscc %%g1,%3,%%g1 \n" \
1239 " mulscc %%g1,%3,%%g1 \n" \ 1239 " mulscc %%g1,%3,%%g1 \n" \
1240 " mulscc %%g1,%3,%%g1 \n" \ 1240 " mulscc %%g1,%3,%%g1 \n" \
1241 " mulscc %%g1,%3,%%g1 \n" \ 1241 " mulscc %%g1,%3,%%g1 \n" \
1242 " mulscc %%g1,%3,%%g1 \n" \ 1242 " mulscc %%g1,%3,%%g1 \n" \
1243 " mulscc %%g1,%3,%%g1 \n" \ 1243 " mulscc %%g1,%3,%%g1 \n" \
1244 " mulscc %%g1,%3,%%g1 \n" \ 1244 " mulscc %%g1,%3,%%g1 \n" \
1245 " mulscc %%g1,%3,%%g1 \n" \ 1245 " mulscc %%g1,%3,%%g1 \n" \
1246 " mulscc %%g1,%3,%%g1 \n" \ 1246 " mulscc %%g1,%3,%%g1 \n" \
1247 " mulscc %%g1,%3,%%g1 \n" \ 1247 " mulscc %%g1,%3,%%g1 \n" \
1248 " mulscc %%g1,%3,%%g1 \n" \ 1248 " mulscc %%g1,%3,%%g1 \n" \
1249 " mulscc %%g1,%3,%%g1 \n" \ 1249 " mulscc %%g1,%3,%%g1 \n" \
1250 " mulscc %%g1,%3,%%g1 \n" \ 1250 " mulscc %%g1,%3,%%g1 \n" \
1251 " mulscc %%g1,%3,%%g1 \n" \ 1251 " mulscc %%g1,%3,%%g1 \n" \
1252 " mulscc %%g1,%3,%%g1 \n" \ 1252 " mulscc %%g1,%3,%%g1 \n" \
1253 " mulscc %%g1,%3,%%g1 \n" \ 1253 " mulscc %%g1,%3,%%g1 \n" \
1254 " mulscc %%g1,%3,%%g1 \n" \ 1254 " mulscc %%g1,%3,%%g1 \n" \
1255 " mulscc %%g1,%3,%%g1 \n" \ 1255 " mulscc %%g1,%3,%%g1 \n" \
1256 " mulscc %%g1,%3,%%g1 \n" \ 1256 " mulscc %%g1,%3,%%g1 \n" \
1257 " mulscc %%g1,%3,%%g1 \n" \ 1257 " mulscc %%g1,%3,%%g1 \n" \
1258 " mulscc %%g1,%3,%%g1 \n" \ 1258 " mulscc %%g1,%3,%%g1 \n" \
1259 " mulscc %%g1,%3,%%g1 \n" \ 1259 " mulscc %%g1,%3,%%g1 \n" \
1260 " mulscc %%g1,%3,%%g1 \n" \ 1260 " mulscc %%g1,%3,%%g1 \n" \
1261 " mulscc %%g1,%3,%%g1 \n" \ 1261 " mulscc %%g1,%3,%%g1 \n" \
1262 " mulscc %%g1,%3,%%g1 \n" \ 1262 " mulscc %%g1,%3,%%g1 \n" \
1263 " mulscc %%g1,%3,%%g1 \n" \ 1263 " mulscc %%g1,%3,%%g1 \n" \
1264 " mulscc %%g1,%3,%%g1 \n" \ 1264 " mulscc %%g1,%3,%%g1 \n" \
1265 " mulscc %%g1,%3,%%g1 \n" \ 1265 " mulscc %%g1,%3,%%g1 \n" \
1266 " mulscc %%g1,%3,%%g1 \n" \ 1266 " mulscc %%g1,%3,%%g1 \n" \
1267 " mulscc %%g1,%3,%%g1 \n" \ 1267 " mulscc %%g1,%3,%%g1 \n" \
1268 " mulscc %%g1,%3,%%g1 \n" \ 1268 " mulscc %%g1,%3,%%g1 \n" \
1269 " mulscc %%g1,0,%%g1 \n" \ 1269 " mulscc %%g1,0,%%g1 \n" \
1270 " add %%g1,%%g2,%0 \n" \ 1270 " add %%g1,%%g2,%0 \n" \
1271 " rd %%y,%1" \ 1271 " rd %%y,%1" \
1272 : "=r" ((USItype)(w1)), \ 1272 : "=r" ((USItype)(w1)), \
1273 "=r" ((USItype)(w0)) \ 1273 "=r" ((USItype)(w0)) \
1274 : "%rI" ((USItype)(u)), \ 1274 : "%rI" ((USItype)(u)), \
1275 "r" ((USItype)(v)) \ 1275 "r" ((USItype)(v)) \
1276 : "%g1", "%g2" __AND_CLOBBER_CC) 1276 : "%g1", "%g2" __AND_CLOBBER_CC)
1277#define UMUL_TIME 39 /* 39 instructions */ 1277#define UMUL_TIME 39 /* 39 instructions */
1278#endif 1278#endif
1279#ifndef udiv_qrnnd 1279#ifndef udiv_qrnnd
1280#ifndef LONGLONG_STANDALONE 1280#ifndef LONGLONG_STANDALONE
1281#define udiv_qrnnd(q, r, n1, n0, d) \ 1281#define udiv_qrnnd(q, r, n1, n0, d) \
1282 do { USItype __r; \ 1282 do { USItype __r; \
1283 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \ 1283 (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
1284 (r) = __r; \ 1284 (r) = __r; \
1285 } while (0) 1285 } while (0)
1286extern USItype __udiv_qrnnd (); 1286extern USItype __udiv_qrnnd ();
1287#define UDIV_TIME 140 1287#define UDIV_TIME 140
1288#endif /* LONGLONG_STANDALONE */ 1288#endif /* LONGLONG_STANDALONE */
1289#endif /* udiv_qrnnd */ 1289#endif /* udiv_qrnnd */
1290#endif /* __sparc__ */ 1290#endif /* __sparc__ */
1291 1291
1292 1292
1293/*************************************** 1293/***************************************
1294 ************** VAX ****************** 1294 ************** VAX ******************
1295 ***************************************/ 1295 ***************************************/
1296#if defined (__vax__) && W_TYPE_SIZE == 32 1296#if defined (__vax__) && W_TYPE_SIZE == 32
1297#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 1297#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
1298 __asm__ ("addl2 %5,%1\n" \ 1298 __asm__ ("addl2 %5,%1\n" \
1299 "adwc %3,%0" \ 1299 "adwc %3,%0" \
1300 : "=g" ((USItype)(sh)), \ 1300 : "=g" ((USItype)(sh)), \
1301 "=&g" ((USItype)(sl)) \ 1301 "=&g" ((USItype)(sl)) \
1302 : "%0" ((USItype)(ah)), \ 1302 : "%0" ((USItype)(ah)), \
1303 "g" ((USItype)(bh)), \ 1303 "g" ((USItype)(bh)), \
1304 "%1" ((USItype)(al)), \ 1304 "%1" ((USItype)(al)), \
1305 "g" ((USItype)(bl))) 1305 "g" ((USItype)(bl)))
1306#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 1306#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
1307 __asm__ ("subl2 %5,%1\n" \ 1307 __asm__ ("subl2 %5,%1\n" \
1308 "sbwc %3,%0" \ 1308 "sbwc %3,%0" \
1309 : "=g" ((USItype)(sh)), \ 1309 : "=g" ((USItype)(sh)), \
1310 "=&g" ((USItype)(sl)) \ 1310 "=&g" ((USItype)(sl)) \
1311 : "0" ((USItype)(ah)), \ 1311 : "0" ((USItype)(ah)), \
1312 "g" ((USItype)(bh)), \ 1312 "g" ((USItype)(bh)), \
1313 "1" ((USItype)(al)), \ 1313 "1" ((USItype)(al)), \
1314 "g" ((USItype)(bl))) 1314 "g" ((USItype)(bl)))
1315#define umul_ppmm(xh, xl, m0, m1) \ 1315#define umul_ppmm(xh, xl, m0, m1) \
1316 do { \ 1316 do { \
1317 union {UDItype __ll; \ 1317 union {UDItype __ll; \
1318 struct {USItype __l, __h;} __i; \ 1318 struct {USItype __l, __h;} __i; \
1319 } __xx; \ 1319 } __xx; \
1320 USItype __m0 = (m0), __m1 = (m1); \ 1320 USItype __m0 = (m0), __m1 = (m1); \
1321 __asm__ ("emul %1,%2,$0,%0" \ 1321 __asm__ ("emul %1,%2,$0,%0" \
1322 : "=g" (__xx.__ll) \ 1322 : "=g" (__xx.__ll) \
1323 : "g" (__m0), \ 1323 : "g" (__m0), \
1324 "g" (__m1)); \ 1324 "g" (__m1)); \
1325 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \ 1325 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \
1326 (xh) += ((((SItype) __m0 >> 31) & __m1) \ 1326 (xh) += ((((SItype) __m0 >> 31) & __m1) \
1327 + (((SItype) __m1 >> 31) & __m0)); \ 1327 + (((SItype) __m1 >> 31) & __m0)); \
1328 } while (0) 1328 } while (0)
1329#define sdiv_qrnnd(q, r, n1, n0, d) \ 1329#define sdiv_qrnnd(q, r, n1, n0, d) \
1330 do { \ 1330 do { \
1331 union {DItype __ll; \ 1331 union {DItype __ll; \
1332 struct {SItype __l, __h;} __i; \ 1332 struct {SItype __l, __h;} __i; \
1333 } __xx; \ 1333 } __xx; \
1334 __xx.__i.__h = n1; __xx.__i.__l = n0; \ 1334 __xx.__i.__h = n1; __xx.__i.__l = n0; \
1335 __asm__ ("ediv %3,%2,%0,%1" \ 1335 __asm__ ("ediv %3,%2,%0,%1" \
1336 : "=g" (q), "=g" (r) \ 1336 : "=g" (q), "=g" (r) \
1337 : "g" (__xx.__ll), "g" (d)); \ 1337 : "g" (__xx.__ll), "g" (d)); \
1338 } while (0) 1338 } while (0)
1339#endif /* __vax__ */ 1339#endif /* __vax__ */
1340 1340
1341 1341
1342/*************************************** 1342/***************************************
1343 ************** Z8000 **************** 1343 ************** Z8000 ****************
1344 ***************************************/ 1344 ***************************************/
1345#if defined (__z8000__) && W_TYPE_SIZE == 16 1345#if defined (__z8000__) && W_TYPE_SIZE == 16
1346#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 1346#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
1347 __asm__ ("add %H1,%H5\n\tadc %H0,%H3" \ 1347 __asm__ ("add %H1,%H5\n\tadc %H0,%H3" \
1348 : "=r" ((unsigned int)(sh)), \ 1348 : "=r" ((unsigned int)(sh)), \
1349 "=&r" ((unsigned int)(sl)) \ 1349 "=&r" ((unsigned int)(sl)) \
1350 : "%0" ((unsigned int)(ah)), \ 1350 : "%0" ((unsigned int)(ah)), \
1351 "r" ((unsigned int)(bh)), \ 1351 "r" ((unsigned int)(bh)), \
1352 "%1" ((unsigned int)(al)), \ 1352 "%1" ((unsigned int)(al)), \
1353 "rQR" ((unsigned int)(bl))) 1353 "rQR" ((unsigned int)(bl)))
1354#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 1354#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
1355 __asm__ ("sub %H1,%H5\n\tsbc %H0,%H3" \ 1355 __asm__ ("sub %H1,%H5\n\tsbc %H0,%H3" \
1356 : "=r" ((unsigned int)(sh)), \ 1356 : "=r" ((unsigned int)(sh)), \
1357 "=&r" ((unsigned int)(sl)) \ 1357 "=&r" ((unsigned int)(sl)) \
1358 : "0" ((unsigned int)(ah)), \ 1358 : "0" ((unsigned int)(ah)), \
1359 "r" ((unsigned int)(bh)), \ 1359 "r" ((unsigned int)(bh)), \
1360 "1" ((unsigned int)(al)), \ 1360 "1" ((unsigned int)(al)), \
1361 "rQR" ((unsigned int)(bl))) 1361 "rQR" ((unsigned int)(bl)))
1362#define umul_ppmm(xh, xl, m0, m1) \ 1362#define umul_ppmm(xh, xl, m0, m1) \
1363 do { \ 1363 do { \
1364 union {long int __ll; \ 1364 union {long int __ll; \
1365 struct {unsigned int __h, __l;} __i; \ 1365 struct {unsigned int __h, __l;} __i; \
1366 } __xx; \ 1366 } __xx; \
1367 unsigned int __m0 = (m0), __m1 = (m1); \ 1367 unsigned int __m0 = (m0), __m1 = (m1); \
1368 __asm__ ("mult %S0,%H3" \ 1368 __asm__ ("mult %S0,%H3" \
1369 : "=r" (__xx.__i.__h), \ 1369 : "=r" (__xx.__i.__h), \
1370 "=r" (__xx.__i.__l) \ 1370 "=r" (__xx.__i.__l) \
1371 : "%1" (__m0), \ 1371 : "%1" (__m0), \
1372 "rQR" (__m1)); \ 1372 "rQR" (__m1)); \
1373 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \ 1373 (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \
1374 (xh) += ((((signed int) __m0 >> 15) & __m1) \ 1374 (xh) += ((((signed int) __m0 >> 15) & __m1) \
1375 + (((signed int) __m1 >> 15) & __m0)); \ 1375 + (((signed int) __m1 >> 15) & __m0)); \
1376 } while (0) 1376 } while (0)
1377#endif /* __z8000__ */ 1377#endif /* __z8000__ */
1378 1378
1379#endif /* __GNUC__ */ 1379#endif /* __GNUC__ */
1380#endif /* !__riscos__ */ 1380#endif /* !__riscos__ */
1381 1381
1382 1382
1383/*************************************** 1383/***************************************
1384 *********** Generic Versions ******** 1384 *********** Generic Versions ********
1385 ***************************************/ 1385 ***************************************/
1386#if !defined (umul_ppmm) && defined (__umulsidi3) 1386#if !defined (umul_ppmm) && defined (__umulsidi3)
1387#define umul_ppmm(ph, pl, m0, m1) \ 1387#define umul_ppmm(ph, pl, m0, m1) \
1388 { \ 1388 { \
1389 UDWtype __ll = __umulsidi3 (m0, m1); \ 1389 UDWtype __ll = __umulsidi3 (m0, m1); \
1390 ph = (UWtype) (__ll >> W_TYPE_SIZE); \ 1390 ph = (UWtype) (__ll >> W_TYPE_SIZE); \
1391 pl = (UWtype) __ll; \ 1391 pl = (UWtype) __ll; \
1392 } 1392 }
1393#endif 1393#endif
1394 1394
1395#if !defined (__umulsidi3) 1395#if !defined (__umulsidi3)
1396#define __umulsidi3(u, v) \ 1396#define __umulsidi3(u, v) \
1397 ({UWtype __hi, __lo; \ 1397 ({UWtype __hi, __lo; \
1398 umul_ppmm (__hi, __lo, u, v); \ 1398 umul_ppmm (__hi, __lo, u, v); \
1399 ((UDWtype) __hi << W_TYPE_SIZE) | __lo; }) 1399 ((UDWtype) __hi << W_TYPE_SIZE) | __lo; })
1400#endif 1400#endif
1401 1401
1402/* If this machine has no inline assembler, use C macros. */ 1402/* If this machine has no inline assembler, use C macros. */
1403 1403
1404#if !defined (add_ssaaaa) 1404#if !defined (add_ssaaaa)
1405#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 1405#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
1406 do { \ 1406 do { \
1407 UWtype __x; \ 1407 UWtype __x; \
1408 __x = (al) + (bl); \ 1408 __x = (al) + (bl); \
1409 (sh) = (ah) + (bh) + (__x < (al)); \ 1409 (sh) = (ah) + (bh) + (__x < (al)); \
1410 (sl) = __x; \ 1410 (sl) = __x; \
1411 } while (0) 1411 } while (0)
1412#endif 1412#endif
1413 1413
1414#if !defined (sub_ddmmss) 1414#if !defined (sub_ddmmss)
1415#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 1415#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
1416 do { \ 1416 do { \
1417 UWtype __x; \ 1417 UWtype __x; \
1418 __x = (al) - (bl); \ 1418 __x = (al) - (bl); \
1419 (sh) = (ah) - (bh) - (__x > (al)); \ 1419 (sh) = (ah) - (bh) - (__x > (al)); \
1420 (sl) = __x; \ 1420 (sl) = __x; \
1421 } while (0) 1421 } while (0)
1422#endif 1422#endif
1423 1423
1424#if !defined (umul_ppmm) 1424#if !defined (umul_ppmm)
1425#define umul_ppmm(w1, w0, u, v) \ 1425#define umul_ppmm(w1, w0, u, v) \
1426 do { \ 1426 do { \
1427 UWtype __x0, __x1, __x2, __x3; \ 1427 UWtype __x0, __x1, __x2, __x3; \
1428 UHWtype __ul, __vl, __uh, __vh; \ 1428 UHWtype __ul, __vl, __uh, __vh; \
1429 UWtype __u = (u), __v = (v); \ 1429 UWtype __u = (u), __v = (v); \
1430 \ 1430 \
1431 __ul = __ll_lowpart (__u); \ 1431 __ul = __ll_lowpart (__u); \
1432 __uh = __ll_highpart (__u); \ 1432 __uh = __ll_highpart (__u); \
1433 __vl = __ll_lowpart (__v); \ 1433 __vl = __ll_lowpart (__v); \
1434 __vh = __ll_highpart (__v); \ 1434 __vh = __ll_highpart (__v); \
1435 \ 1435 \
1436 __x0 = (UWtype) __ul * __vl; \ 1436 __x0 = (UWtype) __ul * __vl; \
1437 __x1 = (UWtype) __ul * __vh; \ 1437 __x1 = (UWtype) __ul * __vh; \
1438 __x2 = (UWtype) __uh * __vl; \ 1438 __x2 = (UWtype) __uh * __vl; \
1439 __x3 = (UWtype) __uh * __vh; \ 1439 __x3 = (UWtype) __uh * __vh; \
1440 \ 1440 \
1441 __x1 += __ll_highpart (__x0);/* this can't give carry */ \ 1441 __x1 += __ll_highpart (__x0);/* this can't give carry */ \
1442 __x1 += __x2; /* but this indeed can */ \ 1442 __x1 += __x2; /* but this indeed can */ \
1443 if (__x1 < __x2) /* did we get it? */ \ 1443 if (__x1 < __x2) /* did we get it? */ \
1444 __x3 += __ll_B; /* yes, add it in the proper pos. */ \ 1444 __x3 += __ll_B; /* yes, add it in the proper pos. */ \
1445 \ 1445 \
1446 (w1) = __x3 + __ll_highpart (__x1); \ 1446 (w1) = __x3 + __ll_highpart (__x1); \
1447 (w0) = (__ll_lowpart (__x1) << W_TYPE_SIZE/2) + __ll_lowpart (__x0);\ 1447 (w0) = (__ll_lowpart (__x1) << W_TYPE_SIZE/2) + __ll_lowpart (__x0);\
1448 } while (0) 1448 } while (0)
1449#endif 1449#endif
1450 1450
1451#if !defined (umul_ppmm) 1451#if !defined (umul_ppmm)
1452#define smul_ppmm(w1, w0, u, v) \ 1452#define smul_ppmm(w1, w0, u, v) \
1453 do { \ 1453 do { \
1454 UWtype __w1; \ 1454 UWtype __w1; \
1455 UWtype __m0 = (u), __m1 = (v); \ 1455 UWtype __m0 = (u), __m1 = (v); \
1456 umul_ppmm (__w1, w0, __m0, __m1); \ 1456 umul_ppmm (__w1, w0, __m0, __m1); \
1457 (w1) = __w1 - (-(__m0 >> (W_TYPE_SIZE - 1)) & __m1) \ 1457 (w1) = __w1 - (-(__m0 >> (W_TYPE_SIZE - 1)) & __m1) \
1458 - (-(__m1 >> (W_TYPE_SIZE - 1)) & __m0); \ 1458 - (-(__m1 >> (W_TYPE_SIZE - 1)) & __m0); \
1459 } while (0) 1459 } while (0)
1460#endif 1460#endif
1461 1461
1462/* Define this unconditionally, so it can be used for debugging. */ 1462/* Define this unconditionally, so it can be used for debugging. */
1463#define __udiv_qrnnd_c(q, r, n1, n0, d) \ 1463#define __udiv_qrnnd_c(q, r, n1, n0, d) \
1464 do { \ 1464 do { \
1465 UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m; \ 1465 UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m; \
1466 __d1 = __ll_highpart (d); \ 1466 __d1 = __ll_highpart (d); \
1467 __d0 = __ll_lowpart (d); \ 1467 __d0 = __ll_lowpart (d); \
1468 \ 1468 \
1469 __r1 = (n1) % __d1; \ 1469 __r1 = (n1) % __d1; \
1470 __q1 = (n1) / __d1; \ 1470 __q1 = (n1) / __d1; \
1471 __m = (UWtype) __q1 * __d0; \ 1471 __m = (UWtype) __q1 * __d0; \
1472 __r1 = __r1 * __ll_B | __ll_highpart (n0); \ 1472 __r1 = __r1 * __ll_B | __ll_highpart (n0); \
1473 if (__r1 < __m) \ 1473 if (__r1 < __m) \
1474 { \ 1474 { \
1475 __q1--, __r1 += (d); \ 1475 __q1--, __r1 += (d); \
1476 if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\ 1476 if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
1477 if (__r1 < __m) \ 1477 if (__r1 < __m) \
1478 __q1--, __r1 += (d); \ 1478 __q1--, __r1 += (d); \
1479 } \ 1479 } \
1480 __r1 -= __m; \ 1480 __r1 -= __m; \
1481 \ 1481 \
1482 __r0 = __r1 % __d1; \ 1482 __r0 = __r1 % __d1; \
1483 __q0 = __r1 / __d1; \ 1483 __q0 = __r1 / __d1; \
1484 __m = (UWtype) __q0 * __d0; \ 1484 __m = (UWtype) __q0 * __d0; \
1485 __r0 = __r0 * __ll_B | __ll_lowpart (n0); \ 1485 __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
1486 if (__r0 < __m) \ 1486 if (__r0 < __m) \
1487 { \ 1487 { \
1488 __q0--, __r0 += (d); \ 1488 __q0--, __r0 += (d); \
1489 if (__r0 >= (d)) \ 1489 if (__r0 >= (d)) \
1490 if (__r0 < __m) \ 1490 if (__r0 < __m) \
1491 __q0--, __r0 += (d); \ 1491 __q0--, __r0 += (d); \
1492 } \ 1492 } \
1493 __r0 -= __m; \ 1493 __r0 -= __m; \
1494 \ 1494 \
1495 (q) = (UWtype) __q1 * __ll_B | __q0; \ 1495 (q) = (UWtype) __q1 * __ll_B | __q0; \
1496 (r) = __r0; \ 1496 (r) = __r0; \
1497 } while (0) 1497 } while (0)
1498 1498
1499/* If the processor has no udiv_qrnnd but sdiv_qrnnd, go through 1499/* If the processor has no udiv_qrnnd but sdiv_qrnnd, go through
1500 __udiv_w_sdiv (defined in libgcc or elsewhere). */ 1500 __udiv_w_sdiv (defined in libgcc or elsewhere). */
1501#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd) 1501#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd)
1502#define udiv_qrnnd(q, r, nh, nl, d) \ 1502#define udiv_qrnnd(q, r, nh, nl, d) \
1503 do { \ 1503 do { \
1504 UWtype __r; \ 1504 UWtype __r; \
1505 (q) = __MPN(udiv_w_sdiv) (&__r, nh, nl, d); \ 1505 (q) = __MPN(udiv_w_sdiv) (&__r, nh, nl, d); \
1506 (r) = __r; \ 1506 (r) = __r; \
1507 } while (0) 1507 } while (0)
1508#endif 1508#endif
1509 1509
1510/* If udiv_qrnnd was not defined for this processor, use __udiv_qrnnd_c. */ 1510/* If udiv_qrnnd was not defined for this processor, use __udiv_qrnnd_c. */
1511#if !defined (udiv_qrnnd) 1511#if !defined (udiv_qrnnd)
1512#define UDIV_NEEDS_NORMALIZATION 1 1512#define UDIV_NEEDS_NORMALIZATION 1
1513#define udiv_qrnnd __udiv_qrnnd_c 1513#define udiv_qrnnd __udiv_qrnnd_c
1514#endif 1514#endif
1515 1515
1516#if !defined (count_leading_zeros) 1516#if !defined (count_leading_zeros)
1517extern 1517extern
1518#ifdef __STDC__ 1518#ifdef __STDC__
1519const 1519const
1520#endif 1520#endif
1521unsigned char _gcry_clz_tab[]; 1521unsigned char _gcry_clz_tab[];
1522#define MPI_INTERNAL_NEED_CLZ_TAB 1 1522#define MPI_INTERNAL_NEED_CLZ_TAB 1
1523#define count_leading_zeros(count, x) \ 1523#define count_leading_zeros(count, x) \
1524 do { \ 1524 do { \
1525 UWtype __xr = (x); \ 1525 UWtype __xr = (x); \
1526 UWtype __a; \ 1526 UWtype __a; \
1527 \ 1527 \
1528 if (W_TYPE_SIZE <= 32) \ 1528 if (W_TYPE_SIZE <= 32) \
1529 { \ 1529 { \
1530 __a = __xr < ((UWtype) 1 << 2*__BITS4) \ 1530 __a = __xr < ((UWtype) 1 << 2*__BITS4) \
1531 ? (__xr < ((UWtype) 1 << __BITS4) ? 0 : __BITS4) \ 1531 ? (__xr < ((UWtype) 1 << __BITS4) ? 0 : __BITS4) \
1532 : (__xr < ((UWtype) 1 << 3*__BITS4) ? 2*__BITS4 : 3*__BITS4);\ 1532 : (__xr < ((UWtype) 1 << 3*__BITS4) ? 2*__BITS4 : 3*__BITS4);\
1533 } \ 1533 } \
1534 else \ 1534 else \
1535 { \ 1535 { \
1536 for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \ 1536 for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \
1537 if (((__xr >> __a) & 0xff) != 0) \ 1537 if (((__xr >> __a) & 0xff) != 0) \
1538 break; \ 1538 break; \
1539 } \ 1539 } \
1540 \ 1540 \
1541 (count) = W_TYPE_SIZE - (_gcry_clz_tab[__xr >> __a] + __a); \ 1541 (count) = W_TYPE_SIZE - (_gcry_clz_tab[__xr >> __a] + __a); \
1542 } while (0) 1542 } while (0)
1543/* This version gives a well-defined value for zero. */ 1543/* This version gives a well-defined value for zero. */
1544#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE 1544#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE
1545#endif 1545#endif
1546 1546
1547#if !defined (count_trailing_zeros) 1547#if !defined (count_trailing_zeros)
1548/* Define count_trailing_zeros using count_leading_zeros. The latter might be 1548/* Define count_trailing_zeros using count_leading_zeros. The latter might be
1549 defined in asm, but if it is not, the C version above is good enough. */ 1549 defined in asm, but if it is not, the C version above is good enough. */
1550#define count_trailing_zeros(count, x) \ 1550#define count_trailing_zeros(count, x) \
1551 do { \ 1551 do { \
1552 UWtype __ctz_x = (x); \ 1552 UWtype __ctz_x = (x); \
1553 UWtype __ctz_c; \ 1553 UWtype __ctz_c; \
1554 count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x); \ 1554 count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x); \
1555 (count) = W_TYPE_SIZE - 1 - __ctz_c; \ 1555 (count) = W_TYPE_SIZE - 1 - __ctz_c; \
1556 } while (0) 1556 } while (0)
1557#endif 1557#endif
1558 1558
1559#ifndef UDIV_NEEDS_NORMALIZATION 1559#ifndef UDIV_NEEDS_NORMALIZATION
1560#define UDIV_NEEDS_NORMALIZATION 0 1560#define UDIV_NEEDS_NORMALIZATION 0
1561#endif 1561#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/Manifest
index a7484d5..8e0538a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/Manifest
@@ -1,25 +1,25 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser general Public License as 7# it under the terms of the GNU Lesser general Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20syntax.h 20syntax.h
21mpih-lshift.S 21mpih-lshift.S
22mpih-rshift.S 22mpih-rshift.S
23mpih-add1.S 23mpih-add1.S
24mpih-sub1.S 24mpih-sub1.S
25$names$ iQCVAwUAP+LmTDEAnp832S/7AQJHUAP/dxfq2U0pDc5ZLoEizoqgjjcnHIyb9EjMG3YjvgK6jQ62yoAOCuo/jFYlJS+Mdve6bgfdTzYMrnKV7BG2SEcwb263pVnIntS7ZhKQPiMCbFgXWR2VjN3+a1v8yjQDZtgqEgm8OlQ+u7jKBY13Oryiuq5nPNxsXZqJpelG6Zkdg9M==PIee 25$names$ iQCVAwUAP+LmTDEAnp832S/7AQJHUAP/dxfq2U0pDc5ZLoEizoqgjjcnHIyb9EjMG3YjvgK6jQ62yoAOCuo/jFYlJS+Mdve6bgfdTzYMrnKV7BG2SEcwb263pVnIntS7ZhKQPiMCbFgXWR2VjN3+a1v8yjQDZtgqEgm8OlQ+u7jKBY13Oryiuq5nPNxsXZqJpelG6Zkdg9M==PIee
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/distfiles
index a97702f..1e2e36f 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/distfiles
@@ -1,9 +1,9 @@
1Manifest 1Manifest
2syntax.h 2syntax.h
3mpih-lshift.S 3mpih-lshift.S
4mpih-rshift.S 4mpih-rshift.S
5mpih-add1.S 5mpih-add1.S
6mpih-sub1.S 6mpih-sub1.S
7 7
8 8
9 9
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/Manifest
index d1098e6..bcb2768 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/Manifest
@@ -1,23 +1,23 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser general Public License as 7# it under the terms of the GNU Lesser general Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-mul1.S 20mpih-mul1.S
21mpih-mul2.S 21mpih-mul2.S
22mpih-mul3.S 22mpih-mul3.S
23$names$ iQCVAwUAP+LmRTEAnp832S/7AQK3rwP/TyGBbii5HCrjDiLCVJHiDNeOdENx6AicRXnu4vuJmMmPZ0y+i7MPusDaeTbIUA0w6RaJx+Ep41nIvthmNDnFePY5Mw0pIUJcpI7AJR4vYqpwNQA6nlEdn/m1jg6sPLKZXUXNUkhroEzcHzoU+12BPS+nvSXlwSksg6rXEGOJ+Ms==XCXP 23$names$ iQCVAwUAP+LmRTEAnp832S/7AQK3rwP/TyGBbii5HCrjDiLCVJHiDNeOdENx6AicRXnu4vuJmMmPZ0y+i7MPusDaeTbIUA0w6RaJx+Ep41nIvthmNDnFePY5Mw0pIUJcpI7AJR4vYqpwNQA6nlEdn/m1jg6sPLKZXUXNUkhroEzcHzoU+12BPS+nvSXlwSksg6rXEGOJ+Ms==XCXP
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/distfiles
index 2e5d20f..6b96433 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/distfiles
@@ -1,4 +1,4 @@
1Manifest 1Manifest
2mpih-mul1.S 2mpih-mul1.S
3mpih-mul2.S 3mpih-mul2.S
4mpih-mul3.S 4mpih-mul3.S
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul1.S
index 779af10..007c94c 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul1.S
@@ -1,104 +1,104 @@
1/* mc68020 __mpn_mul_1 -- Multiply a limb vector with a limb and store 1/* mc68020 __mpn_mul_1 -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1996, 1998, 4 * Copyright (C) 1992, 1994, 1996, 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 31
32#include "sysdep.h" 32#include "sysdep.h"
33#include "asm-syntax.h" 33#include "asm-syntax.h"
34 34
35 35
36/******************* 36/*******************
37 * mpi_limb_t 37 * mpi_limb_t
38 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (sp + 4) 38 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (sp + 4)
39 * mpi_ptr_t s1_ptr, (sp + 8) 39 * mpi_ptr_t s1_ptr, (sp + 8)
40 * mpi_size_t s1_size, (sp + 12) 40 * mpi_size_t s1_size, (sp + 12)
41 * mpi_limb_t s2_limb) (sp + 16) 41 * mpi_limb_t s2_limb) (sp + 16)
42 */ 42 */
43 43
44 44
45 TEXT 45 TEXT
46 ALIGN 46 ALIGN
47 GLOBL C_SYMBOL_NAME(_gcry_mpih_mul_1) 47 GLOBL C_SYMBOL_NAME(_gcry_mpih_mul_1)
48 48
49C_SYMBOL_NAME(_gcry_mpih_mul_1:) 49C_SYMBOL_NAME(_gcry_mpih_mul_1:)
50PROLOG(_gcry_mpih_mul_1) 50PROLOG(_gcry_mpih_mul_1)
51 51
52#define res_ptr a0 52#define res_ptr a0
53#define s1_ptr a1 53#define s1_ptr a1
54#define s1_size d2 54#define s1_size d2
55#define s2_limb d4 55#define s2_limb d4
56 56
57/* Save used registers on the stack. */ 57/* Save used registers on the stack. */
58 moveml R(d2)-R(d4),MEM_PREDEC(sp) 58 moveml R(d2)-R(d4),MEM_PREDEC(sp)
59#if 0 59#if 0
60 movel R(d2),MEM_PREDEC(sp) 60 movel R(d2),MEM_PREDEC(sp)
61 movel R(d3),MEM_PREDEC(sp) 61 movel R(d3),MEM_PREDEC(sp)
62 movel R(d4),MEM_PREDEC(sp) 62 movel R(d4),MEM_PREDEC(sp)
63#endif 63#endif
64 64
65/* Copy the arguments to registers. Better use movem? */ 65/* Copy the arguments to registers. Better use movem? */
66 movel MEM_DISP(sp,16),R(res_ptr) 66 movel MEM_DISP(sp,16),R(res_ptr)
67 movel MEM_DISP(sp,20),R(s1_ptr) 67 movel MEM_DISP(sp,20),R(s1_ptr)
68 movel MEM_DISP(sp,24),R(s1_size) 68 movel MEM_DISP(sp,24),R(s1_size)
69 movel MEM_DISP(sp,28),R(s2_limb) 69 movel MEM_DISP(sp,28),R(s2_limb)
70 70
71 eorw #1,R(s1_size) 71 eorw #1,R(s1_size)
72 clrl R(d1) 72 clrl R(d1)
73 lsrl #1,R(s1_size) 73 lsrl #1,R(s1_size)
74 bcc L(L1) 74 bcc L(L1)
75 subql #1,R(s1_size) 75 subql #1,R(s1_size)
76 subl R(d0),R(d0) /* (d0,cy) <= (0,0) */ 76 subl R(d0),R(d0) /* (d0,cy) <= (0,0) */
77 77
78L(Loop:) 78L(Loop:)
79 movel MEM_POSTINC(s1_ptr),R(d3) 79 movel MEM_POSTINC(s1_ptr),R(d3)
80 mulul R(s2_limb),R(d1):R(d3) 80 mulul R(s2_limb),R(d1):R(d3)
81 addxl R(d0),R(d3) 81 addxl R(d0),R(d3)
82 movel R(d3),MEM_POSTINC(res_ptr) 82 movel R(d3),MEM_POSTINC(res_ptr)
83L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) 83L(L1:) movel MEM_POSTINC(s1_ptr),R(d3)
84 mulul R(s2_limb),R(d0):R(d3) 84 mulul R(s2_limb),R(d0):R(d3)
85 addxl R(d1),R(d3) 85 addxl R(d1),R(d3)
86 movel R(d3),MEM_POSTINC(res_ptr) 86 movel R(d3),MEM_POSTINC(res_ptr)
87 87
88 dbf R(s1_size),L(Loop) 88 dbf R(s1_size),L(Loop)
89 clrl R(d3) 89 clrl R(d3)
90 addxl R(d3),R(d0) 90 addxl R(d3),R(d0)
91 subl #0x10000,R(s1_size) 91 subl #0x10000,R(s1_size)
92 bcc L(Loop) 92 bcc L(Loop)
93 93
94/* Restore used registers from stack frame. */ 94/* Restore used registers from stack frame. */
95 moveml MEM_POSTINC(sp),R(d2)-R(d4) 95 moveml MEM_POSTINC(sp),R(d2)-R(d4)
96#if 0 96#if 0
97 movel MEM_POSTINC(sp),R(d4) 97 movel MEM_POSTINC(sp),R(d4)
98 movel MEM_POSTINC(sp),R(d3) 98 movel MEM_POSTINC(sp),R(d3)
99 movel MEM_POSTINC(sp),R(d2) 99 movel MEM_POSTINC(sp),R(d2)
100#endif 100#endif
101 rts 101 rts
102EPILOG(_gcry_mpih_mul_1) 102EPILOG(_gcry_mpih_mul_1)
103 103
104 104
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul2.S
index f550939..44baa8d 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul2.S
@@ -1,94 +1,94 @@
1/* mc68020 __mpn_addmul_1 -- Multiply a limb vector with a limb and add 1/* mc68020 __mpn_addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1996, 1998, 4 * Copyright (C) 1992, 1994, 1996, 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 * mpi_limb_t 35 * mpi_limb_t
36 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (sp + 4) 36 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (sp + 4)
37 * mpi_ptr_t s1_ptr, (sp + 8) 37 * mpi_ptr_t s1_ptr, (sp + 8)
38 * mpi_size_t s1_size, (sp + 12) 38 * mpi_size_t s1_size, (sp + 12)
39 * mpi_limb_t s2_limb) (sp + 16) 39 * mpi_limb_t s2_limb) (sp + 16)
40 */ 40 */
41 41
42 42
43 TEXT 43 TEXT
44 ALIGN 44 ALIGN
45 GLOBL C_SYMBOL_NAME(_gcry_mpih_addmul_1) 45 GLOBL C_SYMBOL_NAME(_gcry_mpih_addmul_1)
46 46
47C_SYMBOL_NAME(_gcry_mpih_addmul_1:) 47C_SYMBOL_NAME(_gcry_mpih_addmul_1:)
48PROLOG(_gcry_mpih_addmul_1) 48PROLOG(_gcry_mpih_addmul_1)
49 49
50#define res_ptr a0 50#define res_ptr a0
51#define s1_ptr a1 51#define s1_ptr a1
52#define s1_size d2 52#define s1_size d2
53#define s2_limb d4 53#define s2_limb d4
54 54
55/* Save used registers on the stack. */ 55/* Save used registers on the stack. */
56 moveml R(d2)-R(d5),MEM_PREDEC(sp) 56 moveml R(d2)-R(d5),MEM_PREDEC(sp)
57 57
58/* Copy the arguments to registers. Better use movem? */ 58/* Copy the arguments to registers. Better use movem? */
59 movel MEM_DISP(sp,20),R(res_ptr) 59 movel MEM_DISP(sp,20),R(res_ptr)
60 movel MEM_DISP(sp,24),R(s1_ptr) 60 movel MEM_DISP(sp,24),R(s1_ptr)
61 movel MEM_DISP(sp,28),R(s1_size) 61 movel MEM_DISP(sp,28),R(s1_size)
62 movel MEM_DISP(sp,32),R(s2_limb) 62 movel MEM_DISP(sp,32),R(s2_limb)
63 63
64 eorw #1,R(s1_size) 64 eorw #1,R(s1_size)
65 clrl R(d1) 65 clrl R(d1)
66 clrl R(d5) 66 clrl R(d5)
67 lsrl #1,R(s1_size) 67 lsrl #1,R(s1_size)
68 bcc L(L1) 68 bcc L(L1)
69 subql #1,R(s1_size) 69 subql #1,R(s1_size)
70 subl R(d0),R(d0) /* (d0,cy) <= (0,0) */ 70 subl R(d0),R(d0) /* (d0,cy) <= (0,0) */
71 71
72L(Loop:) 72L(Loop:)
73 movel MEM_POSTINC(s1_ptr),R(d3) 73 movel MEM_POSTINC(s1_ptr),R(d3)
74 mulul R(s2_limb),R(d1):R(d3) 74 mulul R(s2_limb),R(d1):R(d3)
75 addxl R(d0),R(d3) 75 addxl R(d0),R(d3)
76 addxl R(d5),R(d1) 76 addxl R(d5),R(d1)
77 addl R(d3),MEM_POSTINC(res_ptr) 77 addl R(d3),MEM_POSTINC(res_ptr)
78L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) 78L(L1:) movel MEM_POSTINC(s1_ptr),R(d3)
79 mulul R(s2_limb),R(d0):R(d3) 79 mulul R(s2_limb),R(d0):R(d3)
80 addxl R(d1),R(d3) 80 addxl R(d1),R(d3)
81 addxl R(d5),R(d0) 81 addxl R(d5),R(d0)
82 addl R(d3),MEM_POSTINC(res_ptr) 82 addl R(d3),MEM_POSTINC(res_ptr)
83 83
84 dbf R(s1_size),L(Loop) 84 dbf R(s1_size),L(Loop)
85 addxl R(d5),R(d0) 85 addxl R(d5),R(d0)
86 subl #0x10000,R(s1_size) 86 subl #0x10000,R(s1_size)
87 bcc L(Loop) 87 bcc L(Loop)
88 88
89/* Restore used registers from stack frame. */ 89/* Restore used registers from stack frame. */
90 moveml MEM_POSTINC(sp),R(d2)-R(d5) 90 moveml MEM_POSTINC(sp),R(d2)-R(d5)
91 91
92 rts 92 rts
93EPILOG(_gcry_mpih_addmul_1) 93EPILOG(_gcry_mpih_addmul_1)
94 94
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul3.S
index b1cc0f0..e958ef6 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mc68020/mpih-mul3.S
@@ -1,97 +1,97 @@
1/* mc68020 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract 1/* mc68020 __mpn_submul_1 -- Multiply a limb vector with a limb and subtract
2 * the result from a second limb vector. 2 * the result from a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1996, 1998, 4 * Copyright (C) 1992, 1994, 1996, 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 31
32 32
33#include "sysdep.h" 33#include "sysdep.h"
34#include "asm-syntax.h" 34#include "asm-syntax.h"
35 35
36/******************* 36/*******************
37 * mpi_limb_t 37 * mpi_limb_t
38 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (sp + 4) 38 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (sp + 4)
39 * mpi_ptr_t s1_ptr, (sp + 8) 39 * mpi_ptr_t s1_ptr, (sp + 8)
40 * mpi_size_t s1_size, (sp + 12) 40 * mpi_size_t s1_size, (sp + 12)
41 * mpi_limb_t s2_limb) (sp + 16) 41 * mpi_limb_t s2_limb) (sp + 16)
42 */ 42 */
43 43
44 44
45 TEXT 45 TEXT
46 ALIGN 46 ALIGN
47 GLOBL C_SYMBOL_NAME(_gcry_mpih_submul_1) 47 GLOBL C_SYMBOL_NAME(_gcry_mpih_submul_1)
48 48
49C_SYMBOL_NAME(_gcry_mpih_submul_1:) 49C_SYMBOL_NAME(_gcry_mpih_submul_1:)
50PROLOG(_gcry_mpih_submul_1) 50PROLOG(_gcry_mpih_submul_1)
51 51
52#define res_ptr a0 52#define res_ptr a0
53#define s1_ptr a1 53#define s1_ptr a1
54#define s1_size d2 54#define s1_size d2
55#define s2_limb d4 55#define s2_limb d4
56 56
57/* Save used registers on the stack. */ 57/* Save used registers on the stack. */
58 moveml R(d2)-R(d5),MEM_PREDEC(sp) 58 moveml R(d2)-R(d5),MEM_PREDEC(sp)
59 59
60/* Copy the arguments to registers. Better use movem? */ 60/* Copy the arguments to registers. Better use movem? */
61 movel MEM_DISP(sp,20),R(res_ptr) 61 movel MEM_DISP(sp,20),R(res_ptr)
62 movel MEM_DISP(sp,24),R(s1_ptr) 62 movel MEM_DISP(sp,24),R(s1_ptr)
63 movel MEM_DISP(sp,28),R(s1_size) 63 movel MEM_DISP(sp,28),R(s1_size)
64 movel MEM_DISP(sp,32),R(s2_limb) 64 movel MEM_DISP(sp,32),R(s2_limb)
65 65
66 eorw #1,R(s1_size) 66 eorw #1,R(s1_size)
67 clrl R(d1) 67 clrl R(d1)
68 clrl R(d5) 68 clrl R(d5)
69 lsrl #1,R(s1_size) 69 lsrl #1,R(s1_size)
70 bcc L(L1) 70 bcc L(L1)
71 subql #1,R(s1_size) 71 subql #1,R(s1_size)
72 subl R(d0),R(d0) /* (d0,cy) <= (0,0) */ 72 subl R(d0),R(d0) /* (d0,cy) <= (0,0) */
73 73
74L(Loop:) 74L(Loop:)
75 movel MEM_POSTINC(s1_ptr),R(d3) 75 movel MEM_POSTINC(s1_ptr),R(d3)
76 mulul R(s2_limb),R(d1):R(d3) 76 mulul R(s2_limb),R(d1):R(d3)
77 addxl R(d0),R(d3) 77 addxl R(d0),R(d3)
78 addxl R(d5),R(d1) 78 addxl R(d5),R(d1)
79 subl R(d3),MEM_POSTINC(res_ptr) 79 subl R(d3),MEM_POSTINC(res_ptr)
80L(L1:) movel MEM_POSTINC(s1_ptr),R(d3) 80L(L1:) movel MEM_POSTINC(s1_ptr),R(d3)
81 mulul R(s2_limb),R(d0):R(d3) 81 mulul R(s2_limb),R(d0):R(d3)
82 addxl R(d1),R(d3) 82 addxl R(d1),R(d3)
83 addxl R(d5),R(d0) 83 addxl R(d5),R(d0)
84 subl R(d3),MEM_POSTINC(res_ptr) 84 subl R(d3),MEM_POSTINC(res_ptr)
85 85
86 dbf R(s1_size),L(Loop) 86 dbf R(s1_size),L(Loop)
87 addxl R(d5),R(d0) 87 addxl R(d5),R(d0)
88 subl #0x10000,R(s1_size) 88 subl #0x10000,R(s1_size)
89 bcc L(Loop) 89 bcc L(Loop)
90 90
91/* Restore used registers from stack frame. */ 91/* Restore used registers from stack frame. */
92 moveml MEM_POSTINC(sp),R(d2)-R(d5) 92 moveml MEM_POSTINC(sp),R(d2)-R(d5)
93 93
94 rts 94 rts
95EPILOG(_gcry_mpih_submul_1) 95EPILOG(_gcry_mpih_submul_1)
96 96
97 97
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-add1.S
index e4ae12f..8182d21 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-add1.S
@@ -1,92 +1,92 @@
1/* mc68020 __mpn_add_n -- Add two limb vectors of the same length > 0 and store 1/* mc68020 __mpn_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,1996, 1998, 4 * Copyright (C) 1992, 1994,1996, 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 + 16) 39 * mpi_ptr_t s2_ptr, (sp + 16)
40 * mpi_size_t size) (sp + 12) 40 * mpi_size_t size) (sp + 12)
41 */ 41 */
42 42
43 43
44 TEXT 44 TEXT
45 ALIGN 45 ALIGN
46 GLOBL C_SYMBOL_NAME(_gcry_mpih_add_n) 46 GLOBL C_SYMBOL_NAME(_gcry_mpih_add_n)
47 47
48C_SYMBOL_NAME(_gcry_mpih_add_n:) 48C_SYMBOL_NAME(_gcry_mpih_add_n:)
49PROLOG(_gcry_mpih_add_n) 49PROLOG(_gcry_mpih_add_n)
50 /* Save used registers on the stack. */ 50 /* Save used registers on the stack. */
51 movel R(d2),MEM_PREDEC(sp) 51 movel R(d2),MEM_PREDEC(sp)
52 movel R(a2),MEM_PREDEC(sp) 52 movel R(a2),MEM_PREDEC(sp)
53 53
54 /* Copy the arguments to registers. Better use movem? */ 54 /* Copy the arguments to registers. Better use movem? */
55 movel MEM_DISP(sp,12),R(a2) 55 movel MEM_DISP(sp,12),R(a2)
56 movel MEM_DISP(sp,16),R(a0) 56 movel MEM_DISP(sp,16),R(a0)
57 movel MEM_DISP(sp,20),R(a1) 57 movel MEM_DISP(sp,20),R(a1)
58 movel MEM_DISP(sp,24),R(d2) 58 movel MEM_DISP(sp,24),R(d2)
59 59
60 eorw #1,R(d2) 60 eorw #1,R(d2)
61 lsrl #1,R(d2) 61 lsrl #1,R(d2)
62 bcc L(L1) 62 bcc L(L1)
63 subql #1,R(d2) /* clears cy as side effect */ 63 subql #1,R(d2) /* clears cy as side effect */
64 64
65L(Loop:) 65L(Loop:)
66 movel MEM_POSTINC(a0),R(d0) 66 movel MEM_POSTINC(a0),R(d0)
67 movel MEM_POSTINC(a1),R(d1) 67 movel MEM_POSTINC(a1),R(d1)
68 addxl R(d1),R(d0) 68 addxl R(d1),R(d0)
69 movel R(d0),MEM_POSTINC(a2) 69 movel R(d0),MEM_POSTINC(a2)
70L(L1:) movel MEM_POSTINC(a0),R(d0) 70L(L1:) movel MEM_POSTINC(a0),R(d0)
71 movel MEM_POSTINC(a1),R(d1) 71 movel MEM_POSTINC(a1),R(d1)
72 addxl R(d1),R(d0) 72 addxl R(d1),R(d0)
73 movel R(d0),MEM_POSTINC(a2) 73 movel R(d0),MEM_POSTINC(a2)
74 74
75 dbf R(d2),L(Loop) /* loop until 16 lsb of %4 == -1 */ 75 dbf R(d2),L(Loop) /* loop until 16 lsb of %4 == -1 */
76 subxl R(d0),R(d0) /* d0 <= -cy; save cy as 0 or -1 in d0 */ 76 subxl R(d0),R(d0) /* d0 <= -cy; save cy as 0 or -1 in d0 */
77 subl #0x10000,R(d2) 77 subl #0x10000,R(d2)
78 bcs L(L2) 78 bcs L(L2)
79 addl R(d0),R(d0) /* restore cy */ 79 addl R(d0),R(d0) /* restore cy */
80 bra L(Loop) 80 bra L(Loop)
81 81
82L(L2:) 82L(L2:)
83 negl R(d0) 83 negl R(d0)
84 84
85 /* Restore used registers from stack frame. */ 85 /* Restore used registers from stack frame. */
86 movel MEM_POSTINC(sp),R(a2) 86 movel MEM_POSTINC(sp),R(a2)
87 movel MEM_POSTINC(sp),R(d2) 87 movel MEM_POSTINC(sp),R(d2)
88 88
89 rts 89 rts
90EPILOG(_gcry_mpih_add_n) 90EPILOG(_gcry_mpih_add_n)
91 91
92 92
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-lshift.S
index 1c2ec35..133d1aa 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-lshift.S
@@ -1,164 +1,164 @@
1/* mc68020 lshift -- Shift left a low-level natural-number integer. 1/* mc68020 lshift -- Shift left a low-level natural-number integer.
2 * 2 *
3 * Copyright (C) 1996, 1998, 2001, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1996, 1998, 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28 28
29#include "sysdep.h" 29#include "sysdep.h"
30#include "asm-syntax.h" 30#include "asm-syntax.h"
31 31
32 32
33/******************* 33/*******************
34 * mpi_limb_t 34 * mpi_limb_t
35 * _gcry_mpih_lshift( mpi_ptr_t wp, (sp + 4) 35 * _gcry_mpih_lshift( mpi_ptr_t wp, (sp + 4)
36 * mpi_ptr_t up, (sp + 8) 36 * mpi_ptr_t up, (sp + 8)
37 * mpi_size_t usize, (sp + 12) 37 * mpi_size_t usize, (sp + 12)
38 * unsigned cnt) (sp + 16) 38 * unsigned cnt) (sp + 16)
39 */ 39 */
40 40
41#define res_ptr a1 41#define res_ptr a1
42#define s_ptr a0 42#define s_ptr a0
43#define s_size d6 43#define s_size d6
44#define cnt d4 44#define cnt d4
45 45
46 TEXT 46 TEXT
47 ALIGN 47 ALIGN
48 GLOBL C_SYMBOL_NAME(_gcry_mpih_lshift) 48 GLOBL C_SYMBOL_NAME(_gcry_mpih_lshift)
49 49
50C_SYMBOL_NAME(_gcry_mpih_lshift:) 50C_SYMBOL_NAME(_gcry_mpih_lshift:)
51PROLOG(_gcry_mpih_lshift) 51PROLOG(_gcry_mpih_lshift)
52 52
53 /* Save used registers on the stack. */ 53 /* Save used registers on the stack. */
54 moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp) 54 moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp)
55 55
56 /* Copy the arguments to registers. */ 56 /* Copy the arguments to registers. */
57 movel MEM_DISP(sp,28),R(res_ptr) 57 movel MEM_DISP(sp,28),R(res_ptr)
58 movel MEM_DISP(sp,32),R(s_ptr) 58 movel MEM_DISP(sp,32),R(s_ptr)
59 movel MEM_DISP(sp,36),R(s_size) 59 movel MEM_DISP(sp,36),R(s_size)
60 movel MEM_DISP(sp,40),R(cnt) 60 movel MEM_DISP(sp,40),R(cnt)
61 61
62 moveql #1,R(d5) 62 moveql #1,R(d5)
63 cmpl R(d5),R(cnt) 63 cmpl R(d5),R(cnt)
64 bne L(Lnormal) 64 bne L(Lnormal)
65 cmpl R(s_ptr),R(res_ptr) 65 cmpl R(s_ptr),R(res_ptr)
66 bls L(Lspecial) /* jump if s_ptr >= res_ptr */ 66 bls L(Lspecial) /* jump if s_ptr >= res_ptr */
67#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) 67#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020))
68 lea MEM_INDX1(s_ptr,s_size,l,4),R(a2) 68 lea MEM_INDX1(s_ptr,s_size,l,4),R(a2)
69#else /* not mc68020 */ 69#else /* not mc68020 */
70 movel R(s_size),R(d0) 70 movel R(s_size),R(d0)
71 asll #2,R(d0) 71 asll #2,R(d0)
72 lea MEM_INDX(s_ptr,d0,l),R(a2) 72 lea MEM_INDX(s_ptr,d0,l),R(a2)
73#endif 73#endif
74 cmpl R(res_ptr),R(a2) 74 cmpl R(res_ptr),R(a2)
75 bls L(Lspecial) /* jump if res_ptr >= s_ptr + s_size */ 75 bls L(Lspecial) /* jump if res_ptr >= s_ptr + s_size */
76 76
77L(Lnormal:) 77L(Lnormal:)
78 moveql #32,R(d5) 78 moveql #32,R(d5)
79 subl R(cnt),R(d5) 79 subl R(cnt),R(d5)
80 80
81#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) 81#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020))
82 lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr) 82 lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr)
83 lea MEM_INDX1(res_ptr,s_size,l,4),R(res_ptr) 83 lea MEM_INDX1(res_ptr,s_size,l,4),R(res_ptr)
84#else /* not mc68000 */ 84#else /* not mc68000 */
85 movel R(s_size),R(d0) 85 movel R(s_size),R(d0)
86 asll #2,R(d0) 86 asll #2,R(d0)
87 addl R(s_size),R(s_ptr) 87 addl R(s_size),R(s_ptr)
88 addl R(s_size),R(res_ptr) 88 addl R(s_size),R(res_ptr)
89#endif 89#endif
90 movel MEM_PREDEC(s_ptr),R(d2) 90 movel MEM_PREDEC(s_ptr),R(d2)
91 movel R(d2),R(d0) 91 movel R(d2),R(d0)
92 lsrl R(d5),R(d0) /* compute carry limb */ 92 lsrl R(d5),R(d0) /* compute carry limb */
93 93
94 lsll R(cnt),R(d2) 94 lsll R(cnt),R(d2)
95 movel R(d2),R(d1) 95 movel R(d2),R(d1)
96 subql #1,R(s_size) 96 subql #1,R(s_size)
97 beq L(Lend) 97 beq L(Lend)
98 lsrl #1,R(s_size) 98 lsrl #1,R(s_size)
99 bcs L(L1) 99 bcs L(L1)
100 subql #1,R(s_size) 100 subql #1,R(s_size)
101 101
102L(Loop:) 102L(Loop:)
103 movel MEM_PREDEC(s_ptr),R(d2) 103 movel MEM_PREDEC(s_ptr),R(d2)
104 movel R(d2),R(d3) 104 movel R(d2),R(d3)
105 lsrl R(d5),R(d3) 105 lsrl R(d5),R(d3)
106 orl R(d3),R(d1) 106 orl R(d3),R(d1)
107 movel R(d1),MEM_PREDEC(res_ptr) 107 movel R(d1),MEM_PREDEC(res_ptr)
108 lsll R(cnt),R(d2) 108 lsll R(cnt),R(d2)
109L(L1:) 109L(L1:)
110 movel MEM_PREDEC(s_ptr),R(d1) 110 movel MEM_PREDEC(s_ptr),R(d1)
111 movel R(d1),R(d3) 111 movel R(d1),R(d3)
112 lsrl R(d5),R(d3) 112 lsrl R(d5),R(d3)
113 orl R(d3),R(d2) 113 orl R(d3),R(d2)
114 movel R(d2),MEM_PREDEC(res_ptr) 114 movel R(d2),MEM_PREDEC(res_ptr)
115 lsll R(cnt),R(d1) 115 lsll R(cnt),R(d1)
116 116
117 dbf R(s_size),L(Loop) 117 dbf R(s_size),L(Loop)
118 subl #0x10000,R(s_size) 118 subl #0x10000,R(s_size)
119 bcc L(Loop) 119 bcc L(Loop)
120 120
121L(Lend:) 121L(Lend:)
122 movel R(d1),MEM_PREDEC(res_ptr) /* store least significant limb */ 122 movel R(d1),MEM_PREDEC(res_ptr) /* store least significant limb */
123 123
124/* Restore used registers from stack frame. */ 124/* Restore used registers from stack frame. */
125 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) 125 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2)
126 rts 126 rts
127 127
128/* We loop from least significant end of the arrays, which is only 128/* We loop from least significant end of the arrays, which is only
129 permissable if the source and destination don't overlap, since the 129 permissable if the source and destination don't overlap, since the
130 function is documented to work for overlapping source and destination. */ 130 function is documented to work for overlapping source and destination. */
131 131
132L(Lspecial:) 132L(Lspecial:)
133 clrl R(d0) /* initialize carry */ 133 clrl R(d0) /* initialize carry */
134 eorw #1,R(s_size) 134 eorw #1,R(s_size)
135 lsrl #1,R(s_size) 135 lsrl #1,R(s_size)
136 bcc L(LL1) 136 bcc L(LL1)
137 subql #1,R(s_size) 137 subql #1,R(s_size)
138 138
139L(LLoop:) 139L(LLoop:)
140 movel MEM_POSTINC(s_ptr),R(d2) 140 movel MEM_POSTINC(s_ptr),R(d2)
141 addxl R(d2),R(d2) 141 addxl R(d2),R(d2)
142 movel R(d2),MEM_POSTINC(res_ptr) 142 movel R(d2),MEM_POSTINC(res_ptr)
143L(LL1:) 143L(LL1:)
144 movel MEM_POSTINC(s_ptr),R(d2) 144 movel MEM_POSTINC(s_ptr),R(d2)
145 addxl R(d2),R(d2) 145 addxl R(d2),R(d2)
146 movel R(d2),MEM_POSTINC(res_ptr) 146 movel R(d2),MEM_POSTINC(res_ptr)
147 147
148 dbf R(s_size),L(LLoop) 148 dbf R(s_size),L(LLoop)
149 addxl R(d0),R(d0) /* save cy in lsb */ 149 addxl R(d0),R(d0) /* save cy in lsb */
150 subl #0x10000,R(s_size) 150 subl #0x10000,R(s_size)
151 bcs L(LLend) 151 bcs L(LLend)
152 lsrl #1,R(d0) /* restore cy */ 152 lsrl #1,R(d0) /* restore cy */
153 bra L(LLoop) 153 bra L(LLoop)
154 154
155L(LLend:) 155L(LLend:)
156/* Restore used registers from stack frame. */ 156/* Restore used registers from stack frame. */
157 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) 157 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2)
158 rts 158 rts
159EPILOG(_gcry_mpih_lshift) 159EPILOG(_gcry_mpih_lshift)
160 160
161 161
162 162
163 163
164 164
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-rshift.S
index 89c761d..be9f435 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-rshift.S
@@ -1,162 +1,162 @@
1/* mc68020 rshift -- Shift right a low-level natural-number integer. 1/* mc68020 rshift -- Shift right a low-level natural-number integer.
2 * 2 *
3 * Copyright (C) 1996, 1998, 2001, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1996, 1998, 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28 28
29#include "sysdep.h" 29#include "sysdep.h"
30#include "asm-syntax.h" 30#include "asm-syntax.h"
31 31
32 32
33/******************* 33/*******************
34 * mpi_limb_t 34 * mpi_limb_t
35 * _gcry_mpih_rshift( mpi_ptr_t wp, (sp + 4) 35 * _gcry_mpih_rshift( mpi_ptr_t wp, (sp + 4)
36 * mpi_ptr_t up, (sp + 8) 36 * mpi_ptr_t up, (sp + 8)
37 * mpi_size_t usize, (sp + 12) 37 * mpi_size_t usize, (sp + 12)
38 * unsigned cnt) (sp + 16) 38 * unsigned cnt) (sp + 16)
39 */ 39 */
40 40
41#define res_ptr a1 41#define res_ptr a1
42#define s_ptr a0 42#define s_ptr a0
43#define s_size d6 43#define s_size d6
44#define cnt d4 44#define cnt d4
45 45
46 TEXT 46 TEXT
47 ALIGN 47 ALIGN
48 GLOBL C_SYMBOL_NAME(_gcry_mpih_rshift) 48 GLOBL C_SYMBOL_NAME(_gcry_mpih_rshift)
49 49
50C_SYMBOL_NAME(_gcry_mpih_rshift:) 50C_SYMBOL_NAME(_gcry_mpih_rshift:)
51PROLOG(_gcry_mpih_rshift) 51PROLOG(_gcry_mpih_rshift)
52 /* Save used registers on the stack. */ 52 /* Save used registers on the stack. */
53 moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp) 53 moveml R(d2)-R(d6)/R(a2),MEM_PREDEC(sp)
54 54
55 /* Copy the arguments to registers. */ 55 /* Copy the arguments to registers. */
56 movel MEM_DISP(sp,28),R(res_ptr) 56 movel MEM_DISP(sp,28),R(res_ptr)
57 movel MEM_DISP(sp,32),R(s_ptr) 57 movel MEM_DISP(sp,32),R(s_ptr)
58 movel MEM_DISP(sp,36),R(s_size) 58 movel MEM_DISP(sp,36),R(s_size)
59 movel MEM_DISP(sp,40),R(cnt) 59 movel MEM_DISP(sp,40),R(cnt)
60 60
61 moveql #1,R(d5) 61 moveql #1,R(d5)
62 cmpl R(d5),R(cnt) 62 cmpl R(d5),R(cnt)
63 bne L(Rnormal) 63 bne L(Rnormal)
64 cmpl R(res_ptr),R(s_ptr) 64 cmpl R(res_ptr),R(s_ptr)
65 bls L(Rspecial) /* jump if res_ptr >= s_ptr */ 65 bls L(Rspecial) /* jump if res_ptr >= s_ptr */
66#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) 66#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020))
67 lea MEM_INDX1(res_ptr,s_size,l,4),R(a2) 67 lea MEM_INDX1(res_ptr,s_size,l,4),R(a2)
68#else /* not mc68020 */ 68#else /* not mc68020 */
69 movel R(s_size),R(d0) 69 movel R(s_size),R(d0)
70 asll #2,R(d0) 70 asll #2,R(d0)
71 lea MEM_INDX(res_ptr,d0,l),R(a2) 71 lea MEM_INDX(res_ptr,d0,l),R(a2)
72#endif 72#endif
73 cmpl R(s_ptr),R(a2) 73 cmpl R(s_ptr),R(a2)
74 bls L(Rspecial) /* jump if s_ptr >= res_ptr + s_size */ 74 bls L(Rspecial) /* jump if s_ptr >= res_ptr + s_size */
75 75
76L(Rnormal:) 76L(Rnormal:)
77 moveql #32,R(d5) 77 moveql #32,R(d5)
78 subl R(cnt),R(d5) 78 subl R(cnt),R(d5)
79 movel MEM_POSTINC(s_ptr),R(d2) 79 movel MEM_POSTINC(s_ptr),R(d2)
80 movel R(d2),R(d0) 80 movel R(d2),R(d0)
81 lsll R(d5),R(d0) /* compute carry limb */ 81 lsll R(d5),R(d0) /* compute carry limb */
82 82
83 lsrl R(cnt),R(d2) 83 lsrl R(cnt),R(d2)
84 movel R(d2),R(d1) 84 movel R(d2),R(d1)
85 subql #1,R(s_size) 85 subql #1,R(s_size)
86 beq L(Rend) 86 beq L(Rend)
87 lsrl #1,R(s_size) 87 lsrl #1,R(s_size)
88 bcs L(R1) 88 bcs L(R1)
89 subql #1,R(s_size) 89 subql #1,R(s_size)
90 90
91L(Roop:) 91L(Roop:)
92 movel MEM_POSTINC(s_ptr),R(d2) 92 movel MEM_POSTINC(s_ptr),R(d2)
93 movel R(d2),R(d3) 93 movel R(d2),R(d3)
94 lsll R(d5),R(d3) 94 lsll R(d5),R(d3)
95 orl R(d3),R(d1) 95 orl R(d3),R(d1)
96 movel R(d1),MEM_POSTINC(res_ptr) 96 movel R(d1),MEM_POSTINC(res_ptr)
97 lsrl R(cnt),R(d2) 97 lsrl R(cnt),R(d2)
98L(R1:) 98L(R1:)
99 movel MEM_POSTINC(s_ptr),R(d1) 99 movel MEM_POSTINC(s_ptr),R(d1)
100 movel R(d1),R(d3) 100 movel R(d1),R(d3)
101 lsll R(d5),R(d3) 101 lsll R(d5),R(d3)
102 orl R(d3),R(d2) 102 orl R(d3),R(d2)
103 movel R(d2),MEM_POSTINC(res_ptr) 103 movel R(d2),MEM_POSTINC(res_ptr)
104 lsrl R(cnt),R(d1) 104 lsrl R(cnt),R(d1)
105 105
106 dbf R(s_size),L(Roop) 106 dbf R(s_size),L(Roop)
107 subl #0x10000,R(s_size) 107 subl #0x10000,R(s_size)
108 bcc L(Roop) 108 bcc L(Roop)
109 109
110L(Rend:) 110L(Rend:)
111 movel R(d1),MEM(res_ptr) /* store most significant limb */ 111 movel R(d1),MEM(res_ptr) /* store most significant limb */
112 112
113/* Restore used registers from stack frame. */ 113/* Restore used registers from stack frame. */
114 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) 114 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2)
115 rts 115 rts
116 116
117/* We loop from most significant end of the arrays, which is only 117/* We loop from most significant end of the arrays, which is only
118 permissable if the source and destination don't overlap, since the 118 permissable if the source and destination don't overlap, since the
119 function is documented to work for overlapping source and destination. */ 119 function is documented to work for overlapping source and destination. */
120 120
121L(Rspecial:) 121L(Rspecial:)
122#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)) 122#if (defined (__mc68020__) || defined (__NeXT__) || defined(mc68020))
123 lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr) 123 lea MEM_INDX1(s_ptr,s_size,l,4),R(s_ptr)
124 lea MEM_INDX1(res_ptr,s_size,l,4),R(res_ptr) 124 lea MEM_INDX1(res_ptr,s_size,l,4),R(res_ptr)
125#else /* not mc68000 */ 125#else /* not mc68000 */
126 movel R(s_size),R(d0) 126 movel R(s_size),R(d0)
127 asll #2,R(d0) 127 asll #2,R(d0)
128 addl R(s_size),R(s_ptr) 128 addl R(s_size),R(s_ptr)
129 addl R(s_size),R(res_ptr) 129 addl R(s_size),R(res_ptr)
130#endif 130#endif
131 131
132 clrl R(d0) /* initialize carry */ 132 clrl R(d0) /* initialize carry */
133 eorw #1,R(s_size) 133 eorw #1,R(s_size)
134 lsrl #1,R(s_size) 134 lsrl #1,R(s_size)
135 bcc L(LR1) 135 bcc L(LR1)
136 subql #1,R(s_size) 136 subql #1,R(s_size)
137 137
138L(LRoop:) 138L(LRoop:)
139 movel MEM_PREDEC(s_ptr),R(d2) 139 movel MEM_PREDEC(s_ptr),R(d2)
140 roxrl #1,R(d2) 140 roxrl #1,R(d2)
141 movel R(d2),MEM_PREDEC(res_ptr) 141 movel R(d2),MEM_PREDEC(res_ptr)
142L(LR1:) 142L(LR1:)
143 movel MEM_PREDEC(s_ptr),R(d2) 143 movel MEM_PREDEC(s_ptr),R(d2)
144 roxrl #1,R(d2) 144 roxrl #1,R(d2)
145 movel R(d2),MEM_PREDEC(res_ptr) 145 movel R(d2),MEM_PREDEC(res_ptr)
146 146
147 dbf R(s_size),L(LRoop) 147 dbf R(s_size),L(LRoop)
148 roxrl #1,R(d0) /* save cy in msb */ 148 roxrl #1,R(d0) /* save cy in msb */
149 subl #0x10000,R(s_size) 149 subl #0x10000,R(s_size)
150 bcs L(LRend) 150 bcs L(LRend)
151 addl R(d0),R(d0) /* restore cy */ 151 addl R(d0),R(d0) /* restore cy */
152 bra L(LRoop) 152 bra L(LRoop)
153 153
154L(LRend:) 154L(LRend:)
155/* Restore used registers from stack frame. */ 155/* Restore used registers from stack frame. */
156 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2) 156 moveml MEM_POSTINC(sp),R(d2)-R(d6)/R(a2)
157 rts 157 rts
158EPILOG(_gcry_mpih_rshift) 158EPILOG(_gcry_mpih_rshift)
159 159
160 160
161 161
162 162
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-sub1.S
index bc671f0..ee7555f 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/mpih-sub1.S
@@ -1,91 +1,91 @@
1/* mc68020 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and 1/* mc68020 __mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
2 * store difference in a third limb vector. 2 * store difference in a third limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1996, 1998, 4 * Copyright (C) 1992, 1994, 1996, 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#include "sysdep.h" 30#include "sysdep.h"
31#include "asm-syntax.h" 31#include "asm-syntax.h"
32 32
33 33
34/******************* 34/*******************
35 * mpi_limb_t 35 * mpi_limb_t
36 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (sp + 4) 36 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (sp + 4)
37 * mpi_ptr_t s1_ptr, (sp + 8) 37 * mpi_ptr_t s1_ptr, (sp + 8)
38 * mpi_ptr_t s2_ptr, (sp + 16) 38 * mpi_ptr_t s2_ptr, (sp + 16)
39 * mpi_size_t size) (sp + 12) 39 * mpi_size_t size) (sp + 12)
40 */ 40 */
41 41
42 42
43 TEXT 43 TEXT
44 ALIGN 44 ALIGN
45 GLOBL C_SYMBOL_NAME(_gcry_mpih_sub_n) 45 GLOBL C_SYMBOL_NAME(_gcry_mpih_sub_n)
46 46
47C_SYMBOL_NAME(_gcry_mpih_sub_n:) 47C_SYMBOL_NAME(_gcry_mpih_sub_n:)
48PROLOG(_gcry_mpih_sub_n) 48PROLOG(_gcry_mpih_sub_n)
49/* Save used registers on the stack. */ 49/* Save used registers on the stack. */
50 movel R(d2),MEM_PREDEC(sp) 50 movel R(d2),MEM_PREDEC(sp)
51 movel R(a2),MEM_PREDEC(sp) 51 movel R(a2),MEM_PREDEC(sp)
52 52
53/* Copy the arguments to registers. Better use movem? */ 53/* Copy the arguments to registers. Better use movem? */
54 movel MEM_DISP(sp,12),R(a2) 54 movel MEM_DISP(sp,12),R(a2)
55 movel MEM_DISP(sp,16),R(a0) 55 movel MEM_DISP(sp,16),R(a0)
56 movel MEM_DISP(sp,20),R(a1) 56 movel MEM_DISP(sp,20),R(a1)
57 movel MEM_DISP(sp,24),R(d2) 57 movel MEM_DISP(sp,24),R(d2)
58 58
59 eorw #1,R(d2) 59 eorw #1,R(d2)
60 lsrl #1,R(d2) 60 lsrl #1,R(d2)
61 bcc L(L1) 61 bcc L(L1)
62 subql #1,R(d2) /* clears cy as side effect */ 62 subql #1,R(d2) /* clears cy as side effect */
63 63
64L(Loop:) 64L(Loop:)
65 movel MEM_POSTINC(a0),R(d0) 65 movel MEM_POSTINC(a0),R(d0)
66 movel MEM_POSTINC(a1),R(d1) 66 movel MEM_POSTINC(a1),R(d1)
67 subxl R(d1),R(d0) 67 subxl R(d1),R(d0)
68 movel R(d0),MEM_POSTINC(a2) 68 movel R(d0),MEM_POSTINC(a2)
69L(L1:) movel MEM_POSTINC(a0),R(d0) 69L(L1:) movel MEM_POSTINC(a0),R(d0)
70 movel MEM_POSTINC(a1),R(d1) 70 movel MEM_POSTINC(a1),R(d1)
71 subxl R(d1),R(d0) 71 subxl R(d1),R(d0)
72 movel R(d0),MEM_POSTINC(a2) 72 movel R(d0),MEM_POSTINC(a2)
73 73
74 dbf R(d2),L(Loop) /* loop until 16 lsb of %4 == -1 */ 74 dbf R(d2),L(Loop) /* loop until 16 lsb of %4 == -1 */
75 subxl R(d0),R(d0) /* d0 <= -cy; save cy as 0 or -1 in d0 */ 75 subxl R(d0),R(d0) /* d0 <= -cy; save cy as 0 or -1 in d0 */
76 subl #0x10000,R(d2) 76 subl #0x10000,R(d2)
77 bcs L(L2) 77 bcs L(L2)
78 addl R(d0),R(d0) /* restore cy */ 78 addl R(d0),R(d0) /* restore cy */
79 bra L(Loop) 79 bra L(Loop)
80 80
81L(L2:) 81L(L2:)
82 negl R(d0) 82 negl R(d0)
83 83
84/* Restore used registers from stack frame. */ 84/* Restore used registers from stack frame. */
85 movel MEM_POSTINC(sp),R(a2) 85 movel MEM_POSTINC(sp),R(a2)
86 movel MEM_POSTINC(sp),R(d2) 86 movel MEM_POSTINC(sp),R(d2)
87 87
88 rts 88 rts
89EPILOG(_gcry_mpih_sub_n) 89EPILOG(_gcry_mpih_sub_n)
90 90
91 91
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/syntax.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/syntax.h
index f782312..e27de98 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/syntax.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/m68k/syntax.h
@@ -1,185 +1,185 @@
1/* asm.h -- Definitions for 68k syntax variations. 1/* asm.h -- Definitions for 68k syntax variations.
2 * 2 *
3 * Copyright (C) 1992, 1994, 1996, 1998, 3 * Copyright (C) 1992, 1994, 1996, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 * 21 *
22 * Note: This code is heavily based on the GNU MP Library. 22 * Note: This code is heavily based on the GNU MP Library.
23 * Actually it's the same code with only minor changes in the 23 * Actually it's the same code with only minor changes in the
24 * way the data is stored; this is to support the abstraction 24 * way the data is stored; this is to support the abstraction
25 * of an optional secure memory allocation which may be used 25 * of an optional secure memory allocation which may be used
26 * to avoid revealing of sensitive data due to paging etc. 26 * to avoid revealing of sensitive data due to paging etc.
27 */ 27 */
28 28
29 29
30#undef ALIGN 30#undef ALIGN
31 31
32#ifdef MIT_SYNTAX 32#ifdef MIT_SYNTAX
33#define PROLOG(name) 33#define PROLOG(name)
34#define EPILOG(name) 34#define EPILOG(name)
35#define R(r)r 35#define R(r)r
36#define MEM(base)base@ 36#define MEM(base)base@
37#define MEM_DISP(base,displacement)base@(displacement) 37#define MEM_DISP(base,displacement)base@(displacement)
38#define MEM_INDX(base,idx,size_suffix)base@(idx:size_suffix) 38#define MEM_INDX(base,idx,size_suffix)base@(idx:size_suffix)
39#define MEM_INDX1(base,idx,size_suffix,scale)base@(idx:size_suffix:scale) 39#define MEM_INDX1(base,idx,size_suffix,scale)base@(idx:size_suffix:scale)
40#define MEM_PREDEC(memory_base)memory_base@- 40#define MEM_PREDEC(memory_base)memory_base@-
41#define MEM_POSTINC(memory_base)memory_base@+ 41#define MEM_POSTINC(memory_base)memory_base@+
42#define L(label) label 42#define L(label) label
43#define TEXT .text 43#define TEXT .text
44#define ALIGN .even 44#define ALIGN .even
45#define GLOBL .globl 45#define GLOBL .globl
46#define moveql moveq 46#define moveql moveq
47/* Use variable sized opcodes. */ 47/* Use variable sized opcodes. */
48#define bcc jcc 48#define bcc jcc
49#define bcs jcs 49#define bcs jcs
50#define bls jls 50#define bls jls
51#define beq jeq 51#define beq jeq
52#define bne jne 52#define bne jne
53#define bra jra 53#define bra jra
54#endif 54#endif
55 55
56#ifdef SONY_SYNTAX 56#ifdef SONY_SYNTAX
57#define PROLOG(name) 57#define PROLOG(name)
58#define EPILOG(name) 58#define EPILOG(name)
59#define R(r)r 59#define R(r)r
60#define MEM(base)(base) 60#define MEM(base)(base)
61#define MEM_DISP(base,displacement)(displacement,base) 61#define MEM_DISP(base,displacement)(displacement,base)
62#define MEM_INDX(base,idx,size_suffix)(base,idx.size_suffix) 62#define MEM_INDX(base,idx,size_suffix)(base,idx.size_suffix)
63#define MEM_INDX1(base,idx,size_suffix,scale)(base,idx.size_suffix*scale) 63#define MEM_INDX1(base,idx,size_suffix,scale)(base,idx.size_suffix*scale)
64#define MEM_PREDEC(memory_base)-(memory_base) 64#define MEM_PREDEC(memory_base)-(memory_base)
65#define MEM_POSTINC(memory_base)(memory_base)+ 65#define MEM_POSTINC(memory_base)(memory_base)+
66#define L(label) label 66#define L(label) label
67#define TEXT .text 67#define TEXT .text
68#define ALIGN .even 68#define ALIGN .even
69#define GLOBL .globl 69#define GLOBL .globl
70#endif 70#endif
71 71
72#ifdef MOTOROLA_SYNTAX 72#ifdef MOTOROLA_SYNTAX
73#define PROLOG(name) 73#define PROLOG(name)
74#define EPILOG(name) 74#define EPILOG(name)
75#define R(r)r 75#define R(r)r
76#define MEM(base)(base) 76#define MEM(base)(base)
77#define MEM_DISP(base,displacement)(displacement,base) 77#define MEM_DISP(base,displacement)(displacement,base)
78#define MEM_INDX(base,idx,size_suffix)(base,idx.size_suffix) 78#define MEM_INDX(base,idx,size_suffix)(base,idx.size_suffix)
79#define MEM_INDX1(base,idx,size_suffix,scale)(base,idx.size_suffix*scale) 79#define MEM_INDX1(base,idx,size_suffix,scale)(base,idx.size_suffix*scale)
80#define MEM_PREDEC(memory_base)-(memory_base) 80#define MEM_PREDEC(memory_base)-(memory_base)
81#define MEM_POSTINC(memory_base)(memory_base)+ 81#define MEM_POSTINC(memory_base)(memory_base)+
82#define L(label) label 82#define L(label) label
83#define TEXT 83#define TEXT
84#define ALIGN 84#define ALIGN
85#define GLOBL XDEF 85#define GLOBL XDEF
86#define lea LEA 86#define lea LEA
87#define movel MOVE.L 87#define movel MOVE.L
88#define moveml MOVEM.L 88#define moveml MOVEM.L
89#define moveql MOVEQ.L 89#define moveql MOVEQ.L
90#define cmpl CMP.L 90#define cmpl CMP.L
91#define orl OR.L 91#define orl OR.L
92#define clrl CLR.L 92#define clrl CLR.L
93#define eorw EOR.W 93#define eorw EOR.W
94#define lsrl LSR.L 94#define lsrl LSR.L
95#define lsll LSL.L 95#define lsll LSL.L
96#define roxrl ROXR.L 96#define roxrl ROXR.L
97#define roxll ROXL.L 97#define roxll ROXL.L
98#define addl ADD.L 98#define addl ADD.L
99#define addxl ADDX.L 99#define addxl ADDX.L
100#define addql ADDQ.L 100#define addql ADDQ.L
101#define subl SUB.L 101#define subl SUB.L
102#define subxl SUBX.L 102#define subxl SUBX.L
103#define subql SUBQ.L 103#define subql SUBQ.L
104#define negl NEG.L 104#define negl NEG.L
105#define mulul MULU.L 105#define mulul MULU.L
106#define bcc BCC 106#define bcc BCC
107#define bcs BCS 107#define bcs BCS
108#define bls BLS 108#define bls BLS
109#define beq BEQ 109#define beq BEQ
110#define bne BNE 110#define bne BNE
111#define bra BRA 111#define bra BRA
112#define dbf DBF 112#define dbf DBF
113#define rts RTS 113#define rts RTS
114#define d0 D0 114#define d0 D0
115#define d1 D1 115#define d1 D1
116#define d2 D2 116#define d2 D2
117#define d3 D3 117#define d3 D3
118#define d4 D4 118#define d4 D4
119#define d5 D5 119#define d5 D5
120#define d6 D6 120#define d6 D6
121#define d7 D7 121#define d7 D7
122#define a0 A0 122#define a0 A0
123#define a1 A1 123#define a1 A1
124#define a2 A2 124#define a2 A2
125#define a3 A3 125#define a3 A3
126#define a4 A4 126#define a4 A4
127#define a5 A5 127#define a5 A5
128#define a6 A6 128#define a6 A6
129#define a7 A7 129#define a7 A7
130#define sp SP 130#define sp SP
131#endif 131#endif
132 132
133#ifdef ELF_SYNTAX 133#ifdef ELF_SYNTAX
134#define PROLOG(name) .type name,@function 134#define PROLOG(name) .type name,@function
135#define EPILOG(name) .size name,.-name 135#define EPILOG(name) .size name,.-name
136#define MEM(base)(R(base)) 136#define MEM(base)(R(base))
137#define MEM_DISP(base,displacement)(displacement,R(base)) 137#define MEM_DISP(base,displacement)(displacement,R(base))
138#define MEM_PREDEC(memory_base)-(R(memory_base)) 138#define MEM_PREDEC(memory_base)-(R(memory_base))
139#define MEM_POSTINC(memory_base)(R(memory_base))+ 139#define MEM_POSTINC(memory_base)(R(memory_base))+
140#ifdef __STDC__ 140#ifdef __STDC__
141#define R_(r)%##r 141#define R_(r)%##r
142#define R(r)R_(r) 142#define R(r)R_(r)
143#define MEM_INDX_(base,idx,size_suffix)(R(base),R(idx##.##size_suffix)) 143#define MEM_INDX_(base,idx,size_suffix)(R(base),R(idx##.##size_suffix))
144#define MEM_INDX(base,idx,size_suffix)MEM_INDX_(base,idx,size_suffix) 144#define MEM_INDX(base,idx,size_suffix)MEM_INDX_(base,idx,size_suffix)
145#define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale)) 145#define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale))
146#define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale) 146#define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale)
147#define L(label) .##label 147#define L(label) .##label
148#else 148#else
149#define R(r)%/**/r 149#define R(r)%/**/r
150#define MEM_INDX(base,idx,size_suffix)(R(base),R(idx).size_suffix) 150#define MEM_INDX(base,idx,size_suffix)(R(base),R(idx).size_suffix)
151#define MEM_INDX1(base,idx,size_suffix,scale)(R(base),R(idx).size_suffix*scale) 151#define MEM_INDX1(base,idx,size_suffix,scale)(R(base),R(idx).size_suffix*scale)
152#define L(label) ./**/label 152#define L(label) ./**/label
153#endif 153#endif
154#define TEXT .text 154#define TEXT .text
155#define ALIGN .align 2 155#define ALIGN .align 2
156#define GLOBL .globl 156#define GLOBL .globl
157#define bcc jbcc 157#define bcc jbcc
158#define bcs jbcs 158#define bcs jbcs
159#define bls jbls 159#define bls jbls
160#define beq jbeq 160#define beq jbeq
161#define bne jbne 161#define bne jbne
162#define bra jbra 162#define bra jbra
163#endif 163#endif
164 164
165#if defined (SONY_SYNTAX) || defined (ELF_SYNTAX) 165#if defined (SONY_SYNTAX) || defined (ELF_SYNTAX)
166#define movel move.l 166#define movel move.l
167#define moveml movem.l 167#define moveml movem.l
168#define moveql moveq.l 168#define moveql moveq.l
169#define cmpl cmp.l 169#define cmpl cmp.l
170#define orl or.l 170#define orl or.l
171#define clrl clr.l 171#define clrl clr.l
172#define eorw eor.w 172#define eorw eor.w
173#define lsrl lsr.l 173#define lsrl lsr.l
174#define lsll lsl.l 174#define lsll lsl.l
175#define roxrl roxr.l 175#define roxrl roxr.l
176#define roxll roxl.l 176#define roxll roxl.l
177#define addl add.l 177#define addl add.l
178#define addxl addx.l 178#define addxl addx.l
179#define addql addq.l 179#define addql addq.l
180#define subl sub.l 180#define subl sub.l
181#define subxl subx.l 181#define subxl subx.l
182#define subql subq.l 182#define subql subq.l
183#define negl neg.l 183#define negl neg.l
184#define mulul mulu.l 184#define mulul mulu.l
185#endif 185#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/Manifest
index 5d9e570..e191184 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/Manifest
@@ -1,28 +1,28 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser general Public License as 7# it under the terms of the GNU Lesser general Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-add1.S 20mpih-add1.S
21mpih-sub1.S 21mpih-sub1.S
22mpih-mul1.S 22mpih-mul1.S
23mpih-mul2.S 23mpih-mul2.S
24mpih-mul3.S 24mpih-mul3.S
25mpih-lshift.S 25mpih-lshift.S
26mpih-rshift.S 26mpih-rshift.S
27mpi-asm-defs.h 27mpi-asm-defs.h
28$names$ iQCVAwUAP+LmUTEAnp832S/7AQLm/gP/RHR2aLMwHPxsq0mGO5H0kneVn8a9l9yDNEZBefkYcOJMb7MZGKxbGspyENiU04Mc2TFnA1wS9gjNHlRWtUYxxn/wyuV6BIRgfstXt2nXGgEQrK07GIz8ETFcYqcxu7JKiICIuXZgnIgdwBJswbBV1zaMUDXeg5B8vkkEeRWj8hQ==IQVO 28$names$ iQCVAwUAP+LmUTEAnp832S/7AQLm/gP/RHR2aLMwHPxsq0mGO5H0kneVn8a9l9yDNEZBefkYcOJMb7MZGKxbGspyENiU04Mc2TFnA1wS9gjNHlRWtUYxxn/wyuV6BIRgfstXt2nXGgEQrK07GIz8ETFcYqcxu7JKiICIuXZgnIgdwBJswbBV1zaMUDXeg5B8vkkEeRWj8hQ==IQVO
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/README b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/README
index 2144076..e94b2c7 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/README
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/README
@@ -1,23 +1,23 @@
1This directory contains mpn functions optimized for MIPS3. Example of 1This directory contains mpn functions optimized for MIPS3. Example of
2processors that implement MIPS3 are R4000, R4400, R4600, R4700, and R8000. 2processors that implement MIPS3 are R4000, R4400, R4600, R4700, and R8000.
3 3
4RELEVANT OPTIMIZATION ISSUES 4RELEVANT OPTIMIZATION ISSUES
5 5
61. On the R4000 and R4400, branches, both the plain and the "likely" ones, 61. On the R4000 and R4400, branches, both the plain and the "likely" ones,
7 take 3 cycles to execute. (The fastest possible loop will take 4 cycles, 7 take 3 cycles to execute. (The fastest possible loop will take 4 cycles,
8 because of the delay insn.) 8 because of the delay insn.)
9 9
10 On the R4600, branches takes a single cycle 10 On the R4600, branches takes a single cycle
11 11
12 On the R8000, branches often take no noticable cycles, as they are 12 On the R8000, branches often take no noticable cycles, as they are
13 executed in a separate function unit.. 13 executed in a separate function unit..
14 14
152. The R4000 and R4400 have a load latency of 4 cycles. 152. The R4000 and R4400 have a load latency of 4 cycles.
16 16
173. On the R4000 and R4400, multiplies take a data-dependent number of 173. On the R4000 and R4400, multiplies take a data-dependent number of
18 cycles, contrary to the SGI documentation. There seem to be 3 or 4 18 cycles, contrary to the SGI documentation. There seem to be 3 or 4
19 possible latencies. 19 possible latencies.
20 20
21STATUS 21STATUS
22 22
23Good... 23Good...
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/distfiles
index 0c825c6..ef9b6fe 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/distfiles
@@ -1,11 +1,11 @@
1Manifest 1Manifest
2README 2README
3mpih-add1.S 3mpih-add1.S
4mpih-sub1.S 4mpih-sub1.S
5mpih-mul1.S 5mpih-mul1.S
6mpih-mul2.S 6mpih-mul2.S
7mpih-mul3.S 7mpih-mul3.S
8mpih-lshift.S 8mpih-lshift.S
9mpih-rshift.S 9mpih-rshift.S
10mpi-asm-defs.h 10mpi-asm-defs.h
11 11
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpi-asm-defs.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpi-asm-defs.h
index a1b5824..2d9a9c1 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpi-asm-defs.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpi-asm-defs.h
@@ -1,10 +1,10 @@
1/* This file defines some basic constants for the MPI machinery. We 1/* This file defines some basic constants for the MPI machinery. We
2 * need to define the types on a per-CPU basis, so it is done with 2 * need to define the types on a per-CPU basis, so it is done with
3 * this file here. */ 3 * this file here. */
4#define BYTES_PER_MPI_LIMB 8 4#define BYTES_PER_MPI_LIMB 8
5 5
6 6
7 7
8 8
9 9
10 10
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-add1.S
index fb8e34e..f3db029 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-add1.S
@@ -1,124 +1,124 @@
1/* mips3 add_n -- Add two limb vectors of the same length > 0 and store 1/* mips3 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) 1995, 1998, 2000 4 * Copyright (C) 1995, 1998, 2000
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 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, ($4) 27 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, ($4)
28 * mpi_ptr_t s1_ptr, ($5) 28 * mpi_ptr_t s1_ptr, ($5)
29 * mpi_ptr_t s2_ptr, ($6) 29 * mpi_ptr_t s2_ptr, ($6)
30 * mpi_size_t size) ($7) 30 * mpi_size_t size) ($7)
31 */ 31 */
32 32
33 .text 33 .text
34 .align 2 34 .align 2
35 .globl _gcry_mpih_add_n 35 .globl _gcry_mpih_add_n
36 .ent _gcry_mpih_add_n 36 .ent _gcry_mpih_add_n
37_gcry_mpih_add_n: 37_gcry_mpih_add_n:
38 .set noreorder 38 .set noreorder
39 .set nomacro 39 .set nomacro
40 40
41 ld $10,0($5) 41 ld $10,0($5)
42 ld $11,0($6) 42 ld $11,0($6)
43 43
44 daddiu $7,$7,-1 44 daddiu $7,$7,-1
45 and $9,$7,4-1 # number of limbs in first loop 45 and $9,$7,4-1 # number of limbs in first loop
46 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop 46 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop
47 move $2,$0 47 move $2,$0
48 48
49 dsubu $7,$7,$9 49 dsubu $7,$7,$9
50 50
51.Loop0: daddiu $9,$9,-1 51.Loop0: daddiu $9,$9,-1
52 ld $12,8($5) 52 ld $12,8($5)
53 daddu $11,$11,$2 53 daddu $11,$11,$2
54 ld $13,8($6) 54 ld $13,8($6)
55 sltu $8,$11,$2 55 sltu $8,$11,$2
56 daddu $11,$10,$11 56 daddu $11,$10,$11
57 sltu $2,$11,$10 57 sltu $2,$11,$10
58 sd $11,0($4) 58 sd $11,0($4)
59 or $2,$2,$8 59 or $2,$2,$8
60 60
61 daddiu $5,$5,8 61 daddiu $5,$5,8
62 daddiu $6,$6,8 62 daddiu $6,$6,8
63 move $10,$12 63 move $10,$12
64 move $11,$13 64 move $11,$13
65 bne $9,$0,.Loop0 65 bne $9,$0,.Loop0
66 daddiu $4,$4,8 66 daddiu $4,$4,8
67 67
68.L0: beq $7,$0,.Lend 68.L0: beq $7,$0,.Lend
69 nop 69 nop
70 70
71.Loop: daddiu $7,$7,-4 71.Loop: daddiu $7,$7,-4
72 72
73 ld $12,8($5) 73 ld $12,8($5)
74 daddu $11,$11,$2 74 daddu $11,$11,$2
75 ld $13,8($6) 75 ld $13,8($6)
76 sltu $8,$11,$2 76 sltu $8,$11,$2
77 daddu $11,$10,$11 77 daddu $11,$10,$11
78 sltu $2,$11,$10 78 sltu $2,$11,$10
79 sd $11,0($4) 79 sd $11,0($4)
80 or $2,$2,$8 80 or $2,$2,$8
81 81
82 ld $10,16($5) 82 ld $10,16($5)
83 daddu $13,$13,$2 83 daddu $13,$13,$2
84 ld $11,16($6) 84 ld $11,16($6)
85 sltu $8,$13,$2 85 sltu $8,$13,$2
86 daddu $13,$12,$13 86 daddu $13,$12,$13
87 sltu $2,$13,$12 87 sltu $2,$13,$12
88 sd $13,8($4) 88 sd $13,8($4)
89 or $2,$2,$8 89 or $2,$2,$8
90 90
91 ld $12,24($5) 91 ld $12,24($5)
92 daddu $11,$11,$2 92 daddu $11,$11,$2
93 ld $13,24($6) 93 ld $13,24($6)
94 sltu $8,$11,$2 94 sltu $8,$11,$2
95 daddu $11,$10,$11 95 daddu $11,$10,$11
96 sltu $2,$11,$10 96 sltu $2,$11,$10
97 sd $11,16($4) 97 sd $11,16($4)
98 or $2,$2,$8 98 or $2,$2,$8
99 99
100 ld $10,32($5) 100 ld $10,32($5)
101 daddu $13,$13,$2 101 daddu $13,$13,$2
102 ld $11,32($6) 102 ld $11,32($6)
103 sltu $8,$13,$2 103 sltu $8,$13,$2
104 daddu $13,$12,$13 104 daddu $13,$12,$13
105 sltu $2,$13,$12 105 sltu $2,$13,$12
106 sd $13,24($4) 106 sd $13,24($4)
107 or $2,$2,$8 107 or $2,$2,$8
108 108
109 daddiu $5,$5,32 109 daddiu $5,$5,32
110 daddiu $6,$6,32 110 daddiu $6,$6,32
111 111
112 bne $7,$0,.Loop 112 bne $7,$0,.Loop
113 daddiu $4,$4,32 113 daddiu $4,$4,32
114 114
115.Lend: daddu $11,$11,$2 115.Lend: daddu $11,$11,$2
116 sltu $8,$11,$2 116 sltu $8,$11,$2
117 daddu $11,$10,$11 117 daddu $11,$10,$11
118 sltu $2,$11,$10 118 sltu $2,$11,$10
119 sd $11,0($4) 119 sd $11,0($4)
120 j $31 120 j $31
121 or $2,$2,$8 121 or $2,$2,$8
122 122
123 .end _gcry_mpih_add_n 123 .end _gcry_mpih_add_n
124 124
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-lshift.S
index 0b92453..084c109 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-lshift.S
@@ -1,97 +1,97 @@
1/* mips3 lshift 1/* mips3 lshift
2 * 2 *
3 * Copyright (C) 1995, 1998, 2000, 3 * Copyright (C) 1995, 1998, 2000,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23/******************* 23/*******************
24 * mpi_limb_t 24 * mpi_limb_t
25 * _gcry_mpih_lshift( mpi_ptr_t wp, ($4) 25 * _gcry_mpih_lshift( mpi_ptr_t wp, ($4)
26 * mpi_ptr_t up, ($5) 26 * mpi_ptr_t up, ($5)
27 * mpi_size_t usize, ($6) 27 * mpi_size_t usize, ($6)
28 * unsigned cnt) ($7) 28 * unsigned cnt) ($7)
29 */ 29 */
30 30
31 .text 31 .text
32 .align 2 32 .align 2
33 .globl _gcry_mpih_lshift 33 .globl _gcry_mpih_lshift
34 .ent _gcry_mpih_lshift 34 .ent _gcry_mpih_lshift
35_gcry_mpih_lshift: 35_gcry_mpih_lshift:
36 .set noreorder 36 .set noreorder
37 .set nomacro 37 .set nomacro
38 38
39 dsll $2,$6,3 39 dsll $2,$6,3
40 daddu $5,$5,$2 # make r5 point at end of src 40 daddu $5,$5,$2 # make r5 point at end of src
41 ld $10,-8($5) # load first limb 41 ld $10,-8($5) # load first limb
42 dsubu $13,$0,$7 42 dsubu $13,$0,$7
43 daddu $4,$4,$2 # make r4 point at end of res 43 daddu $4,$4,$2 # make r4 point at end of res
44 daddiu $6,$6,-1 44 daddiu $6,$6,-1
45 and $9,$6,4-1 # number of limbs in first loop 45 and $9,$6,4-1 # number of limbs in first loop
46 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop 46 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop
47 dsrl $2,$10,$13 # compute function result 47 dsrl $2,$10,$13 # compute function result
48 48
49 dsubu $6,$6,$9 49 dsubu $6,$6,$9
50 50
51.Loop0: ld $3,-16($5) 51.Loop0: ld $3,-16($5)
52 daddiu $4,$4,-8 52 daddiu $4,$4,-8
53 daddiu $5,$5,-8 53 daddiu $5,$5,-8
54 daddiu $9,$9,-1 54 daddiu $9,$9,-1
55 dsll $11,$10,$7 55 dsll $11,$10,$7
56 dsrl $12,$3,$13 56 dsrl $12,$3,$13
57 move $10,$3 57 move $10,$3
58 or $8,$11,$12 58 or $8,$11,$12
59 bne $9,$0,.Loop0 59 bne $9,$0,.Loop0
60 sd $8,0($4) 60 sd $8,0($4)
61 61
62.L0: beq $6,$0,.Lend 62.L0: beq $6,$0,.Lend
63 nop 63 nop
64 64
65.Loop: ld $3,-16($5) 65.Loop: ld $3,-16($5)
66 daddiu $4,$4,-32 66 daddiu $4,$4,-32
67 daddiu $6,$6,-4 67 daddiu $6,$6,-4
68 dsll $11,$10,$7 68 dsll $11,$10,$7
69 dsrl $12,$3,$13 69 dsrl $12,$3,$13
70 70
71 ld $10,-24($5) 71 ld $10,-24($5)
72 dsll $14,$3,$7 72 dsll $14,$3,$7
73 or $8,$11,$12 73 or $8,$11,$12
74 sd $8,24($4) 74 sd $8,24($4)
75 dsrl $9,$10,$13 75 dsrl $9,$10,$13
76 76
77 ld $3,-32($5) 77 ld $3,-32($5)
78 dsll $11,$10,$7 78 dsll $11,$10,$7
79 or $8,$14,$9 79 or $8,$14,$9
80 sd $8,16($4) 80 sd $8,16($4)
81 dsrl $12,$3,$13 81 dsrl $12,$3,$13
82 82
83 ld $10,-40($5) 83 ld $10,-40($5)
84 dsll $14,$3,$7 84 dsll $14,$3,$7
85 or $8,$11,$12 85 or $8,$11,$12
86 sd $8,8($4) 86 sd $8,8($4)
87 dsrl $9,$10,$13 87 dsrl $9,$10,$13
88 88
89 daddiu $5,$5,-32 89 daddiu $5,$5,-32
90 or $8,$14,$9 90 or $8,$14,$9
91 bgtz $6,.Loop 91 bgtz $6,.Loop
92 sd $8,0($4) 92 sd $8,0($4)
93 93
94.Lend: dsll $8,$10,$7 94.Lend: dsll $8,$10,$7
95 j $31 95 j $31
96 sd $8,-8($4) 96 sd $8,-8($4)
97 .end _gcry_mpih_lshift 97 .end _gcry_mpih_lshift
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul1.S
index 35f32c7..6c0099d 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul1.S
@@ -1,89 +1,89 @@
1/* mips3 mpih-mul1.S -- Multiply a limb vector with a limb and store 1/* mips3 mpih-mul1.S -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1995, 1998, 2000 4 * Copyright (C) 1992, 1994, 1995, 1998, 2000
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 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r4) 27 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r4)
28 * mpi_ptr_t s1_ptr, (r5) 28 * mpi_ptr_t s1_ptr, (r5)
29 * mpi_size_t s1_size, (r6) 29 * mpi_size_t s1_size, (r6)
30 * mpi_limb_t s2_limb) (r7) 30 * mpi_limb_t s2_limb) (r7)
31 */ 31 */
32 32
33 .text 33 .text
34 .align 4 34 .align 4
35 .globl _gcry_mpih_mul_1 35 .globl _gcry_mpih_mul_1
36 .ent _gcry_mpih_mul_1 36 .ent _gcry_mpih_mul_1
37_gcry_mpih_mul_1: 37_gcry_mpih_mul_1:
38 .set noreorder 38 .set noreorder
39 .set nomacro 39 .set nomacro
40 40
41/* # warm up phase 0 */ 41/* # warm up phase 0 */
42 ld $8,0($5) 42 ld $8,0($5)
43 43
44/* # warm up phase 1 */ 44/* # warm up phase 1 */
45 daddiu $5,$5,8 45 daddiu $5,$5,8
46 dmultu $8,$7 46 dmultu $8,$7
47 47
48 daddiu $6,$6,-1 48 daddiu $6,$6,-1
49 beq $6,$0,$LC0 49 beq $6,$0,$LC0
50 move $2,$0 # zero cy2 50 move $2,$0 # zero cy2
51 51
52 daddiu $6,$6,-1 52 daddiu $6,$6,-1
53 beq $6,$0,$LC1 53 beq $6,$0,$LC1
54 ld $8,0($5) # load new s1 limb as early as possible 54 ld $8,0($5) # load new s1 limb as early as possible
55 55
56Loop: mflo $10 56Loop: mflo $10
57 mfhi $9 57 mfhi $9
58 daddiu $5,$5,8 58 daddiu $5,$5,8
59 daddu $10,$10,$2 # add old carry limb to low product limb 59 daddu $10,$10,$2 # add old carry limb to low product limb
60 dmultu $8,$7 60 dmultu $8,$7
61 ld $8,0($5) # load new s1 limb as early as possible 61 ld $8,0($5) # load new s1 limb as early as possible
62 daddiu $6,$6,-1 # decrement loop counter 62 daddiu $6,$6,-1 # decrement loop counter
63 sltu $2,$10,$2 # carry from previous addition -> $2 63 sltu $2,$10,$2 # carry from previous addition -> $2
64 sd $10,0($4) 64 sd $10,0($4)
65 daddiu $4,$4,8 65 daddiu $4,$4,8
66 bne $6,$0,Loop 66 bne $6,$0,Loop
67 daddu $2,$9,$2 # add high product limb and carry from addition 67 daddu $2,$9,$2 # add high product limb and carry from addition
68 68
69/* # cool down phase 1 */ 69/* # cool down phase 1 */
70$LC1: mflo $10 70$LC1: mflo $10
71 mfhi $9 71 mfhi $9
72 daddu $10,$10,$2 72 daddu $10,$10,$2
73 sltu $2,$10,$2 73 sltu $2,$10,$2
74 dmultu $8,$7 74 dmultu $8,$7
75 sd $10,0($4) 75 sd $10,0($4)
76 daddiu $4,$4,8 76 daddiu $4,$4,8
77 daddu $2,$9,$2 # add high product limb and carry from addition 77 daddu $2,$9,$2 # add high product limb and carry from addition
78 78
79/* # cool down phase 0 */ 79/* # cool down phase 0 */
80$LC0: mflo $10 80$LC0: mflo $10
81 mfhi $9 81 mfhi $9
82 daddu $10,$10,$2 82 daddu $10,$10,$2
83 sltu $2,$10,$2 83 sltu $2,$10,$2
84 sd $10,0($4) 84 sd $10,0($4)
85 j $31 85 j $31
86 daddu $2,$9,$2 # add high product limb and carry from addition 86 daddu $2,$9,$2 # add high product limb and carry from addition
87 87
88 .end _gcry_mpih_mul_1 88 .end _gcry_mpih_mul_1
89 89
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul2.S
index a83c9eb..ca82763 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul2.S
@@ -1,101 +1,101 @@
1/* MIPS3 addmul_1 -- Multiply a limb vector with a single limb and 1/* MIPS3 addmul_1 -- Multiply a limb vector with a single limb and
2 * add the product to a second limb vector. 2 * add the product to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1995, 1998, 2000 4 * Copyright (C) 1992, 1994, 1995, 1998, 2000
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 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r4) 27 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r4)
28 * mpi_ptr_t s1_ptr, (r5) 28 * mpi_ptr_t s1_ptr, (r5)
29 * mpi_size_t s1_size, (r6) 29 * mpi_size_t s1_size, (r6)
30 * mpi_limb_t s2_limb) (r7) 30 * mpi_limb_t s2_limb) (r7)
31 */ 31 */
32 32
33 .text 33 .text
34 .align 4 34 .align 4
35 .globl _gcry_mpih_addmul_1 35 .globl _gcry_mpih_addmul_1
36 .ent _gcry_mpih_addmul_1 36 .ent _gcry_mpih_addmul_1
37_gcry_mpih_addmul_1: 37_gcry_mpih_addmul_1:
38 .set noreorder 38 .set noreorder
39 .set nomacro 39 .set nomacro
40 40
41/* # warm up phase 0 */ 41/* # warm up phase 0 */
42 ld $8,0($5) 42 ld $8,0($5)
43 43
44/* # warm up phase 1 */ 44/* # warm up phase 1 */
45 daddiu $5,$5,8 45 daddiu $5,$5,8
46 dmultu $8,$7 46 dmultu $8,$7
47 47
48 daddiu $6,$6,-1 48 daddiu $6,$6,-1
49 beq $6,$0,$LC0 49 beq $6,$0,$LC0
50 move $2,$0 # zero cy2 50 move $2,$0 # zero cy2
51 51
52 daddiu $6,$6,-1 52 daddiu $6,$6,-1
53 beq $6,$0,$LC1 53 beq $6,$0,$LC1
54 ld $8,0($5) # load new s1 limb as early as possible 54 ld $8,0($5) # load new s1 limb as early as possible
55 55
56Loop: ld $10,0($4) 56Loop: ld $10,0($4)
57 mflo $3 57 mflo $3
58 mfhi $9 58 mfhi $9
59 daddiu $5,$5,8 59 daddiu $5,$5,8
60 daddu $3,$3,$2 # add old carry limb to low product limb 60 daddu $3,$3,$2 # add old carry limb to low product limb
61 dmultu $8,$7 61 dmultu $8,$7
62 ld $8,0($5) # load new s1 limb as early as possible 62 ld $8,0($5) # load new s1 limb as early as possible
63 daddiu $6,$6,-1 # decrement loop counter 63 daddiu $6,$6,-1 # decrement loop counter
64 sltu $2,$3,$2 # carry from previous addition -> $2 64 sltu $2,$3,$2 # carry from previous addition -> $2
65 daddu $3,$10,$3 65 daddu $3,$10,$3
66 sltu $10,$3,$10 66 sltu $10,$3,$10
67 daddu $2,$2,$10 67 daddu $2,$2,$10
68 sd $3,0($4) 68 sd $3,0($4)
69 daddiu $4,$4,8 69 daddiu $4,$4,8
70 bne $6,$0,Loop 70 bne $6,$0,Loop
71 daddu $2,$9,$2 # add high product limb and carry from addition 71 daddu $2,$9,$2 # add high product limb and carry from addition
72 72
73/* # cool down phase 1 */ 73/* # cool down phase 1 */
74$LC1: ld $10,0($4) 74$LC1: ld $10,0($4)
75 mflo $3 75 mflo $3
76 mfhi $9 76 mfhi $9
77 daddu $3,$3,$2 77 daddu $3,$3,$2
78 sltu $2,$3,$2 78 sltu $2,$3,$2
79 dmultu $8,$7 79 dmultu $8,$7
80 daddu $3,$10,$3 80 daddu $3,$10,$3
81 sltu $10,$3,$10 81 sltu $10,$3,$10
82 daddu $2,$2,$10 82 daddu $2,$2,$10
83 sd $3,0($4) 83 sd $3,0($4)
84 daddiu $4,$4,8 84 daddiu $4,$4,8
85 daddu $2,$9,$2 # add high product limb and carry from addition 85 daddu $2,$9,$2 # add high product limb and carry from addition
86 86
87/* # cool down phase 0 */ 87/* # cool down phase 0 */
88$LC0: ld $10,0($4) 88$LC0: ld $10,0($4)
89 mflo $3 89 mflo $3
90 mfhi $9 90 mfhi $9
91 daddu $3,$3,$2 91 daddu $3,$3,$2
92 sltu $2,$3,$2 92 sltu $2,$3,$2
93 daddu $3,$10,$3 93 daddu $3,$10,$3
94 sltu $10,$3,$10 94 sltu $10,$3,$10
95 daddu $2,$2,$10 95 daddu $2,$2,$10
96 sd $3,0($4) 96 sd $3,0($4)
97 j $31 97 j $31
98 daddu $2,$9,$2 # add high product limb and carry from addition 98 daddu $2,$9,$2 # add high product limb and carry from addition
99 99
100 .end _gcry_mpih_addmul_1 100 .end _gcry_mpih_addmul_1
101 101
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul3.S
index 1815044..be421a6 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-mul3.S
@@ -1,101 +1,101 @@
1/* MIPS3 submul_1 -- Multiply a limb vector with a single limb and 1/* MIPS3 submul_1 -- Multiply a limb vector with a single limb and
2 * subtract the product from a second limb vector. 2 * subtract the product from a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1995, 1998, 2000 4 * Copyright (C) 1992, 1994, 1995, 1998, 2000
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 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r4) 27 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r4)
28 * mpi_ptr_t s1_ptr, (r5) 28 * mpi_ptr_t s1_ptr, (r5)
29 * mpi_size_t s1_size, (r6) 29 * mpi_size_t s1_size, (r6)
30 * mpi_limb_t s2_limb) (r7) 30 * mpi_limb_t s2_limb) (r7)
31 */ 31 */
32 32
33 .text 33 .text
34 .align 4 34 .align 4
35 .globl _gcry_mpih_submul_1 35 .globl _gcry_mpih_submul_1
36 .ent _gcry_mpih_submul_1 36 .ent _gcry_mpih_submul_1
37_gcry_mpih_submul_1: 37_gcry_mpih_submul_1:
38 .set noreorder 38 .set noreorder
39 .set nomacro 39 .set nomacro
40 40
41/* # warm up phase 0 */ 41/* # warm up phase 0 */
42 ld $8,0($5) 42 ld $8,0($5)
43 43
44/* # warm up phase 1 */ 44/* # warm up phase 1 */
45 daddiu $5,$5,8 45 daddiu $5,$5,8
46 dmultu $8,$7 46 dmultu $8,$7
47 47
48 daddiu $6,$6,-1 48 daddiu $6,$6,-1
49 beq $6,$0,$LC0 49 beq $6,$0,$LC0
50 move $2,$0 # zero cy2 50 move $2,$0 # zero cy2
51 51
52 daddiu $6,$6,-1 52 daddiu $6,$6,-1
53 beq $6,$0,$LC1 53 beq $6,$0,$LC1
54 ld $8,0($5) # load new s1 limb as early as possible 54 ld $8,0($5) # load new s1 limb as early as possible
55 55
56Loop: ld $10,0($4) 56Loop: ld $10,0($4)
57 mflo $3 57 mflo $3
58 mfhi $9 58 mfhi $9
59 daddiu $5,$5,8 59 daddiu $5,$5,8
60 daddu $3,$3,$2 # add old carry limb to low product limb 60 daddu $3,$3,$2 # add old carry limb to low product limb
61 dmultu $8,$7 61 dmultu $8,$7
62 ld $8,0($5) # load new s1 limb as early as possible 62 ld $8,0($5) # load new s1 limb as early as possible
63 daddiu $6,$6,-1 # decrement loop counter 63 daddiu $6,$6,-1 # decrement loop counter
64 sltu $2,$3,$2 # carry from previous addition -> $2 64 sltu $2,$3,$2 # carry from previous addition -> $2
65 dsubu $3,$10,$3 65 dsubu $3,$10,$3
66 sgtu $10,$3,$10 66 sgtu $10,$3,$10
67 daddu $2,$2,$10 67 daddu $2,$2,$10
68 sd $3,0($4) 68 sd $3,0($4)
69 daddiu $4,$4,8 69 daddiu $4,$4,8
70 bne $6,$0,Loop 70 bne $6,$0,Loop
71 daddu $2,$9,$2 # add high product limb and carry from addition 71 daddu $2,$9,$2 # add high product limb and carry from addition
72 72
73/* # cool down phase 1 */ 73/* # cool down phase 1 */
74$LC1: ld $10,0($4) 74$LC1: ld $10,0($4)
75 mflo $3 75 mflo $3
76 mfhi $9 76 mfhi $9
77 daddu $3,$3,$2 77 daddu $3,$3,$2
78 sltu $2,$3,$2 78 sltu $2,$3,$2
79 dmultu $8,$7 79 dmultu $8,$7
80 dsubu $3,$10,$3 80 dsubu $3,$10,$3
81 sgtu $10,$3,$10 81 sgtu $10,$3,$10
82 daddu $2,$2,$10 82 daddu $2,$2,$10
83 sd $3,0($4) 83 sd $3,0($4)
84 daddiu $4,$4,8 84 daddiu $4,$4,8
85 daddu $2,$9,$2 # add high product limb and carry from addition 85 daddu $2,$9,$2 # add high product limb and carry from addition
86 86
87/* # cool down phase 0 */ 87/* # cool down phase 0 */
88$LC0: ld $10,0($4) 88$LC0: ld $10,0($4)
89 mflo $3 89 mflo $3
90 mfhi $9 90 mfhi $9
91 daddu $3,$3,$2 91 daddu $3,$3,$2
92 sltu $2,$3,$2 92 sltu $2,$3,$2
93 dsubu $3,$10,$3 93 dsubu $3,$10,$3
94 sgtu $10,$3,$10 94 sgtu $10,$3,$10
95 daddu $2,$2,$10 95 daddu $2,$2,$10
96 sd $3,0($4) 96 sd $3,0($4)
97 j $31 97 j $31
98 daddu $2,$9,$2 # add high product limb and carry from addition 98 daddu $2,$9,$2 # add high product limb and carry from addition
99 99
100 .end _gcry_mpih_submul_1 100 .end _gcry_mpih_submul_1
101 101
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-rshift.S
index 265fd9e..e7e035a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-rshift.S
@@ -1,95 +1,95 @@
1/* mips3 rshift 1/* mips3 rshift
2 * 2 *
3 * Copyright (C) 1995, 1998, 2000 3 * Copyright (C) 1995, 1998, 2000
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23/******************* 23/*******************
24 * mpi_limb_t 24 * mpi_limb_t
25 * _gcry_mpih_rshift( mpi_ptr_t wp, ($4) 25 * _gcry_mpih_rshift( mpi_ptr_t wp, ($4)
26 * mpi_ptr_t up, ($5) 26 * mpi_ptr_t up, ($5)
27 * mpi_size_t usize, ($6) 27 * mpi_size_t usize, ($6)
28 * unsigned cnt) ($7) 28 * unsigned cnt) ($7)
29 */ 29 */
30 30
31 .text 31 .text
32 .align 2 32 .align 2
33 .globl _gcry_mpih_rshift 33 .globl _gcry_mpih_rshift
34 .ent _gcry_mpih_rshift 34 .ent _gcry_mpih_rshift
35_gcry_mpih_rshift: 35_gcry_mpih_rshift:
36 .set noreorder 36 .set noreorder
37 .set nomacro 37 .set nomacro
38 38
39 ld $10,0($5) # load first limb 39 ld $10,0($5) # load first limb
40 dsubu $13,$0,$7 40 dsubu $13,$0,$7
41 daddiu $6,$6,-1 41 daddiu $6,$6,-1
42 and $9,$6,4-1 # number of limbs in first loop 42 and $9,$6,4-1 # number of limbs in first loop
43 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop 43 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop
44 dsll $2,$10,$13 # compute function result 44 dsll $2,$10,$13 # compute function result
45 45
46 dsubu $6,$6,$9 46 dsubu $6,$6,$9
47 47
48.Loop0: ld $3,8($5) 48.Loop0: ld $3,8($5)
49 daddiu $4,$4,8 49 daddiu $4,$4,8
50 daddiu $5,$5,8 50 daddiu $5,$5,8
51 daddiu $9,$9,-1 51 daddiu $9,$9,-1
52 dsrl $11,$10,$7 52 dsrl $11,$10,$7
53 dsll $12,$3,$13 53 dsll $12,$3,$13
54 move $10,$3 54 move $10,$3
55 or $8,$11,$12 55 or $8,$11,$12
56 bne $9,$0,.Loop0 56 bne $9,$0,.Loop0
57 sd $8,-8($4) 57 sd $8,-8($4)
58 58
59.L0: beq $6,$0,.Lend 59.L0: beq $6,$0,.Lend
60 nop 60 nop
61 61
62.Loop: ld $3,8($5) 62.Loop: ld $3,8($5)
63 daddiu $4,$4,32 63 daddiu $4,$4,32
64 daddiu $6,$6,-4 64 daddiu $6,$6,-4
65 dsrl $11,$10,$7 65 dsrl $11,$10,$7
66 dsll $12,$3,$13 66 dsll $12,$3,$13
67 67
68 ld $10,16($5) 68 ld $10,16($5)
69 dsrl $14,$3,$7 69 dsrl $14,$3,$7
70 or $8,$11,$12 70 or $8,$11,$12
71 sd $8,-32($4) 71 sd $8,-32($4)
72 dsll $9,$10,$13 72 dsll $9,$10,$13
73 73
74 ld $3,24($5) 74 ld $3,24($5)
75 dsrl $11,$10,$7 75 dsrl $11,$10,$7
76 or $8,$14,$9 76 or $8,$14,$9
77 sd $8,-24($4) 77 sd $8,-24($4)
78 dsll $12,$3,$13 78 dsll $12,$3,$13
79 79
80 ld $10,32($5) 80 ld $10,32($5)
81 dsrl $14,$3,$7 81 dsrl $14,$3,$7
82 or $8,$11,$12 82 or $8,$11,$12
83 sd $8,-16($4) 83 sd $8,-16($4)
84 dsll $9,$10,$13 84 dsll $9,$10,$13
85 85
86 daddiu $5,$5,32 86 daddiu $5,$5,32
87 or $8,$14,$9 87 or $8,$14,$9
88 bgtz $6,.Loop 88 bgtz $6,.Loop
89 sd $8,-8($4) 89 sd $8,-8($4)
90 90
91.Lend: dsrl $8,$10,$7 91.Lend: dsrl $8,$10,$7
92 j $31 92 j $31
93 sd $8,0($4) 93 sd $8,0($4)
94 .end _gcry_mpih_rshift 94 .end _gcry_mpih_rshift
95 95
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-sub1.S
index 32cc0e5..9fac674 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mips3/mpih-sub1.S
@@ -1,125 +1,125 @@
1/* mips3 sub_n -- Subtract two limb vectors of the same length > 0 and 1/* mips3 sub_n -- Subtract two limb vectors of the same length > 0 and
2 * store difference in a third limb vector. 2 * store difference in a third limb vector.
3 * 3 *
4 * Copyright (C) 1995, 1998, 1999, 2000, 4 * Copyright (C) 1995, 1998, 1999, 2000,
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 23
24 24
25/******************* 25/*******************
26 * mpi_limb_t 26 * mpi_limb_t
27 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (r4) 27 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (r4)
28 * mpi_ptr_t s1_ptr, (r5) 28 * mpi_ptr_t s1_ptr, (r5)
29 * mpi_ptr_t s2_ptr, (r6) 29 * mpi_ptr_t s2_ptr, (r6)
30 * mpi_size_t size) (r7) 30 * mpi_size_t size) (r7)
31 */ 31 */
32 32
33 33
34 .text 34 .text
35 .align 2 35 .align 2
36 .globl _gcry_mpih_sub_n 36 .globl _gcry_mpih_sub_n
37 .ent _gcry_mpih_sub_n 37 .ent _gcry_mpih_sub_n
38_gcry_mpih_sub_n: 38_gcry_mpih_sub_n:
39 .set noreorder 39 .set noreorder
40 .set nomacro 40 .set nomacro
41 41
42 ld $10,0($5) 42 ld $10,0($5)
43 ld $11,0($6) 43 ld $11,0($6)
44 44
45 daddiu $7,$7,-1 45 daddiu $7,$7,-1
46 and $9,$7,4-1 # number of limbs in first loop 46 and $9,$7,4-1 # number of limbs in first loop
47 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop 47 beq $9,$0,.L0 # if multiple of 4 limbs, skip first loop
48 move $2,$0 48 move $2,$0
49 49
50 dsubu $7,$7,$9 50 dsubu $7,$7,$9
51 51
52.Loop0: daddiu $9,$9,-1 52.Loop0: daddiu $9,$9,-1
53 ld $12,8($5) 53 ld $12,8($5)
54 daddu $11,$11,$2 54 daddu $11,$11,$2
55 ld $13,8($6) 55 ld $13,8($6)
56 sltu $8,$11,$2 56 sltu $8,$11,$2
57 dsubu $11,$10,$11 57 dsubu $11,$10,$11
58 sltu $2,$10,$11 58 sltu $2,$10,$11
59 sd $11,0($4) 59 sd $11,0($4)
60 or $2,$2,$8 60 or $2,$2,$8
61 61
62 daddiu $5,$5,8 62 daddiu $5,$5,8
63 daddiu $6,$6,8 63 daddiu $6,$6,8
64 move $10,$12 64 move $10,$12
65 move $11,$13 65 move $11,$13
66 bne $9,$0,.Loop0 66 bne $9,$0,.Loop0
67 daddiu $4,$4,8 67 daddiu $4,$4,8
68 68
69.L0: beq $7,$0,.Lend 69.L0: beq $7,$0,.Lend
70 nop 70 nop
71 71
72.Loop: daddiu $7,$7,-4 72.Loop: daddiu $7,$7,-4
73 73
74 ld $12,8($5) 74 ld $12,8($5)
75 daddu $11,$11,$2 75 daddu $11,$11,$2
76 ld $13,8($6) 76 ld $13,8($6)
77 sltu $8,$11,$2 77 sltu $8,$11,$2
78 dsubu $11,$10,$11 78 dsubu $11,$10,$11
79 sltu $2,$10,$11 79 sltu $2,$10,$11
80 sd $11,0($4) 80 sd $11,0($4)
81 or $2,$2,$8 81 or $2,$2,$8
82 82
83 ld $10,16($5) 83 ld $10,16($5)
84 daddu $13,$13,$2 84 daddu $13,$13,$2
85 ld $11,16($6) 85 ld $11,16($6)
86 sltu $8,$13,$2 86 sltu $8,$13,$2
87 dsubu $13,$12,$13 87 dsubu $13,$12,$13
88 sltu $2,$12,$13 88 sltu $2,$12,$13
89 sd $13,8($4) 89 sd $13,8($4)
90 or $2,$2,$8 90 or $2,$2,$8
91 91
92 ld $12,24($5) 92 ld $12,24($5)
93 daddu $11,$11,$2 93 daddu $11,$11,$2
94 ld $13,24($6) 94 ld $13,24($6)
95 sltu $8,$11,$2 95 sltu $8,$11,$2
96 dsubu $11,$10,$11 96 dsubu $11,$10,$11
97 sltu $2,$10,$11 97 sltu $2,$10,$11
98 sd $11,16($4) 98 sd $11,16($4)
99 or $2,$2,$8 99 or $2,$2,$8
100 100
101 ld $10,32($5) 101 ld $10,32($5)
102 daddu $13,$13,$2 102 daddu $13,$13,$2
103 ld $11,32($6) 103 ld $11,32($6)
104 sltu $8,$13,$2 104 sltu $8,$13,$2
105 dsubu $13,$12,$13 105 dsubu $13,$12,$13
106 sltu $2,$12,$13 106 sltu $2,$12,$13
107 sd $13,24($4) 107 sd $13,24($4)
108 or $2,$2,$8 108 or $2,$2,$8
109 109
110 daddiu $5,$5,32 110 daddiu $5,$5,32
111 daddiu $6,$6,32 111 daddiu $6,$6,32
112 112
113 bne $7,$0,.Loop 113 bne $7,$0,.Loop
114 daddiu $4,$4,32 114 daddiu $4,$4,32
115 115
116.Lend: daddu $11,$11,$2 116.Lend: daddu $11,$11,$2
117 sltu $8,$11,$2 117 sltu $8,$11,$2
118 dsubu $11,$10,$11 118 dsubu $11,$10,$11
119 sltu $2,$10,$11 119 sltu $2,$10,$11
120 sd $11,0($4) 120 sd $11,0($4)
121 j $31 121 j $31
122 or $2,$2,$8 122 or $2,$2,$8
123 123
124 .end _gcry_mpih_sub_n 124 .end _gcry_mpih_sub_n
125 125
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-add.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-add.c
index 95e5142..ada257a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-add.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-add.c
@@ -1,236 +1,236 @@
1/* mpi-add.c - MPI functions 1/* mpi-add.c - MPI functions
2 * Copyright (C) 1994, 1996, 1998, 2001, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1994, 1996, 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 * 19 *
20 * Note: This code is heavily based on the GNU MP Library. 20 * Note: This code is heavily based on the GNU MP Library.
21 * Actually it's the same code with only minor changes in the 21 * Actually it's the same code with only minor changes in the
22 * way the data is stored; this is to support the abstraction 22 * way the data is stored; this is to support the abstraction
23 * of an optional secure memory allocation which may be used 23 * of an optional secure memory allocation which may be used
24 * to avoid revealing of sensitive data due to paging etc. 24 * to avoid revealing of sensitive data due to paging etc.
25 */ 25 */
26 26
27#include <config.h> 27#include <config.h>
28#include <stdio.h> 28#include <stdio.h>
29#include <stdlib.h> 29#include <stdlib.h>
30 30
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32 32
33 33
34/**************** 34/****************
35 * Add the unsigned integer V to the mpi-integer U and store the 35 * Add the unsigned integer V to the mpi-integer U and store the
36 * result in W. U and V may be the same. 36 * result in W. U and V may be the same.
37 */ 37 */
38void 38void
39gcry_mpi_add_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v ) 39gcry_mpi_add_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v )
40{ 40{
41 mpi_ptr_t wp, up; 41 mpi_ptr_t wp, up;
42 mpi_size_t usize, wsize; 42 mpi_size_t usize, wsize;
43 int usign, wsign; 43 int usign, wsign;
44 44
45 usize = u->nlimbs; 45 usize = u->nlimbs;
46 usign = u->sign; 46 usign = u->sign;
47 wsign = 0; 47 wsign = 0;
48 48
49 /* If not space for W (and possible carry), increase space. */ 49 /* If not space for W (and possible carry), increase space. */
50 wsize = usize + 1; 50 wsize = usize + 1;
51 if( w->alloced < wsize ) 51 if( w->alloced < wsize )
52 mpi_resize(w, wsize); 52 mpi_resize(w, wsize);
53 53
54 /* These must be after realloc (U may be the same as W). */ 54 /* These must be after realloc (U may be the same as W). */
55 up = u->d; 55 up = u->d;
56 wp = w->d; 56 wp = w->d;
57 57
58 if( !usize ) { /* simple */ 58 if( !usize ) { /* simple */
59 wp[0] = v; 59 wp[0] = v;
60 wsize = v? 1:0; 60 wsize = v? 1:0;
61 } 61 }
62 else if( !usign ) { /* mpi is not negative */ 62 else if( !usign ) { /* mpi is not negative */
63 mpi_limb_t cy; 63 mpi_limb_t cy;
64 cy = _gcry_mpih_add_1(wp, up, usize, v); 64 cy = _gcry_mpih_add_1(wp, up, usize, v);
65 wp[usize] = cy; 65 wp[usize] = cy;
66 wsize = usize + cy; 66 wsize = usize + cy;
67 } 67 }
68 else { /* The signs are different. Need exact comparison to determine 68 else { /* The signs are different. Need exact comparison to determine
69 * which operand to subtract from which. */ 69 * which operand to subtract from which. */
70 if( usize == 1 && up[0] < v ) { 70 if( usize == 1 && up[0] < v ) {
71 wp[0] = v - up[0]; 71 wp[0] = v - up[0];
72 wsize = 1; 72 wsize = 1;
73 } 73 }
74 else { 74 else {
75 _gcry_mpih_sub_1(wp, up, usize, v); 75 _gcry_mpih_sub_1(wp, up, usize, v);
76 /* Size can decrease with at most one limb. */ 76 /* Size can decrease with at most one limb. */
77 wsize = usize - (wp[usize-1]==0); 77 wsize = usize - (wp[usize-1]==0);
78 wsign = 1; 78 wsign = 1;
79 } 79 }
80 } 80 }
81 81
82 w->nlimbs = wsize; 82 w->nlimbs = wsize;
83 w->sign = wsign; 83 w->sign = wsign;
84} 84}
85 85
86 86
87void 87void
88gcry_mpi_add(gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v) 88gcry_mpi_add(gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
89{ 89{
90 mpi_ptr_t wp, up, vp; 90 mpi_ptr_t wp, up, vp;
91 mpi_size_t usize, vsize, wsize; 91 mpi_size_t usize, vsize, wsize;
92 int usign, vsign, wsign; 92 int usign, vsign, wsign;
93 93
94 if( u->nlimbs < v->nlimbs ) { /* Swap U and V. */ 94 if( u->nlimbs < v->nlimbs ) { /* Swap U and V. */
95 usize = v->nlimbs; 95 usize = v->nlimbs;
96 usign = v->sign; 96 usign = v->sign;
97 vsize = u->nlimbs; 97 vsize = u->nlimbs;
98 vsign = u->sign; 98 vsign = u->sign;
99 wsize = usize + 1; 99 wsize = usize + 1;
100 RESIZE_IF_NEEDED(w, wsize); 100 RESIZE_IF_NEEDED(w, wsize);
101 /* These must be after realloc (u or v may be the same as w). */ 101 /* These must be after realloc (u or v may be the same as w). */
102 up = v->d; 102 up = v->d;
103 vp = u->d; 103 vp = u->d;
104 } 104 }
105 else { 105 else {
106 usize = u->nlimbs; 106 usize = u->nlimbs;
107 usign = u->sign; 107 usign = u->sign;
108 vsize = v->nlimbs; 108 vsize = v->nlimbs;
109 vsign = v->sign; 109 vsign = v->sign;
110 wsize = usize + 1; 110 wsize = usize + 1;
111 RESIZE_IF_NEEDED(w, wsize); 111 RESIZE_IF_NEEDED(w, wsize);
112 /* These must be after realloc (u or v may be the same as w). */ 112 /* These must be after realloc (u or v may be the same as w). */
113 up = u->d; 113 up = u->d;
114 vp = v->d; 114 vp = v->d;
115 } 115 }
116 wp = w->d; 116 wp = w->d;
117 wsign = 0; 117 wsign = 0;
118 118
119 if( !vsize ) { /* simple */ 119 if( !vsize ) { /* simple */
120 MPN_COPY(wp, up, usize ); 120 MPN_COPY(wp, up, usize );
121 wsize = usize; 121 wsize = usize;
122 wsign = usign; 122 wsign = usign;
123 } 123 }
124 else if( usign != vsign ) { /* different sign */ 124 else if( usign != vsign ) { /* different sign */
125 /* This test is right since USIZE >= VSIZE */ 125 /* This test is right since USIZE >= VSIZE */
126 if( usize != vsize ) { 126 if( usize != vsize ) {
127 _gcry_mpih_sub(wp, up, usize, vp, vsize); 127 _gcry_mpih_sub(wp, up, usize, vp, vsize);
128 wsize = usize; 128 wsize = usize;
129 MPN_NORMALIZE(wp, wsize); 129 MPN_NORMALIZE(wp, wsize);
130 wsign = usign; 130 wsign = usign;
131 } 131 }
132 else if( _gcry_mpih_cmp(up, vp, usize) < 0 ) { 132 else if( _gcry_mpih_cmp(up, vp, usize) < 0 ) {
133 _gcry_mpih_sub_n(wp, vp, up, usize); 133 _gcry_mpih_sub_n(wp, vp, up, usize);
134 wsize = usize; 134 wsize = usize;
135 MPN_NORMALIZE(wp, wsize); 135 MPN_NORMALIZE(wp, wsize);
136 if( !usign ) 136 if( !usign )
137 wsign = 1; 137 wsign = 1;
138 } 138 }
139 else { 139 else {
140 _gcry_mpih_sub_n(wp, up, vp, usize); 140 _gcry_mpih_sub_n(wp, up, vp, usize);
141 wsize = usize; 141 wsize = usize;
142 MPN_NORMALIZE(wp, wsize); 142 MPN_NORMALIZE(wp, wsize);
143 if( usign ) 143 if( usign )
144 wsign = 1; 144 wsign = 1;
145 } 145 }
146 } 146 }
147 else { /* U and V have same sign. Add them. */ 147 else { /* U and V have same sign. Add them. */
148 mpi_limb_t cy = _gcry_mpih_add(wp, up, usize, vp, vsize); 148 mpi_limb_t cy = _gcry_mpih_add(wp, up, usize, vp, vsize);
149 wp[usize] = cy; 149 wp[usize] = cy;
150 wsize = usize + cy; 150 wsize = usize + cy;
151 if( usign ) 151 if( usign )
152 wsign = 1; 152 wsign = 1;
153 } 153 }
154 154
155 w->nlimbs = wsize; 155 w->nlimbs = wsize;
156 w->sign = wsign; 156 w->sign = wsign;
157} 157}
158 158
159 159
160/**************** 160/****************
161 * Subtract the unsigned integer V from the mpi-integer U and store the 161 * Subtract the unsigned integer V from the mpi-integer U and store the
162 * result in W. 162 * result in W.
163 */ 163 */
164void 164void
165gcry_mpi_sub_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v ) 165gcry_mpi_sub_ui(gcry_mpi_t w, gcry_mpi_t u, unsigned long v )
166{ 166{
167 mpi_ptr_t wp, up; 167 mpi_ptr_t wp, up;
168 mpi_size_t usize, wsize; 168 mpi_size_t usize, wsize;
169 int usign, wsign; 169 int usign, wsign;
170 170
171 usize = u->nlimbs; 171 usize = u->nlimbs;
172 usign = u->sign; 172 usign = u->sign;
173 wsign = 0; 173 wsign = 0;
174 174
175 /* If not space for W (and possible carry), increase space. */ 175 /* If not space for W (and possible carry), increase space. */
176 wsize = usize + 1; 176 wsize = usize + 1;
177 if( w->alloced < wsize ) 177 if( w->alloced < wsize )
178 mpi_resize(w, wsize); 178 mpi_resize(w, wsize);
179 179
180 /* These must be after realloc (U may be the same as W). */ 180 /* These must be after realloc (U may be the same as W). */
181 up = u->d; 181 up = u->d;
182 wp = w->d; 182 wp = w->d;
183 183
184 if( !usize ) { /* simple */ 184 if( !usize ) { /* simple */
185 wp[0] = v; 185 wp[0] = v;
186 wsize = v? 1:0; 186 wsize = v? 1:0;
187 wsign = 1; 187 wsign = 1;
188 } 188 }
189 else if( usign ) { /* mpi and v are negative */ 189 else if( usign ) { /* mpi and v are negative */
190 mpi_limb_t cy; 190 mpi_limb_t cy;
191 cy = _gcry_mpih_add_1(wp, up, usize, v); 191 cy = _gcry_mpih_add_1(wp, up, usize, v);
192 wp[usize] = cy; 192 wp[usize] = cy;
193 wsize = usize + cy; 193 wsize = usize + cy;
194 } 194 }
195 else { /* The signs are different. Need exact comparison to determine 195 else { /* The signs are different. Need exact comparison to determine
196 * which operand to subtract from which. */ 196 * which operand to subtract from which. */
197 if( usize == 1 && up[0] < v ) { 197 if( usize == 1 && up[0] < v ) {
198 wp[0] = v - up[0]; 198 wp[0] = v - up[0];
199 wsize = 1; 199 wsize = 1;
200 wsign = 1; 200 wsign = 1;
201 } 201 }
202 else { 202 else {
203 _gcry_mpih_sub_1(wp, up, usize, v); 203 _gcry_mpih_sub_1(wp, up, usize, v);
204 /* Size can decrease with at most one limb. */ 204 /* Size can decrease with at most one limb. */
205 wsize = usize - (wp[usize-1]==0); 205 wsize = usize - (wp[usize-1]==0);
206 } 206 }
207 } 207 }
208 208
209 w->nlimbs = wsize; 209 w->nlimbs = wsize;
210 w->sign = wsign; 210 w->sign = wsign;
211} 211}
212 212
213void 213void
214gcry_mpi_sub(gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v) 214gcry_mpi_sub(gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
215{ 215{
216 gcry_mpi_t vv = mpi_copy (v); 216 gcry_mpi_t vv = mpi_copy (v);
217 vv->sign = ! vv->sign; 217 vv->sign = ! vv->sign;
218 gcry_mpi_add (w, u, vv); 218 gcry_mpi_add (w, u, vv);
219 mpi_free (vv); 219 mpi_free (vv);
220} 220}
221 221
222 222
223void 223void
224gcry_mpi_addm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m) 224gcry_mpi_addm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m)
225{ 225{
226 gcry_mpi_add(w, u, v); 226 gcry_mpi_add(w, u, v);
227 _gcry_mpi_fdiv_r( w, w, m ); 227 _gcry_mpi_fdiv_r( w, w, m );
228} 228}
229 229
230void 230void
231gcry_mpi_subm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m) 231gcry_mpi_subm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m)
232{ 232{
233 gcry_mpi_sub(w, u, v); 233 gcry_mpi_sub(w, u, v);
234 _gcry_mpi_fdiv_r( w, w, m ); 234 _gcry_mpi_fdiv_r( w, w, m );
235} 235}
236 236
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-bit.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-bit.c
index 00cfc1c..26853ef 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-bit.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-bit.c
@@ -1,257 +1,257 @@
1/* mpi-bit.c - MPI bit level fucntions 1/* mpi-bit.c - MPI bit level fucntions
2 * Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. 2 * Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include <assert.h> 24#include <assert.h>
25#include "mpi-internal.h" 25#include "mpi-internal.h"
26#include "longlong.h" 26#include "longlong.h"
27 27
28 28
29#ifdef MPI_INTERNAL_NEED_CLZ_TAB 29#ifdef MPI_INTERNAL_NEED_CLZ_TAB
30#ifdef __STDC__ 30#ifdef __STDC__
31const 31const
32#endif 32#endif
33unsigned char 33unsigned char
34_gcry_clz_tab[] = 34_gcry_clz_tab[] =
35{ 35{
36 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, 36 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
37 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 37 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
38 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 38 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
39 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 39 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
40 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 40 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
41 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 41 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
42 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 42 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
43 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 43 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
44}; 44};
45#endif 45#endif
46 46
47 47
48#define A_LIMB_1 ((mpi_limb_t)1) 48#define A_LIMB_1 ((mpi_limb_t)1)
49 49
50 50
51/**************** 51/****************
52 * Sometimes we have MSL (most significant limbs) which are 0; 52 * Sometimes we have MSL (most significant limbs) which are 0;
53 * this is for some reasons not good, so this function removes them. 53 * this is for some reasons not good, so this function removes them.
54 */ 54 */
55void 55void
56_gcry_mpi_normalize( gcry_mpi_t a ) 56_gcry_mpi_normalize( gcry_mpi_t a )
57{ 57{
58 if( mpi_is_opaque(a) ) 58 if( mpi_is_opaque(a) )
59 return; 59 return;
60 60
61 for( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- ) 61 for( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- )
62 ; 62 ;
63} 63}
64 64
65 65
66 66
67/**************** 67/****************
68 * Return the number of bits in A. 68 * Return the number of bits in A.
69 */ 69 */
70unsigned int 70unsigned int
71gcry_mpi_get_nbits( gcry_mpi_t a ) 71gcry_mpi_get_nbits( gcry_mpi_t a )
72{ 72{
73 unsigned n; 73 unsigned n;
74 74
75 if( mpi_is_opaque(a) ) { 75 if( mpi_is_opaque(a) ) {
76 return a->sign; /* which holds the number of bits */ 76 return a->sign; /* which holds the number of bits */
77 } 77 }
78 78
79 _gcry_mpi_normalize( a ); 79 _gcry_mpi_normalize( a );
80 if( a->nlimbs ) { 80 if( a->nlimbs ) {
81 mpi_limb_t alimb = a->d[a->nlimbs-1]; 81 mpi_limb_t alimb = a->d[a->nlimbs-1];
82 if( alimb ) 82 if( alimb )
83 count_leading_zeros( n, alimb ); 83 count_leading_zeros( n, alimb );
84 else 84 else
85 n = BITS_PER_MPI_LIMB; 85 n = BITS_PER_MPI_LIMB;
86 n = BITS_PER_MPI_LIMB - n + (a->nlimbs-1) * BITS_PER_MPI_LIMB; 86 n = BITS_PER_MPI_LIMB - n + (a->nlimbs-1) * BITS_PER_MPI_LIMB;
87 } 87 }
88 else 88 else
89 n = 0; 89 n = 0;
90 return n; 90 return n;
91} 91}
92 92
93 93
94/**************** 94/****************
95 * Test whether bit N is set. 95 * Test whether bit N is set.
96 */ 96 */
97int 97int
98gcry_mpi_test_bit( gcry_mpi_t a, unsigned int n ) 98gcry_mpi_test_bit( gcry_mpi_t a, unsigned int n )
99{ 99{
100 unsigned int limbno, bitno; 100 unsigned int limbno, bitno;
101 mpi_limb_t limb; 101 mpi_limb_t limb;
102 102
103 limbno = n / BITS_PER_MPI_LIMB; 103 limbno = n / BITS_PER_MPI_LIMB;
104 bitno = n % BITS_PER_MPI_LIMB; 104 bitno = n % BITS_PER_MPI_LIMB;
105 105
106 if( limbno >= a->nlimbs ) 106 if( limbno >= a->nlimbs )
107 return 0; /* too far left: this is a 0 */ 107 return 0; /* too far left: this is a 0 */
108 limb = a->d[limbno]; 108 limb = a->d[limbno];
109 return (limb & (A_LIMB_1 << bitno))? 1: 0; 109 return (limb & (A_LIMB_1 << bitno))? 1: 0;
110} 110}
111 111
112 112
113/**************** 113/****************
114 * Set bit N of A. 114 * Set bit N of A.
115 */ 115 */
116void 116void
117gcry_mpi_set_bit( gcry_mpi_t a, unsigned int n ) 117gcry_mpi_set_bit( gcry_mpi_t a, unsigned int n )
118{ 118{
119 unsigned int limbno, bitno; 119 unsigned int limbno, bitno;
120 120
121 limbno = n / BITS_PER_MPI_LIMB; 121 limbno = n / BITS_PER_MPI_LIMB;
122 bitno = n % BITS_PER_MPI_LIMB; 122 bitno = n % BITS_PER_MPI_LIMB;
123 123
124 if( limbno >= a->nlimbs ) { /* resize */ 124 if( limbno >= a->nlimbs ) { /* resize */
125 if( a->alloced >= limbno ) 125 if( a->alloced >= limbno )
126 mpi_resize(a, limbno+1 ); 126 mpi_resize(a, limbno+1 );
127 a->nlimbs = limbno+1; 127 a->nlimbs = limbno+1;
128 } 128 }
129 a->d[limbno] |= (A_LIMB_1<<bitno); 129 a->d[limbno] |= (A_LIMB_1<<bitno);
130} 130}
131 131
132/**************** 132/****************
133 * Set bit N of A. and clear all bits above 133 * Set bit N of A. and clear all bits above
134 */ 134 */
135void 135void
136gcry_mpi_set_highbit( gcry_mpi_t a, unsigned int n ) 136gcry_mpi_set_highbit( gcry_mpi_t a, unsigned int n )
137{ 137{
138 unsigned int limbno, bitno; 138 unsigned int limbno, bitno;
139 139
140 limbno = n / BITS_PER_MPI_LIMB; 140 limbno = n / BITS_PER_MPI_LIMB;
141 bitno = n % BITS_PER_MPI_LIMB; 141 bitno = n % BITS_PER_MPI_LIMB;
142 142
143 if( limbno >= a->nlimbs ) { /* resize */ 143 if( limbno >= a->nlimbs ) { /* resize */
144 if( a->alloced >= limbno ) 144 if( a->alloced >= limbno )
145 mpi_resize(a, limbno+1 ); 145 mpi_resize(a, limbno+1 );
146 a->nlimbs = limbno+1; 146 a->nlimbs = limbno+1;
147 } 147 }
148 a->d[limbno] |= (A_LIMB_1<<bitno); 148 a->d[limbno] |= (A_LIMB_1<<bitno);
149 for( bitno++; bitno < BITS_PER_MPI_LIMB; bitno++ ) 149 for( bitno++; bitno < BITS_PER_MPI_LIMB; bitno++ )
150 a->d[limbno] &= ~(A_LIMB_1 << bitno); 150 a->d[limbno] &= ~(A_LIMB_1 << bitno);
151 a->nlimbs = limbno+1; 151 a->nlimbs = limbno+1;
152} 152}
153 153
154/**************** 154/****************
155 * clear bit N of A and all bits above 155 * clear bit N of A and all bits above
156 */ 156 */
157void 157void
158gcry_mpi_clear_highbit( gcry_mpi_t a, unsigned int n ) 158gcry_mpi_clear_highbit( gcry_mpi_t a, unsigned int n )
159{ 159{
160 unsigned int limbno, bitno; 160 unsigned int limbno, bitno;
161 161
162 limbno = n / BITS_PER_MPI_LIMB; 162 limbno = n / BITS_PER_MPI_LIMB;
163 bitno = n % BITS_PER_MPI_LIMB; 163 bitno = n % BITS_PER_MPI_LIMB;
164 164
165 if( limbno >= a->nlimbs ) 165 if( limbno >= a->nlimbs )
166 return; /* not allocated, so need to clear bits :-) */ 166 return; /* not allocated, so need to clear bits :-) */
167 167
168 for( ; bitno < BITS_PER_MPI_LIMB; bitno++ ) 168 for( ; bitno < BITS_PER_MPI_LIMB; bitno++ )
169 a->d[limbno] &= ~(A_LIMB_1 << bitno); 169 a->d[limbno] &= ~(A_LIMB_1 << bitno);
170 a->nlimbs = limbno+1; 170 a->nlimbs = limbno+1;
171} 171}
172 172
173/**************** 173/****************
174 * Clear bit N of A. 174 * Clear bit N of A.
175 */ 175 */
176void 176void
177gcry_mpi_clear_bit( gcry_mpi_t a, unsigned int n ) 177gcry_mpi_clear_bit( gcry_mpi_t a, unsigned int n )
178{ 178{
179 unsigned int limbno, bitno; 179 unsigned int limbno, bitno;
180 180
181 limbno = n / BITS_PER_MPI_LIMB; 181 limbno = n / BITS_PER_MPI_LIMB;
182 bitno = n % BITS_PER_MPI_LIMB; 182 bitno = n % BITS_PER_MPI_LIMB;
183 183
184 if( limbno >= a->nlimbs ) 184 if( limbno >= a->nlimbs )
185 return; /* don't need to clear this bit, it's to far to left */ 185 return; /* don't need to clear this bit, it's to far to left */
186 a->d[limbno] &= ~(A_LIMB_1 << bitno); 186 a->d[limbno] &= ~(A_LIMB_1 << bitno);
187} 187}
188 188
189 189
190/**************** 190/****************
191 * Shift A by N bits to the right 191 * Shift A by N bits to the right
192 * FIXME: should use alloc_limb if X and A are same. 192 * FIXME: should use alloc_limb if X and A are same.
193 */ 193 */
194void 194void
195gcry_mpi_rshift( gcry_mpi_t x, gcry_mpi_t a, unsigned n ) 195gcry_mpi_rshift( gcry_mpi_t x, gcry_mpi_t a, unsigned n )
196{ 196{
197 mpi_ptr_t xp; 197 mpi_ptr_t xp;
198 mpi_size_t xsize; 198 mpi_size_t xsize;
199 199
200 xsize = a->nlimbs; 200 xsize = a->nlimbs;
201 x->sign = a->sign; 201 x->sign = a->sign;
202 RESIZE_IF_NEEDED(x, xsize); 202 RESIZE_IF_NEEDED(x, xsize);
203 xp = x->d; 203 xp = x->d;
204 204
205 if( xsize ) { 205 if( xsize ) {
206 _gcry_mpih_rshift( xp, a->d, xsize, n); 206 _gcry_mpih_rshift( xp, a->d, xsize, n);
207 MPN_NORMALIZE( xp, xsize); 207 MPN_NORMALIZE( xp, xsize);
208 } 208 }
209 x->nlimbs = xsize; 209 x->nlimbs = xsize;
210} 210}
211 211
212 212
213/**************** 213/****************
214 * Shift A by COUNT limbs to the left 214 * Shift A by COUNT limbs to the left
215 * This is used only within the MPI library 215 * This is used only within the MPI library
216 */ 216 */
217void 217void
218_gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count ) 218_gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count )
219{ 219{
220 mpi_ptr_t ap = a->d; 220 mpi_ptr_t ap = a->d;
221 int n = a->nlimbs; 221 int n = a->nlimbs;
222 int i; 222 int i;
223 223
224 if( !count || !n ) 224 if( !count || !n )
225 return; 225 return;
226 226
227 RESIZE_IF_NEEDED( a, n+count ); 227 RESIZE_IF_NEEDED( a, n+count );
228 228
229 for( i = n-1; i >= 0; i-- ) 229 for( i = n-1; i >= 0; i-- )
230 ap[i+count] = ap[i]; 230 ap[i+count] = ap[i];
231 for(i=0; i < count; i++ ) 231 for(i=0; i < count; i++ )
232 ap[i] = 0; 232 ap[i] = 0;
233 a->nlimbs += count; 233 a->nlimbs += count;
234} 234}
235 235
236 236
237/**************** 237/****************
238 * Shift A by COUNT limbs to the right 238 * Shift A by COUNT limbs to the right
239 * This is used only within the MPI library 239 * This is used only within the MPI library
240 */ 240 */
241void 241void
242_gcry_mpi_rshift_limbs( gcry_mpi_t a, unsigned int count ) 242_gcry_mpi_rshift_limbs( gcry_mpi_t a, unsigned int count )
243{ 243{
244 mpi_ptr_t ap = a->d; 244 mpi_ptr_t ap = a->d;
245 mpi_size_t n = a->nlimbs; 245 mpi_size_t n = a->nlimbs;
246 unsigned int i; 246 unsigned int i;
247 247
248 if( count >= n ) { 248 if( count >= n ) {
249 a->nlimbs = 0; 249 a->nlimbs = 0;
250 return; 250 return;
251 } 251 }
252 252
253 for( i = 0; i < n - count; i++ ) 253 for( i = 0; i < n - count; i++ )
254 ap[i] = ap[i+count]; 254 ap[i] = ap[i+count];
255 ap[i] = 0; 255 ap[i] = 0;
256 a->nlimbs -= count; 256 a->nlimbs -= count;
257} 257}
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-cmp.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-cmp.c
index d44fd22..6036255 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-cmp.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-cmp.c
@@ -1,74 +1,74 @@
1/* mpi-cmp.c - MPI functions 1/* mpi-cmp.c - MPI functions
2 * Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. 2 * Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include "mpi-internal.h" 24#include "mpi-internal.h"
25 25
26int 26int
27gcry_mpi_cmp_ui( gcry_mpi_t u, unsigned long v ) 27gcry_mpi_cmp_ui( gcry_mpi_t u, unsigned long v )
28{ 28{
29 mpi_limb_t limb = v; 29 mpi_limb_t limb = v;
30 30
31 _gcry_mpi_normalize( u ); 31 _gcry_mpi_normalize( u );
32 if( !u->nlimbs && !limb ) 32 if( !u->nlimbs && !limb )
33 return 0; 33 return 0;
34 if( u->sign ) 34 if( u->sign )
35 return -1; 35 return -1;
36 if( u->nlimbs > 1 ) 36 if( u->nlimbs > 1 )
37 return 1; 37 return 1;
38 38
39 if( u->d[0] == limb ) 39 if( u->d[0] == limb )
40 return 0; 40 return 0;
41 else if( u->d[0] > limb ) 41 else if( u->d[0] > limb )
42 return 1; 42 return 1;
43 else 43 else
44 return -1; 44 return -1;
45} 45}
46 46
47int 47int
48gcry_mpi_cmp( gcry_mpi_t u, gcry_mpi_t v ) 48gcry_mpi_cmp( gcry_mpi_t u, gcry_mpi_t v )
49{ 49{
50 mpi_size_t usize, vsize; 50 mpi_size_t usize, vsize;
51 int cmp; 51 int cmp;
52 52
53 _gcry_mpi_normalize( u ); 53 _gcry_mpi_normalize( u );
54 _gcry_mpi_normalize( v ); 54 _gcry_mpi_normalize( v );
55 usize = u->nlimbs; 55 usize = u->nlimbs;
56 vsize = v->nlimbs; 56 vsize = v->nlimbs;
57 if( !u->sign && v->sign ) 57 if( !u->sign && v->sign )
58 return 1; 58 return 1;
59 if( u->sign && !v->sign ) 59 if( u->sign && !v->sign )
60 return -1; 60 return -1;
61 if( usize != vsize && !u->sign && !v->sign ) 61 if( usize != vsize && !u->sign && !v->sign )
62 return usize - vsize; 62 return usize - vsize;
63 if( usize != vsize && u->sign && v->sign ) 63 if( usize != vsize && u->sign && v->sign )
64 return vsize + usize; 64 return vsize + usize;
65 if( !usize ) 65 if( !usize )
66 return 0; 66 return 0;
67 if( !(cmp = _gcry_mpih_cmp( u->d, v->d, usize )) ) 67 if( !(cmp = _gcry_mpih_cmp( u->d, v->d, usize )) )
68 return 0; 68 return 0;
69 if( (cmp < 0?1:0) == (u->sign?1:0)) 69 if( (cmp < 0?1:0) == (u->sign?1:0))
70 return 1; 70 return 1;
71 return -1; 71 return -1;
72} 72}
73 73
74 74
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-div.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-div.c
index a8bcab4..6172eb4 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-div.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-div.c
@@ -1,364 +1,364 @@
1/* mpi-div.c - MPI functions 1/* mpi-div.c - MPI functions
2 * Copyright (C) 1994, 1996, 1998, 2001, 2002, 2 * Copyright (C) 1994, 1996, 1998, 2001, 2002,
3 * 2003 Free Software Foundation, Inc. 3 * 2003 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33#include "g10lib.h" 33#include "g10lib.h"
34 34
35 35
36void 36void
37_gcry_mpi_fdiv_r( gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor ) 37_gcry_mpi_fdiv_r( gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor )
38{ 38{
39 int divisor_sign = divisor->sign; 39 int divisor_sign = divisor->sign;
40 gcry_mpi_t temp_divisor = NULL; 40 gcry_mpi_t temp_divisor = NULL;
41 41
42 /* We need the original value of the divisor after the remainder has been 42 /* We need the original value of the divisor after the remainder has been
43 * preliminary calculated. We have to copy it to temporary space if it's 43 * preliminary calculated. We have to copy it to temporary space if it's
44 * the same variable as REM. */ 44 * the same variable as REM. */
45 if( rem == divisor ) { 45 if( rem == divisor ) {
46 temp_divisor = mpi_copy( divisor ); 46 temp_divisor = mpi_copy( divisor );
47 divisor = temp_divisor; 47 divisor = temp_divisor;
48 } 48 }
49 49
50 _gcry_mpi_tdiv_r( rem, dividend, divisor ); 50 _gcry_mpi_tdiv_r( rem, dividend, divisor );
51 51
52 if( ((divisor_sign?1:0) ^ (dividend->sign?1:0)) && rem->nlimbs ) 52 if( ((divisor_sign?1:0) ^ (dividend->sign?1:0)) && rem->nlimbs )
53 gcry_mpi_add( rem, rem, divisor); 53 gcry_mpi_add( rem, rem, divisor);
54 54
55 if( temp_divisor ) 55 if( temp_divisor )
56 mpi_free(temp_divisor); 56 mpi_free(temp_divisor);
57} 57}
58 58
59 59
60 60
61/**************** 61/****************
62 * Division rounding the quotient towards -infinity. 62 * Division rounding the quotient towards -infinity.
63 * The remainder gets the same sign as the denominator. 63 * The remainder gets the same sign as the denominator.
64 * rem is optional 64 * rem is optional
65 */ 65 */
66 66
67ulong 67ulong
68_gcry_mpi_fdiv_r_ui( gcry_mpi_t rem, gcry_mpi_t dividend, ulong divisor ) 68_gcry_mpi_fdiv_r_ui( gcry_mpi_t rem, gcry_mpi_t dividend, ulong divisor )
69{ 69{
70 mpi_limb_t rlimb; 70 mpi_limb_t rlimb;
71 71
72 rlimb = _gcry_mpih_mod_1( dividend->d, dividend->nlimbs, divisor ); 72 rlimb = _gcry_mpih_mod_1( dividend->d, dividend->nlimbs, divisor );
73 if( rlimb && dividend->sign ) 73 if( rlimb && dividend->sign )
74 rlimb = divisor - rlimb; 74 rlimb = divisor - rlimb;
75 75
76 if( rem ) { 76 if( rem ) {
77 rem->d[0] = rlimb; 77 rem->d[0] = rlimb;
78 rem->nlimbs = rlimb? 1:0; 78 rem->nlimbs = rlimb? 1:0;
79 } 79 }
80 return rlimb; 80 return rlimb;
81} 81}
82 82
83 83
84void 84void
85_gcry_mpi_fdiv_q( gcry_mpi_t quot, gcry_mpi_t dividend, gcry_mpi_t divisor ) 85_gcry_mpi_fdiv_q( gcry_mpi_t quot, gcry_mpi_t dividend, gcry_mpi_t divisor )
86{ 86{
87 gcry_mpi_t tmp = mpi_alloc( mpi_get_nlimbs(quot) ); 87 gcry_mpi_t tmp = mpi_alloc( mpi_get_nlimbs(quot) );
88 _gcry_mpi_fdiv_qr( quot, tmp, dividend, divisor); 88 _gcry_mpi_fdiv_qr( quot, tmp, dividend, divisor);
89 mpi_free(tmp); 89 mpi_free(tmp);
90} 90}
91 91
92void 92void
93_gcry_mpi_fdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor ) 93_gcry_mpi_fdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor )
94{ 94{
95 int divisor_sign = divisor->sign; 95 int divisor_sign = divisor->sign;
96 gcry_mpi_t temp_divisor = NULL; 96 gcry_mpi_t temp_divisor = NULL;
97 97
98 if( quot == divisor || rem == divisor ) { 98 if( quot == divisor || rem == divisor ) {
99 temp_divisor = mpi_copy( divisor ); 99 temp_divisor = mpi_copy( divisor );
100 divisor = temp_divisor; 100 divisor = temp_divisor;
101 } 101 }
102 102
103 _gcry_mpi_tdiv_qr( quot, rem, dividend, divisor ); 103 _gcry_mpi_tdiv_qr( quot, rem, dividend, divisor );
104 104
105 if( (divisor_sign ^ dividend->sign) && rem->nlimbs ) { 105 if( (divisor_sign ^ dividend->sign) && rem->nlimbs ) {
106 gcry_mpi_sub_ui( quot, quot, 1 ); 106 gcry_mpi_sub_ui( quot, quot, 1 );
107 gcry_mpi_add( rem, rem, divisor); 107 gcry_mpi_add( rem, rem, divisor);
108 } 108 }
109 109
110 if( temp_divisor ) 110 if( temp_divisor )
111 mpi_free(temp_divisor); 111 mpi_free(temp_divisor);
112} 112}
113 113
114 114
115/* If den == quot, den needs temporary storage. 115/* If den == quot, den needs temporary storage.
116 * If den == rem, den needs temporary storage. 116 * If den == rem, den needs temporary storage.
117 * If num == quot, num needs temporary storage. 117 * If num == quot, num needs temporary storage.
118 * If den has temporary storage, it can be normalized while being copied, 118 * If den has temporary storage, it can be normalized while being copied,
119 * i.e no extra storage should be allocated. 119 * i.e no extra storage should be allocated.
120 */ 120 */
121 121
122void 122void
123_gcry_mpi_tdiv_r( gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t den) 123_gcry_mpi_tdiv_r( gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t den)
124{ 124{
125 _gcry_mpi_tdiv_qr(NULL, rem, num, den ); 125 _gcry_mpi_tdiv_qr(NULL, rem, num, den );
126} 126}
127 127
128void 128void
129_gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t den) 129_gcry_mpi_tdiv_qr( gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t num, gcry_mpi_t den)
130{ 130{
131 mpi_ptr_t np, dp; 131 mpi_ptr_t np, dp;
132 mpi_ptr_t qp, rp; 132 mpi_ptr_t qp, rp;
133 mpi_size_t nsize = num->nlimbs; 133 mpi_size_t nsize = num->nlimbs;
134 mpi_size_t dsize = den->nlimbs; 134 mpi_size_t dsize = den->nlimbs;
135 mpi_size_t qsize, rsize; 135 mpi_size_t qsize, rsize;
136 mpi_size_t sign_remainder = num->sign; 136 mpi_size_t sign_remainder = num->sign;
137 mpi_size_t sign_quotient = num->sign ^ den->sign; 137 mpi_size_t sign_quotient = num->sign ^ den->sign;
138 unsigned normalization_steps; 138 unsigned normalization_steps;
139 mpi_limb_t q_limb; 139 mpi_limb_t q_limb;
140 mpi_ptr_t marker[5]; 140 mpi_ptr_t marker[5];
141 unsigned int marker_nlimbs[5]; 141 unsigned int marker_nlimbs[5];
142 int markidx=0; 142 int markidx=0;
143 143
144 /* Ensure space is enough for quotient and remainder. 144 /* Ensure space is enough for quotient and remainder.
145 * We need space for an extra limb in the remainder, because it's 145 * We need space for an extra limb in the remainder, because it's
146 * up-shifted (normalized) below. */ 146 * up-shifted (normalized) below. */
147 rsize = nsize + 1; 147 rsize = nsize + 1;
148 mpi_resize( rem, rsize); 148 mpi_resize( rem, rsize);
149 149
150 qsize = rsize - dsize; /* qsize cannot be bigger than this. */ 150 qsize = rsize - dsize; /* qsize cannot be bigger than this. */
151 if( qsize <= 0 ) { 151 if( qsize <= 0 ) {
152 if( num != rem ) { 152 if( num != rem ) {
153 rem->nlimbs = num->nlimbs; 153 rem->nlimbs = num->nlimbs;
154 rem->sign = num->sign; 154 rem->sign = num->sign;
155 MPN_COPY(rem->d, num->d, nsize); 155 MPN_COPY(rem->d, num->d, nsize);
156 } 156 }
157 if( quot ) { 157 if( quot ) {
158 /* This needs to follow the assignment to rem, in case the 158 /* This needs to follow the assignment to rem, in case the
159 * numerator and quotient are the same. */ 159 * numerator and quotient are the same. */
160 quot->nlimbs = 0; 160 quot->nlimbs = 0;
161 quot->sign = 0; 161 quot->sign = 0;
162 } 162 }
163 return; 163 return;
164 } 164 }
165 165
166 if( quot ) 166 if( quot )
167 mpi_resize( quot, qsize); 167 mpi_resize( quot, qsize);
168 168
169 /* Read pointers here, when reallocation is finished. */ 169 /* Read pointers here, when reallocation is finished. */
170 np = num->d; 170 np = num->d;
171 dp = den->d; 171 dp = den->d;
172 rp = rem->d; 172 rp = rem->d;
173 173
174 /* Optimize division by a single-limb divisor. */ 174 /* Optimize division by a single-limb divisor. */
175 if( dsize == 1 ) { 175 if( dsize == 1 ) {
176 mpi_limb_t rlimb; 176 mpi_limb_t rlimb;
177 if( quot ) { 177 if( quot ) {
178 qp = quot->d; 178 qp = quot->d;
179 rlimb = _gcry_mpih_divmod_1( qp, np, nsize, dp[0] ); 179 rlimb = _gcry_mpih_divmod_1( qp, np, nsize, dp[0] );
180 qsize -= qp[qsize - 1] == 0; 180 qsize -= qp[qsize - 1] == 0;
181 quot->nlimbs = qsize; 181 quot->nlimbs = qsize;
182 quot->sign = sign_quotient; 182 quot->sign = sign_quotient;
183 } 183 }
184 else 184 else
185 rlimb = _gcry_mpih_mod_1( np, nsize, dp[0] ); 185 rlimb = _gcry_mpih_mod_1( np, nsize, dp[0] );
186 rp[0] = rlimb; 186 rp[0] = rlimb;
187 rsize = rlimb != 0?1:0; 187 rsize = rlimb != 0?1:0;
188 rem->nlimbs = rsize; 188 rem->nlimbs = rsize;
189 rem->sign = sign_remainder; 189 rem->sign = sign_remainder;
190 return; 190 return;
191 } 191 }
192 192
193 193
194 if( quot ) { 194 if( quot ) {
195 qp = quot->d; 195 qp = quot->d;
196 /* Make sure QP and NP point to different objects. Otherwise the 196 /* Make sure QP and NP point to different objects. Otherwise the
197 * numerator would be gradually overwritten by the quotient limbs. */ 197 * numerator would be gradually overwritten by the quotient limbs. */
198 if(qp == np) { /* Copy NP object to temporary space. */ 198 if(qp == np) { /* Copy NP object to temporary space. */
199 marker_nlimbs[markidx] = nsize; 199 marker_nlimbs[markidx] = nsize;
200 np = marker[markidx++] = mpi_alloc_limb_space(nsize, 200 np = marker[markidx++] = mpi_alloc_limb_space(nsize,
201 mpi_is_secure(quot)); 201 mpi_is_secure(quot));
202 MPN_COPY(np, qp, nsize); 202 MPN_COPY(np, qp, nsize);
203 } 203 }
204 } 204 }
205 else /* Put quotient at top of remainder. */ 205 else /* Put quotient at top of remainder. */
206 qp = rp + dsize; 206 qp = rp + dsize;
207 207
208 count_leading_zeros( normalization_steps, dp[dsize - 1] ); 208 count_leading_zeros( normalization_steps, dp[dsize - 1] );
209 209
210 /* Normalize the denominator, i.e. make its most significant bit set by 210 /* Normalize the denominator, i.e. make its most significant bit set by
211 * shifting it NORMALIZATION_STEPS bits to the left. Also shift the 211 * shifting it NORMALIZATION_STEPS bits to the left. Also shift the
212 * numerator the same number of steps (to keep the quotient the same!). 212 * numerator the same number of steps (to keep the quotient the same!).
213 */ 213 */
214 if( normalization_steps ) { 214 if( normalization_steps ) {
215 mpi_ptr_t tp; 215 mpi_ptr_t tp;
216 mpi_limb_t nlimb; 216 mpi_limb_t nlimb;
217 217
218 /* Shift up the denominator setting the most significant bit of 218 /* Shift up the denominator setting the most significant bit of
219 * the most significant word. Use temporary storage not to clobber 219 * the most significant word. Use temporary storage not to clobber
220 * the original contents of the denominator. */ 220 * the original contents of the denominator. */
221 marker_nlimbs[markidx] = dsize; 221 marker_nlimbs[markidx] = dsize;
222 tp = marker[markidx++] = mpi_alloc_limb_space(dsize,mpi_is_secure(den)); 222 tp = marker[markidx++] = mpi_alloc_limb_space(dsize,mpi_is_secure(den));
223 _gcry_mpih_lshift( tp, dp, dsize, normalization_steps ); 223 _gcry_mpih_lshift( tp, dp, dsize, normalization_steps );
224 dp = tp; 224 dp = tp;
225 225
226 /* Shift up the numerator, possibly introducing a new most 226 /* Shift up the numerator, possibly introducing a new most
227 * significant word. Move the shifted numerator in the remainder 227 * significant word. Move the shifted numerator in the remainder
228 * meanwhile. */ 228 * meanwhile. */
229 nlimb = _gcry_mpih_lshift(rp, np, nsize, normalization_steps); 229 nlimb = _gcry_mpih_lshift(rp, np, nsize, normalization_steps);
230 if( nlimb ) { 230 if( nlimb ) {
231 rp[nsize] = nlimb; 231 rp[nsize] = nlimb;
232 rsize = nsize + 1; 232 rsize = nsize + 1;
233 } 233 }
234 else 234 else
235 rsize = nsize; 235 rsize = nsize;
236 } 236 }
237 else { 237 else {
238 /* The denominator is already normalized, as required. Copy it to 238 /* The denominator is already normalized, as required. Copy it to
239 * temporary space if it overlaps with the quotient or remainder. */ 239 * temporary space if it overlaps with the quotient or remainder. */
240 if( dp == rp || (quot && (dp == qp))) { 240 if( dp == rp || (quot && (dp == qp))) {
241 mpi_ptr_t tp; 241 mpi_ptr_t tp;
242 242
243 marker_nlimbs[markidx] = dsize; 243 marker_nlimbs[markidx] = dsize;
244 tp = marker[markidx++] = mpi_alloc_limb_space(dsize, 244 tp = marker[markidx++] = mpi_alloc_limb_space(dsize,
245 mpi_is_secure(den)); 245 mpi_is_secure(den));
246 MPN_COPY( tp, dp, dsize ); 246 MPN_COPY( tp, dp, dsize );
247 dp = tp; 247 dp = tp;
248 } 248 }
249 249
250 /* Move the numerator to the remainder. */ 250 /* Move the numerator to the remainder. */
251 if( rp != np ) 251 if( rp != np )
252 MPN_COPY(rp, np, nsize); 252 MPN_COPY(rp, np, nsize);
253 253
254 rsize = nsize; 254 rsize = nsize;
255 } 255 }
256 256
257 q_limb = _gcry_mpih_divrem( qp, 0, rp, rsize, dp, dsize ); 257 q_limb = _gcry_mpih_divrem( qp, 0, rp, rsize, dp, dsize );
258 258
259 if( quot ) { 259 if( quot ) {
260 qsize = rsize - dsize; 260 qsize = rsize - dsize;
261 if(q_limb) { 261 if(q_limb) {
262 qp[qsize] = q_limb; 262 qp[qsize] = q_limb;
263 qsize += 1; 263 qsize += 1;
264 } 264 }
265 265
266 quot->nlimbs = qsize; 266 quot->nlimbs = qsize;
267 quot->sign = sign_quotient; 267 quot->sign = sign_quotient;
268 } 268 }
269 269
270 rsize = dsize; 270 rsize = dsize;
271 MPN_NORMALIZE (rp, rsize); 271 MPN_NORMALIZE (rp, rsize);
272 272
273 if( normalization_steps && rsize ) { 273 if( normalization_steps && rsize ) {
274 _gcry_mpih_rshift(rp, rp, rsize, normalization_steps); 274 _gcry_mpih_rshift(rp, rp, rsize, normalization_steps);
275 rsize -= rp[rsize - 1] == 0?1:0; 275 rsize -= rp[rsize - 1] == 0?1:0;
276 } 276 }
277 277
278 rem->nlimbs = rsize; 278 rem->nlimbs = rsize;
279 rem->sign = sign_remainder; 279 rem->sign = sign_remainder;
280 while( markidx ) 280 while( markidx )
281 { 281 {
282 markidx--; 282 markidx--;
283 _gcry_mpi_free_limb_space (marker[markidx], marker_nlimbs[markidx]); 283 _gcry_mpi_free_limb_space (marker[markidx], marker_nlimbs[markidx]);
284 } 284 }
285} 285}
286 286
287void 287void
288_gcry_mpi_tdiv_q_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned int count ) 288_gcry_mpi_tdiv_q_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned int count )
289{ 289{
290 mpi_size_t usize, wsize; 290 mpi_size_t usize, wsize;
291 mpi_size_t limb_cnt; 291 mpi_size_t limb_cnt;
292 292
293 usize = u->nlimbs; 293 usize = u->nlimbs;
294 limb_cnt = count / BITS_PER_MPI_LIMB; 294 limb_cnt = count / BITS_PER_MPI_LIMB;
295 wsize = usize - limb_cnt; 295 wsize = usize - limb_cnt;
296 if( limb_cnt >= usize ) 296 if( limb_cnt >= usize )
297 w->nlimbs = 0; 297 w->nlimbs = 0;
298 else { 298 else {
299 mpi_ptr_t wp; 299 mpi_ptr_t wp;
300 mpi_ptr_t up; 300 mpi_ptr_t up;
301 301
302 RESIZE_IF_NEEDED( w, wsize ); 302 RESIZE_IF_NEEDED( w, wsize );
303 wp = w->d; 303 wp = w->d;
304 up = u->d; 304 up = u->d;
305 305
306 count %= BITS_PER_MPI_LIMB; 306 count %= BITS_PER_MPI_LIMB;
307 if( count ) { 307 if( count ) {
308 _gcry_mpih_rshift( wp, up + limb_cnt, wsize, count ); 308 _gcry_mpih_rshift( wp, up + limb_cnt, wsize, count );
309 wsize -= !wp[wsize - 1]; 309 wsize -= !wp[wsize - 1];
310 } 310 }
311 else { 311 else {
312 MPN_COPY_INCR( wp, up + limb_cnt, wsize); 312 MPN_COPY_INCR( wp, up + limb_cnt, wsize);
313 } 313 }
314 314
315 w->nlimbs = wsize; 315 w->nlimbs = wsize;
316 } 316 }
317} 317}
318 318
319/**************** 319/****************
320 * Check whether dividend is divisible by divisor 320 * Check whether dividend is divisible by divisor
321 * (note: divisor must fit into a limb) 321 * (note: divisor must fit into a limb)
322 */ 322 */
323int 323int
324_gcry_mpi_divisible_ui(gcry_mpi_t dividend, ulong divisor ) 324_gcry_mpi_divisible_ui(gcry_mpi_t dividend, ulong divisor )
325{ 325{
326 return !_gcry_mpih_mod_1( dividend->d, dividend->nlimbs, divisor ); 326 return !_gcry_mpih_mod_1( dividend->d, dividend->nlimbs, divisor );
327} 327}
328 328
329 329
330void 330void
331gcry_mpi_div (gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor, int round) 331gcry_mpi_div (gcry_mpi_t quot, gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor, int round)
332{ 332{
333 if (!round) 333 if (!round)
334 { 334 {
335 if (!rem) 335 if (!rem)
336 { 336 {
337 gcry_mpi_t tmp = mpi_alloc (mpi_get_nlimbs(quot)); 337 gcry_mpi_t tmp = mpi_alloc (mpi_get_nlimbs(quot));
338 _gcry_mpi_tdiv_qr (quot, tmp, dividend, divisor); 338 _gcry_mpi_tdiv_qr (quot, tmp, dividend, divisor);
339 mpi_free (tmp); 339 mpi_free (tmp);
340 } 340 }
341 else 341 else
342 _gcry_mpi_tdiv_qr (quot, rem, dividend, divisor); 342 _gcry_mpi_tdiv_qr (quot, rem, dividend, divisor);
343 } 343 }
344 else if (round < 0) 344 else if (round < 0)
345 { 345 {
346 if (!rem) 346 if (!rem)
347 _gcry_mpi_fdiv_q (quot, dividend, divisor); 347 _gcry_mpi_fdiv_q (quot, dividend, divisor);
348 else if (!quot) 348 else if (!quot)
349 _gcry_mpi_fdiv_r (rem, dividend, divisor); 349 _gcry_mpi_fdiv_r (rem, dividend, divisor);
350 else 350 else
351 _gcry_mpi_fdiv_qr (quot, rem, dividend, divisor); 351 _gcry_mpi_fdiv_qr (quot, rem, dividend, divisor);
352 } 352 }
353 else 353 else
354 log_bug ("mpi rounding to ceiling not yet implemented\n"); 354 log_bug ("mpi rounding to ceiling not yet implemented\n");
355} 355}
356 356
357 357
358void 358void
359gcry_mpi_mod (gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor) 359gcry_mpi_mod (gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor)
360{ 360{
361 _gcry_mpi_fdiv_r (rem, dividend, divisor); 361 _gcry_mpi_fdiv_r (rem, dividend, divisor);
362 rem->sign = 0; 362 rem->sign = 0;
363} 363}
364 364
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-gcd.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-gcd.c
index 898104e..51841e7 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-gcd.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-gcd.c
@@ -1,54 +1,54 @@
1/* mpi-gcd.c - MPI functions 1/* mpi-gcd.c - MPI functions
2 * Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include "mpi-internal.h" 24#include "mpi-internal.h"
25 25
26/**************** 26/****************
27 * Find the greatest common divisor G of A and B. 27 * Find the greatest common divisor G of A and B.
28 * Return: true if this 1, false in all other cases 28 * Return: true if this 1, false in all other cases
29 */ 29 */
30int 30int
31gcry_mpi_gcd( gcry_mpi_t g, gcry_mpi_t xa, gcry_mpi_t xb ) 31gcry_mpi_gcd( gcry_mpi_t g, gcry_mpi_t xa, gcry_mpi_t xb )
32{ 32{
33 gcry_mpi_t a, b; 33 gcry_mpi_t a, b;
34 34
35 a = mpi_copy(xa); 35 a = mpi_copy(xa);
36 b = mpi_copy(xb); 36 b = mpi_copy(xb);
37 37
38 /* TAOCP Vol II, 4.5.2, Algorithm A */ 38 /* TAOCP Vol II, 4.5.2, Algorithm A */
39 a->sign = 0; 39 a->sign = 0;
40 b->sign = 0; 40 b->sign = 0;
41 while( gcry_mpi_cmp_ui( b, 0 ) ) { 41 while( gcry_mpi_cmp_ui( b, 0 ) ) {
42 _gcry_mpi_fdiv_r( g, a, b ); /* g used as temorary variable */ 42 _gcry_mpi_fdiv_r( g, a, b ); /* g used as temorary variable */
43 mpi_set(a,b); 43 mpi_set(a,b);
44 mpi_set(b,g); 44 mpi_set(b,g);
45 } 45 }
46 mpi_set(g, a); 46 mpi_set(g, a);
47 47
48 mpi_free(a); 48 mpi_free(a);
49 mpi_free(b); 49 mpi_free(b);
50 return !gcry_mpi_cmp_ui( g, 1); 50 return !gcry_mpi_cmp_ui( g, 1);
51} 51}
52 52
53 53
54 54
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.c
index b60900f..a196946 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.c
@@ -1,36 +1,36 @@
1/* mpi-inline.c 1/* mpi-inline.c
2 * Copyright (C) 1999, 2002 Free Software Foundation, Inc. 2 * Copyright (C) 1999, 2002 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24 24
25/* put the inline functions as real functions into the lib */ 25/* put the inline functions as real functions into the lib */
26#define G10_MPI_INLINE_DECL 26#define G10_MPI_INLINE_DECL
27 27
28#include "mpi-internal.h" 28#include "mpi-internal.h"
29 29
30/* always include the header becuase it is only 30/* always include the header becuase it is only
31 * included by mpi-internal if __GCC__ is defined but we 31 * included by mpi-internal if __GCC__ is defined but we
32 * need it here in all cases and the above definition of 32 * need it here in all cases and the above definition of
33 * of the macro allows us to do so 33 * of the macro allows us to do so
34 */ 34 */
35#include "mpi-inline.h" 35#include "mpi-inline.h"
36 36
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.h
index 0193286..88d9f56 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inline.h
@@ -1,154 +1,154 @@
1/* mpi-inline.h - Internal to the Multi Precision Integers 1/* mpi-inline.h - Internal to the Multi Precision Integers
2 * Copyright (C) 1994, 1996, 1998, 1999, 2 * Copyright (C) 1994, 1996, 1998, 1999,
3 * 2001, 2002 Free Software Foundation, Inc. 3 * 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#ifndef G10_MPI_INLINE_H 28#ifndef G10_MPI_INLINE_H
29#define G10_MPI_INLINE_H 29#define G10_MPI_INLINE_H
30 30
31#ifndef G10_MPI_INLINE_DECL 31#ifndef G10_MPI_INLINE_DECL
32#define G10_MPI_INLINE_DECL extern __inline__ 32#define G10_MPI_INLINE_DECL extern __inline__
33#endif 33#endif
34 34
35G10_MPI_INLINE_DECL mpi_limb_t 35G10_MPI_INLINE_DECL mpi_limb_t
36_gcry_mpih_add_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 36_gcry_mpih_add_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
37 mpi_size_t s1_size, mpi_limb_t s2_limb) 37 mpi_size_t s1_size, mpi_limb_t s2_limb)
38{ 38{
39 mpi_limb_t x; 39 mpi_limb_t x;
40 40
41 x = *s1_ptr++; 41 x = *s1_ptr++;
42 s2_limb += x; 42 s2_limb += x;
43 *res_ptr++ = s2_limb; 43 *res_ptr++ = s2_limb;
44 if( s2_limb < x ) { /* sum is less than the left operand: handle carry */ 44 if( s2_limb < x ) { /* sum is less than the left operand: handle carry */
45 while( --s1_size ) { 45 while( --s1_size ) {
46 x = *s1_ptr++ + 1; /* add carry */ 46 x = *s1_ptr++ + 1; /* add carry */
47 *res_ptr++ = x; /* and store */ 47 *res_ptr++ = x; /* and store */
48 if( x ) /* not 0 (no overflow): we can stop */ 48 if( x ) /* not 0 (no overflow): we can stop */
49 goto leave; 49 goto leave;
50 } 50 }
51 return 1; /* return carry (size of s1 to small) */ 51 return 1; /* return carry (size of s1 to small) */
52 } 52 }
53 53
54 leave: 54 leave:
55 if( res_ptr != s1_ptr ) { /* not the same variable */ 55 if( res_ptr != s1_ptr ) { /* not the same variable */
56 mpi_size_t i; /* copy the rest */ 56 mpi_size_t i; /* copy the rest */
57 for( i=0; i < s1_size-1; i++ ) 57 for( i=0; i < s1_size-1; i++ )
58 res_ptr[i] = s1_ptr[i]; 58 res_ptr[i] = s1_ptr[i];
59 } 59 }
60 return 0; /* no carry */ 60 return 0; /* no carry */
61} 61}
62 62
63 63
64 64
65G10_MPI_INLINE_DECL mpi_limb_t 65G10_MPI_INLINE_DECL mpi_limb_t
66_gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, 66_gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
67 mpi_ptr_t s2_ptr, mpi_size_t s2_size) 67 mpi_ptr_t s2_ptr, mpi_size_t s2_size)
68{ 68{
69 mpi_limb_t cy = 0; 69 mpi_limb_t cy = 0;
70 70
71 if( s2_size ) 71 if( s2_size )
72 cy = _gcry_mpih_add_n( res_ptr, s1_ptr, s2_ptr, s2_size ); 72 cy = _gcry_mpih_add_n( res_ptr, s1_ptr, s2_ptr, s2_size );
73 73
74 if( s1_size - s2_size ) 74 if( s1_size - s2_size )
75 cy = _gcry_mpih_add_1( res_ptr + s2_size, s1_ptr + s2_size, 75 cy = _gcry_mpih_add_1( res_ptr + s2_size, s1_ptr + s2_size,
76 s1_size - s2_size, cy); 76 s1_size - s2_size, cy);
77 return cy; 77 return cy;
78} 78}
79 79
80 80
81G10_MPI_INLINE_DECL mpi_limb_t 81G10_MPI_INLINE_DECL mpi_limb_t
82_gcry_mpih_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 82_gcry_mpih_sub_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
83 mpi_size_t s1_size, mpi_limb_t s2_limb ) 83 mpi_size_t s1_size, mpi_limb_t s2_limb )
84{ 84{
85 mpi_limb_t x; 85 mpi_limb_t x;
86 86
87 x = *s1_ptr++; 87 x = *s1_ptr++;
88 s2_limb = x - s2_limb; 88 s2_limb = x - s2_limb;
89 *res_ptr++ = s2_limb; 89 *res_ptr++ = s2_limb;
90 if( s2_limb > x ) { 90 if( s2_limb > x ) {
91 while( --s1_size ) { 91 while( --s1_size ) {
92 x = *s1_ptr++; 92 x = *s1_ptr++;
93 *res_ptr++ = x - 1; 93 *res_ptr++ = x - 1;
94 if( x ) 94 if( x )
95 goto leave; 95 goto leave;
96 } 96 }
97 return 1; 97 return 1;
98 } 98 }
99 99
100 leave: 100 leave:
101 if( res_ptr != s1_ptr ) { 101 if( res_ptr != s1_ptr ) {
102 mpi_size_t i; 102 mpi_size_t i;
103 for( i=0; i < s1_size-1; i++ ) 103 for( i=0; i < s1_size-1; i++ )
104 res_ptr[i] = s1_ptr[i]; 104 res_ptr[i] = s1_ptr[i];
105 } 105 }
106 return 0; 106 return 0;
107} 107}
108 108
109 109
110 110
111G10_MPI_INLINE_DECL mpi_limb_t 111G10_MPI_INLINE_DECL mpi_limb_t
112_gcry_mpih_sub( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, 112_gcry_mpih_sub( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
113 mpi_ptr_t s2_ptr, mpi_size_t s2_size) 113 mpi_ptr_t s2_ptr, mpi_size_t s2_size)
114{ 114{
115 mpi_limb_t cy = 0; 115 mpi_limb_t cy = 0;
116 116
117 if( s2_size ) 117 if( s2_size )
118 cy = _gcry_mpih_sub_n(res_ptr, s1_ptr, s2_ptr, s2_size); 118 cy = _gcry_mpih_sub_n(res_ptr, s1_ptr, s2_ptr, s2_size);
119 119
120 if( s1_size - s2_size ) 120 if( s1_size - s2_size )
121 cy = _gcry_mpih_sub_1(res_ptr + s2_size, s1_ptr + s2_size, 121 cy = _gcry_mpih_sub_1(res_ptr + s2_size, s1_ptr + s2_size,
122 s1_size - s2_size, cy); 122 s1_size - s2_size, cy);
123 return cy; 123 return cy;
124} 124}
125 125
126/**************** 126/****************
127 * Compare OP1_PTR/OP1_SIZE with OP2_PTR/OP2_SIZE. 127 * Compare OP1_PTR/OP1_SIZE with OP2_PTR/OP2_SIZE.
128 * There are no restrictions on the relative sizes of 128 * There are no restrictions on the relative sizes of
129 * the two arguments. 129 * the two arguments.
130 * Return 1 if OP1 > OP2, 0 if they are equal, and -1 if OP1 < OP2. 130 * Return 1 if OP1 > OP2, 0 if they are equal, and -1 if OP1 < OP2.
131 */ 131 */
132G10_MPI_INLINE_DECL int 132G10_MPI_INLINE_DECL int
133_gcry_mpih_cmp( mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size ) 133_gcry_mpih_cmp( mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size )
134{ 134{
135 mpi_size_t i; 135 mpi_size_t i;
136 mpi_limb_t op1_word, op2_word; 136 mpi_limb_t op1_word, op2_word;
137 137
138 for( i = size - 1; i >= 0 ; i--) { 138 for( i = size - 1; i >= 0 ; i--) {
139 op1_word = op1_ptr[i]; 139 op1_word = op1_ptr[i];
140 op2_word = op2_ptr[i]; 140 op2_word = op2_ptr[i];
141 if( op1_word != op2_word ) 141 if( op1_word != op2_word )
142 goto diff; 142 goto diff;
143 } 143 }
144 return 0; 144 return 0;
145 145
146 diff: 146 diff:
147 /* This can *not* be simplified to 147 /* This can *not* be simplified to
148 * op2_word - op2_word 148 * op2_word - op2_word
149 * since that expression might give signed overflow. */ 149 * since that expression might give signed overflow. */
150 return (op1_word > op2_word) ? 1 : -1; 150 return (op1_word > op2_word) ? 1 : -1;
151} 151}
152 152
153 153
154#endif /*G10_MPI_INLINE_H*/ 154#endif /*G10_MPI_INLINE_H*/
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-internal.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-internal.h
index 3cdde23..d78c180 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-internal.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-internal.h
@@ -1,275 +1,275 @@
1/* mpi-internal.h - Internal to the Multi Precision Integers 1/* mpi-internal.h - Internal to the Multi Precision Integers
2 * Copyright (C) 1994, 1996, 1998, 2000, 2002, 2 * Copyright (C) 1994, 1996, 1998, 2000, 2002,
3 * 2003 Free Software Foundation, Inc. 3 * 2003 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#ifndef G10_MPI_INTERNAL_H 28#ifndef G10_MPI_INTERNAL_H
29#define G10_MPI_INTERNAL_H 29#define G10_MPI_INTERNAL_H
30 30
31#include "mpi-asm-defs.h" 31#include "mpi-asm-defs.h"
32 32
33#ifndef BITS_PER_MPI_LIMB 33#ifndef BITS_PER_MPI_LIMB
34#if BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_INT 34#if BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_INT
35 typedef unsigned int mpi_limb_t; 35 typedef unsigned int mpi_limb_t;
36 typedef signed int mpi_limb_signed_t; 36 typedef signed int mpi_limb_signed_t;
37#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_LONG 37#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_LONG
38 typedef unsigned long int mpi_limb_t; 38 typedef unsigned long int mpi_limb_t;
39 typedef signed long int mpi_limb_signed_t; 39 typedef signed long int mpi_limb_signed_t;
40#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_LONG_LONG 40#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_LONG_LONG
41 typedef unsigned long long int mpi_limb_t; 41 typedef unsigned long long int mpi_limb_t;
42 typedef signed long long int mpi_limb_signed_t; 42 typedef signed long long int mpi_limb_signed_t;
43#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_SHORT 43#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_SHORT
44 typedef unsigned short int mpi_limb_t; 44 typedef unsigned short int mpi_limb_t;
45 typedef signed short int mpi_limb_signed_t; 45 typedef signed short int mpi_limb_signed_t;
46#else 46#else
47#error BYTES_PER_MPI_LIMB does not match any C type 47#error BYTES_PER_MPI_LIMB does not match any C type
48#endif 48#endif
49#define BITS_PER_MPI_LIMB (8*BYTES_PER_MPI_LIMB) 49#define BITS_PER_MPI_LIMB (8*BYTES_PER_MPI_LIMB)
50#endif /*BITS_PER_MPI_LIMB*/ 50#endif /*BITS_PER_MPI_LIMB*/
51 51
52#include "mpi.h" 52#include "mpi.h"
53 53
54/* If KARATSUBA_THRESHOLD is not already defined, define it to a 54/* If KARATSUBA_THRESHOLD is not already defined, define it to a
55 * value which is good on most machines. */ 55 * value which is good on most machines. */
56 56
57/* tested 4, 16, 32 and 64, where 16 gave the best performance when 57/* tested 4, 16, 32 and 64, where 16 gave the best performance when
58 * checking a 768 and a 1024 bit ElGamal signature. 58 * checking a 768 and a 1024 bit ElGamal signature.
59 * (wk 22.12.97) */ 59 * (wk 22.12.97) */
60#ifndef KARATSUBA_THRESHOLD 60#ifndef KARATSUBA_THRESHOLD
61#define KARATSUBA_THRESHOLD 16 61#define KARATSUBA_THRESHOLD 16
62#endif 62#endif
63 63
64/* The code can't handle KARATSUBA_THRESHOLD smaller than 2. */ 64/* The code can't handle KARATSUBA_THRESHOLD smaller than 2. */
65#if KARATSUBA_THRESHOLD < 2 65#if KARATSUBA_THRESHOLD < 2
66#undef KARATSUBA_THRESHOLD 66#undef KARATSUBA_THRESHOLD
67#define KARATSUBA_THRESHOLD 2 67#define KARATSUBA_THRESHOLD 2
68#endif 68#endif
69 69
70 70
71typedef mpi_limb_t *mpi_ptr_t; /* pointer to a limb */ 71typedef mpi_limb_t *mpi_ptr_t; /* pointer to a limb */
72typedef int mpi_size_t; /* (must be a signed type) */ 72typedef int mpi_size_t; /* (must be a signed type) */
73 73
74#define ABS(x) (x >= 0 ? x : -x) 74#define ABS(x) (x >= 0 ? x : -x)
75#define MIN(l,o) ((l) < (o) ? (l) : (o)) 75#define MIN(l,o) ((l) < (o) ? (l) : (o))
76#define MAX(h,i) ((h) > (i) ? (h) : (i)) 76#define MAX(h,i) ((h) > (i) ? (h) : (i))
77#define RESIZE_IF_NEEDED(a,b) \ 77#define RESIZE_IF_NEEDED(a,b) \
78 do { \ 78 do { \
79 if( (a)->alloced < (b) ) \ 79 if( (a)->alloced < (b) ) \
80 mpi_resize((a), (b)); \ 80 mpi_resize((a), (b)); \
81 } while(0) 81 } while(0)
82 82
83/* Copy N limbs from S to D. */ 83/* Copy N limbs from S to D. */
84#define MPN_COPY( d, s, n) \ 84#define MPN_COPY( d, s, n) \
85 do { \ 85 do { \
86 mpi_size_t _i; \ 86 mpi_size_t _i; \
87 for( _i = 0; _i < (n); _i++ ) \ 87 for( _i = 0; _i < (n); _i++ ) \
88 (d)[_i] = (s)[_i]; \ 88 (d)[_i] = (s)[_i]; \
89 } while(0) 89 } while(0)
90 90
91#define MPN_COPY_INCR( d, s, n) \ 91#define MPN_COPY_INCR( d, s, n) \
92 do { \ 92 do { \
93 mpi_size_t _i; \ 93 mpi_size_t _i; \
94 for( _i = 0; _i < (n); _i++ ) \ 94 for( _i = 0; _i < (n); _i++ ) \
95 (d)[_i] = (d)[_i]; \ 95 (d)[_i] = (d)[_i]; \
96 } while (0) 96 } while (0)
97 97
98#define MPN_COPY_DECR( d, s, n ) \ 98#define MPN_COPY_DECR( d, s, n ) \
99 do { \ 99 do { \
100 mpi_size_t _i; \ 100 mpi_size_t _i; \
101 for( _i = (n)-1; _i >= 0; _i--) \ 101 for( _i = (n)-1; _i >= 0; _i--) \
102 (d)[_i] = (s)[_i]; \ 102 (d)[_i] = (s)[_i]; \
103 } while(0) 103 } while(0)
104 104
105/* Zero N limbs at D */ 105/* Zero N limbs at D */
106#define MPN_ZERO(d, n) \ 106#define MPN_ZERO(d, n) \
107 do { \ 107 do { \
108 int _i; \ 108 int _i; \
109 for( _i = 0; _i < (n); _i++ ) \ 109 for( _i = 0; _i < (n); _i++ ) \
110 (d)[_i] = 0; \ 110 (d)[_i] = 0; \
111 } while (0) 111 } while (0)
112 112
113#define MPN_NORMALIZE(d, n) \ 113#define MPN_NORMALIZE(d, n) \
114 do { \ 114 do { \
115 while( (n) > 0 ) { \ 115 while( (n) > 0 ) { \
116 if( (d)[(n)-1] ) \ 116 if( (d)[(n)-1] ) \
117 break; \ 117 break; \
118 (n)--; \ 118 (n)--; \
119 } \ 119 } \
120 } while(0) 120 } while(0)
121 121
122#define MPN_NORMALIZE_NOT_ZERO(d, n) \ 122#define MPN_NORMALIZE_NOT_ZERO(d, n) \
123 do { \ 123 do { \
124 for(;;) { \ 124 for(;;) { \
125 if( (d)[(n)-1] ) \ 125 if( (d)[(n)-1] ) \
126 break; \ 126 break; \
127 (n)--; \ 127 (n)--; \
128 } \ 128 } \
129 } while(0) 129 } while(0)
130 130
131#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \ 131#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \
132 do { \ 132 do { \
133 if( (size) < KARATSUBA_THRESHOLD ) \ 133 if( (size) < KARATSUBA_THRESHOLD ) \
134 mul_n_basecase (prodp, up, vp, size); \ 134 mul_n_basecase (prodp, up, vp, size); \
135 else \ 135 else \
136 mul_n (prodp, up, vp, size, tspace); \ 136 mul_n (prodp, up, vp, size, tspace); \
137 } while (0); 137 } while (0);
138 138
139 139
140/* Divide the two-limb number in (NH,,NL) by D, with DI being the largest 140/* Divide the two-limb number in (NH,,NL) by D, with DI being the largest
141 * limb not larger than (2**(2*BITS_PER_MP_LIMB))/D - (2**BITS_PER_MP_LIMB). 141 * limb not larger than (2**(2*BITS_PER_MP_LIMB))/D - (2**BITS_PER_MP_LIMB).
142 * If this would yield overflow, DI should be the largest possible number 142 * If this would yield overflow, DI should be the largest possible number
143 * (i.e., only ones). For correct operation, the most significant bit of D 143 * (i.e., only ones). For correct operation, the most significant bit of D
144 * has to be set. Put the quotient in Q and the remainder in R. 144 * has to be set. Put the quotient in Q and the remainder in R.
145 */ 145 */
146#define UDIV_QRNND_PREINV(q, r, nh, nl, d, di) \ 146#define UDIV_QRNND_PREINV(q, r, nh, nl, d, di) \
147 do { \ 147 do { \
148 mpi_limb_t _q, _ql, _r; \ 148 mpi_limb_t _q, _ql, _r; \
149 mpi_limb_t _xh, _xl; \ 149 mpi_limb_t _xh, _xl; \
150 umul_ppmm (_q, _ql, (nh), (di)); \ 150 umul_ppmm (_q, _ql, (nh), (di)); \
151 _q += (nh); /* DI is 2**BITS_PER_MPI_LIMB too small */ \ 151 _q += (nh); /* DI is 2**BITS_PER_MPI_LIMB too small */ \
152 umul_ppmm (_xh, _xl, _q, (d)); \ 152 umul_ppmm (_xh, _xl, _q, (d)); \
153 sub_ddmmss (_xh, _r, (nh), (nl), _xh, _xl); \ 153 sub_ddmmss (_xh, _r, (nh), (nl), _xh, _xl); \
154 if( _xh ) { \ 154 if( _xh ) { \
155 sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \ 155 sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
156 _q++; \ 156 _q++; \
157 if( _xh) { \ 157 if( _xh) { \
158 sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \ 158 sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
159 _q++; \ 159 _q++; \
160 } \ 160 } \
161 } \ 161 } \
162 if( _r >= (d) ) { \ 162 if( _r >= (d) ) { \
163 _r -= (d); \ 163 _r -= (d); \
164 _q++; \ 164 _q++; \
165 } \ 165 } \
166 (r) = _r; \ 166 (r) = _r; \
167 (q) = _q; \ 167 (q) = _q; \
168 } while (0) 168 } while (0)
169 169
170 170
171/*-- mpiutil.c --*/ 171/*-- mpiutil.c --*/
172#define mpi_alloc_limb_space(n,f) _gcry_mpi_alloc_limb_space((n),(f)) 172#define mpi_alloc_limb_space(n,f) _gcry_mpi_alloc_limb_space((n),(f))
173mpi_ptr_t _gcry_mpi_alloc_limb_space( unsigned nlimbs, int sec ); 173mpi_ptr_t _gcry_mpi_alloc_limb_space( unsigned nlimbs, int sec );
174void _gcry_mpi_free_limb_space( mpi_ptr_t a, unsigned int nlimbs ); 174void _gcry_mpi_free_limb_space( mpi_ptr_t a, unsigned int nlimbs );
175void _gcry_mpi_assign_limb_space( gcry_mpi_t a, mpi_ptr_t ap, unsigned nlimbs ); 175void _gcry_mpi_assign_limb_space( gcry_mpi_t a, mpi_ptr_t ap, unsigned nlimbs );
176 176
177/*-- mpi-bit.c --*/ 177/*-- mpi-bit.c --*/
178void _gcry_mpi_rshift_limbs( gcry_mpi_t a, unsigned int count ); 178void _gcry_mpi_rshift_limbs( gcry_mpi_t a, unsigned int count );
179void _gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count ); 179void _gcry_mpi_lshift_limbs( gcry_mpi_t a, unsigned int count );
180 180
181 181
182/*-- mpih-add.c --*/ 182/*-- mpih-add.c --*/
183mpi_limb_t _gcry_mpih_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 183mpi_limb_t _gcry_mpih_add_1(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
184 mpi_size_t s1_size, mpi_limb_t s2_limb ); 184 mpi_size_t s1_size, mpi_limb_t s2_limb );
185mpi_limb_t _gcry_mpih_add_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 185mpi_limb_t _gcry_mpih_add_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
186 mpi_ptr_t s2_ptr, mpi_size_t size); 186 mpi_ptr_t s2_ptr, mpi_size_t size);
187mpi_limb_t _gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, 187mpi_limb_t _gcry_mpih_add(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
188 mpi_ptr_t s2_ptr, mpi_size_t s2_size); 188 mpi_ptr_t s2_ptr, mpi_size_t s2_size);
189 189
190/*-- mpih-sub.c --*/ 190/*-- mpih-sub.c --*/
191mpi_limb_t _gcry_mpih_sub_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 191mpi_limb_t _gcry_mpih_sub_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
192 mpi_size_t s1_size, mpi_limb_t s2_limb ); 192 mpi_size_t s1_size, mpi_limb_t s2_limb );
193mpi_limb_t _gcry_mpih_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 193mpi_limb_t _gcry_mpih_sub_n( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
194 mpi_ptr_t s2_ptr, mpi_size_t size); 194 mpi_ptr_t s2_ptr, mpi_size_t size);
195mpi_limb_t _gcry_mpih_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size, 195mpi_limb_t _gcry_mpih_sub(mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, mpi_size_t s1_size,
196 mpi_ptr_t s2_ptr, mpi_size_t s2_size); 196 mpi_ptr_t s2_ptr, mpi_size_t s2_size);
197 197
198/*-- mpih-cmp.c --*/ 198/*-- mpih-cmp.c --*/
199int _gcry_mpih_cmp( mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size ); 199int _gcry_mpih_cmp( mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size );
200 200
201/*-- mpih-mul.c --*/ 201/*-- mpih-mul.c --*/
202 202
203struct karatsuba_ctx { 203struct karatsuba_ctx {
204 struct karatsuba_ctx *next; 204 struct karatsuba_ctx *next;
205 mpi_ptr_t tspace; 205 mpi_ptr_t tspace;
206 unsigned int tspace_nlimbs; 206 unsigned int tspace_nlimbs;
207 mpi_size_t tspace_size; 207 mpi_size_t tspace_size;
208 mpi_ptr_t tp; 208 mpi_ptr_t tp;
209 unsigned int tp_nlimbs; 209 unsigned int tp_nlimbs;
210 mpi_size_t tp_size; 210 mpi_size_t tp_size;
211}; 211};
212 212
213void _gcry_mpih_release_karatsuba_ctx( struct karatsuba_ctx *ctx ); 213void _gcry_mpih_release_karatsuba_ctx( struct karatsuba_ctx *ctx );
214 214
215mpi_limb_t _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 215mpi_limb_t _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
216 mpi_size_t s1_size, mpi_limb_t s2_limb); 216 mpi_size_t s1_size, mpi_limb_t s2_limb);
217mpi_limb_t _gcry_mpih_submul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 217mpi_limb_t _gcry_mpih_submul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
218 mpi_size_t s1_size, mpi_limb_t s2_limb); 218 mpi_size_t s1_size, mpi_limb_t s2_limb);
219void _gcry_mpih_mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, 219void _gcry_mpih_mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
220 mpi_size_t size); 220 mpi_size_t size);
221mpi_limb_t _gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize, 221mpi_limb_t _gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize,
222 mpi_ptr_t vp, mpi_size_t vsize); 222 mpi_ptr_t vp, mpi_size_t vsize);
223void _gcry_mpih_sqr_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size ); 223void _gcry_mpih_sqr_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size );
224void _gcry_mpih_sqr_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size, 224void _gcry_mpih_sqr_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size,
225 mpi_ptr_t tspace); 225 mpi_ptr_t tspace);
226 226
227void _gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp, 227void _gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp,
228 mpi_ptr_t up, mpi_size_t usize, 228 mpi_ptr_t up, mpi_size_t usize,
229 mpi_ptr_t vp, mpi_size_t vsize, 229 mpi_ptr_t vp, mpi_size_t vsize,
230 struct karatsuba_ctx *ctx ); 230 struct karatsuba_ctx *ctx );
231 231
232 232
233/*-- mpih-mul_1.c (or xxx/cpu/ *.S) --*/ 233/*-- mpih-mul_1.c (or xxx/cpu/ *.S) --*/
234mpi_limb_t _gcry_mpih_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr, 234mpi_limb_t _gcry_mpih_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
235 mpi_size_t s1_size, mpi_limb_t s2_limb); 235 mpi_size_t s1_size, mpi_limb_t s2_limb);
236 236
237/*-- mpih-div.c --*/ 237/*-- mpih-div.c --*/
238mpi_limb_t _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, 238mpi_limb_t _gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
239 mpi_limb_t divisor_limb); 239 mpi_limb_t divisor_limb);
240mpi_limb_t _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs, 240mpi_limb_t _gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
241 mpi_ptr_t np, mpi_size_t nsize, 241 mpi_ptr_t np, mpi_size_t nsize,
242 mpi_ptr_t dp, mpi_size_t dsize); 242 mpi_ptr_t dp, mpi_size_t dsize);
243mpi_limb_t _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr, 243mpi_limb_t _gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
244 mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, 244 mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
245 mpi_limb_t divisor_limb); 245 mpi_limb_t divisor_limb);
246 246
247/*-- mpih-shift.c --*/ 247/*-- mpih-shift.c --*/
248mpi_limb_t _gcry_mpih_lshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, 248mpi_limb_t _gcry_mpih_lshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize,
249 unsigned cnt); 249 unsigned cnt);
250mpi_limb_t _gcry_mpih_rshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize, 250mpi_limb_t _gcry_mpih_rshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize,
251 unsigned cnt); 251 unsigned cnt);
252 252
253 253
254/* Define stuff for longlong.h. */ 254/* Define stuff for longlong.h. */
255#define W_TYPE_SIZE BITS_PER_MPI_LIMB 255#define W_TYPE_SIZE BITS_PER_MPI_LIMB
256 typedef mpi_limb_t UWtype; 256 typedef mpi_limb_t UWtype;
257 typedef unsigned int UHWtype; 257 typedef unsigned int UHWtype;
258#if defined (__GNUC__) 258#if defined (__GNUC__)
259 typedef unsigned int UQItype __attribute__ ((mode (QI))); 259 typedef unsigned int UQItype __attribute__ ((mode (QI)));
260 typedef int SItype __attribute__ ((mode (SI))); 260 typedef int SItype __attribute__ ((mode (SI)));
261 typedef unsigned int USItype __attribute__ ((mode (SI))); 261 typedef unsigned int USItype __attribute__ ((mode (SI)));
262 typedef int DItype __attribute__ ((mode (DI))); 262 typedef int DItype __attribute__ ((mode (DI)));
263 typedef unsigned int UDItype __attribute__ ((mode (DI))); 263 typedef unsigned int UDItype __attribute__ ((mode (DI)));
264#else 264#else
265 typedef unsigned char UQItype; 265 typedef unsigned char UQItype;
266 typedef long SItype; 266 typedef long SItype;
267 typedef unsigned long USItype; 267 typedef unsigned long USItype;
268#endif 268#endif
269 269
270#ifdef __GNUC__ 270#ifdef __GNUC__
271#include "mpi-inline.h" 271#include "mpi-inline.h"
272#endif 272#endif
273 273
274#endif /*G10_MPI_INTERNAL_H*/ 274#endif /*G10_MPI_INTERNAL_H*/
275 275
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inv.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inv.c
index 48a7df4..2e737b8 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inv.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-inv.c
@@ -1,275 +1,275 @@
1/* mpi-inv.c - MPI functions 1/* mpi-inv.c - MPI functions
2 * Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include "mpi-internal.h" 24#include "mpi-internal.h"
25#include "g10lib.h" 25#include "g10lib.h"
26 26
27/**************** 27/****************
28 * Calculate the multiplicative inverse X of A mod N 28 * Calculate the multiplicative inverse X of A mod N
29 * That is: Find the solution x for 29 * That is: Find the solution x for
30 * 1 = (a*x) mod n 30 * 1 = (a*x) mod n
31 */ 31 */
32void 32void
33_gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n ) 33_gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
34{ 34{
35#if 0 35#if 0
36 gcry_mpi_t u, v, u1, u2, u3, v1, v2, v3, q, t1, t2, t3; 36 gcry_mpi_t u, v, u1, u2, u3, v1, v2, v3, q, t1, t2, t3;
37 gcry_mpi_t ta, tb, tc; 37 gcry_mpi_t ta, tb, tc;
38 38
39 u = mpi_copy(a); 39 u = mpi_copy(a);
40 v = mpi_copy(n); 40 v = mpi_copy(n);
41 u1 = mpi_alloc_set_ui(1); 41 u1 = mpi_alloc_set_ui(1);
42 u2 = mpi_alloc_set_ui(0); 42 u2 = mpi_alloc_set_ui(0);
43 u3 = mpi_copy(u); 43 u3 = mpi_copy(u);
44 v1 = mpi_alloc_set_ui(0); 44 v1 = mpi_alloc_set_ui(0);
45 v2 = mpi_alloc_set_ui(1); 45 v2 = mpi_alloc_set_ui(1);
46 v3 = mpi_copy(v); 46 v3 = mpi_copy(v);
47 q = mpi_alloc( mpi_get_nlimbs(u)+1 ); 47 q = mpi_alloc( mpi_get_nlimbs(u)+1 );
48 t1 = mpi_alloc( mpi_get_nlimbs(u)+1 ); 48 t1 = mpi_alloc( mpi_get_nlimbs(u)+1 );
49 t2 = mpi_alloc( mpi_get_nlimbs(u)+1 ); 49 t2 = mpi_alloc( mpi_get_nlimbs(u)+1 );
50 t3 = mpi_alloc( mpi_get_nlimbs(u)+1 ); 50 t3 = mpi_alloc( mpi_get_nlimbs(u)+1 );
51 while( mpi_cmp_ui( v3, 0 ) ) { 51 while( mpi_cmp_ui( v3, 0 ) ) {
52 mpi_fdiv_q( q, u3, v3 ); 52 mpi_fdiv_q( q, u3, v3 );
53 mpi_mul(t1, v1, q); mpi_mul(t2, v2, q); mpi_mul(t3, v3, q); 53 mpi_mul(t1, v1, q); mpi_mul(t2, v2, q); mpi_mul(t3, v3, q);
54 mpi_sub(t1, u1, t1); mpi_sub(t2, u2, t2); mpi_sub(t3, u3, t3); 54 mpi_sub(t1, u1, t1); mpi_sub(t2, u2, t2); mpi_sub(t3, u3, t3);
55 mpi_set(u1, v1); mpi_set(u2, v2); mpi_set(u3, v3); 55 mpi_set(u1, v1); mpi_set(u2, v2); mpi_set(u3, v3);
56 mpi_set(v1, t1); mpi_set(v2, t2); mpi_set(v3, t3); 56 mpi_set(v1, t1); mpi_set(v2, t2); mpi_set(v3, t3);
57 } 57 }
58 /* log_debug("result:\n"); 58 /* log_debug("result:\n");
59 log_mpidump("q =", q ); 59 log_mpidump("q =", q );
60 log_mpidump("u1=", u1); 60 log_mpidump("u1=", u1);
61 log_mpidump("u2=", u2); 61 log_mpidump("u2=", u2);
62 log_mpidump("u3=", u3); 62 log_mpidump("u3=", u3);
63 log_mpidump("v1=", v1); 63 log_mpidump("v1=", v1);
64 log_mpidump("v2=", v2); */ 64 log_mpidump("v2=", v2); */
65 mpi_set(x, u1); 65 mpi_set(x, u1);
66 66
67 mpi_free(u1); 67 mpi_free(u1);
68 mpi_free(u2); 68 mpi_free(u2);
69 mpi_free(u3); 69 mpi_free(u3);
70 mpi_free(v1); 70 mpi_free(v1);
71 mpi_free(v2); 71 mpi_free(v2);
72 mpi_free(v3); 72 mpi_free(v3);
73 mpi_free(q); 73 mpi_free(q);
74 mpi_free(t1); 74 mpi_free(t1);
75 mpi_free(t2); 75 mpi_free(t2);
76 mpi_free(t3); 76 mpi_free(t3);
77 mpi_free(u); 77 mpi_free(u);
78 mpi_free(v); 78 mpi_free(v);
79#elif 0 79#elif 0
80 /* Extended Euclid's algorithm (See TAOCP Vol II, 4.5.2, Alg X) 80 /* Extended Euclid's algorithm (See TAOCP Vol II, 4.5.2, Alg X)
81 * modified according to Michael Penk's solution for Exercise 35 */ 81 * modified according to Michael Penk's solution for Exercise 35 */
82 82
83 /* FIXME: we can simplify this in most cases (see Knuth) */ 83 /* FIXME: we can simplify this in most cases (see Knuth) */
84 gcry_mpi_t u, v, u1, u2, u3, v1, v2, v3, t1, t2, t3; 84 gcry_mpi_t u, v, u1, u2, u3, v1, v2, v3, t1, t2, t3;
85 unsigned k; 85 unsigned k;
86 int sign; 86 int sign;
87 87
88 u = mpi_copy(a); 88 u = mpi_copy(a);
89 v = mpi_copy(n); 89 v = mpi_copy(n);
90 for(k=0; !mpi_test_bit(u,0) && !mpi_test_bit(v,0); k++ ) { 90 for(k=0; !mpi_test_bit(u,0) && !mpi_test_bit(v,0); k++ ) {
91 mpi_rshift(u, u, 1); 91 mpi_rshift(u, u, 1);
92 mpi_rshift(v, v, 1); 92 mpi_rshift(v, v, 1);
93 } 93 }
94 94
95 95
96 u1 = mpi_alloc_set_ui(1); 96 u1 = mpi_alloc_set_ui(1);
97 u2 = mpi_alloc_set_ui(0); 97 u2 = mpi_alloc_set_ui(0);
98 u3 = mpi_copy(u); 98 u3 = mpi_copy(u);
99 v1 = mpi_copy(v); /* !-- used as const 1 */ 99 v1 = mpi_copy(v); /* !-- used as const 1 */
100 v2 = mpi_alloc( mpi_get_nlimbs(u) ); mpi_sub( v2, u1, u ); 100 v2 = mpi_alloc( mpi_get_nlimbs(u) ); mpi_sub( v2, u1, u );
101 v3 = mpi_copy(v); 101 v3 = mpi_copy(v);
102 if( mpi_test_bit(u, 0) ) { /* u is odd */ 102 if( mpi_test_bit(u, 0) ) { /* u is odd */
103 t1 = mpi_alloc_set_ui(0); 103 t1 = mpi_alloc_set_ui(0);
104 t2 = mpi_alloc_set_ui(1); t2->sign = 1; 104 t2 = mpi_alloc_set_ui(1); t2->sign = 1;
105 t3 = mpi_copy(v); t3->sign = !t3->sign; 105 t3 = mpi_copy(v); t3->sign = !t3->sign;
106 goto Y4; 106 goto Y4;
107 } 107 }
108 else { 108 else {
109 t1 = mpi_alloc_set_ui(1); 109 t1 = mpi_alloc_set_ui(1);
110 t2 = mpi_alloc_set_ui(0); 110 t2 = mpi_alloc_set_ui(0);
111 t3 = mpi_copy(u); 111 t3 = mpi_copy(u);
112 } 112 }
113 do { 113 do {
114 do { 114 do {
115 if( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */ 115 if( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */
116 mpi_add(t1, t1, v); 116 mpi_add(t1, t1, v);
117 mpi_sub(t2, t2, u); 117 mpi_sub(t2, t2, u);
118 } 118 }
119 mpi_rshift(t1, t1, 1); 119 mpi_rshift(t1, t1, 1);
120 mpi_rshift(t2, t2, 1); 120 mpi_rshift(t2, t2, 1);
121 mpi_rshift(t3, t3, 1); 121 mpi_rshift(t3, t3, 1);
122 Y4: 122 Y4:
123 ; 123 ;
124 } while( !mpi_test_bit( t3, 0 ) ); /* while t3 is even */ 124 } while( !mpi_test_bit( t3, 0 ) ); /* while t3 is even */
125 125
126 if( !t3->sign ) { 126 if( !t3->sign ) {
127 mpi_set(u1, t1); 127 mpi_set(u1, t1);
128 mpi_set(u2, t2); 128 mpi_set(u2, t2);
129 mpi_set(u3, t3); 129 mpi_set(u3, t3);
130 } 130 }
131 else { 131 else {
132 mpi_sub(v1, v, t1); 132 mpi_sub(v1, v, t1);
133 sign = u->sign; u->sign = !u->sign; 133 sign = u->sign; u->sign = !u->sign;
134 mpi_sub(v2, u, t2); 134 mpi_sub(v2, u, t2);
135 u->sign = sign; 135 u->sign = sign;
136 sign = t3->sign; t3->sign = !t3->sign; 136 sign = t3->sign; t3->sign = !t3->sign;
137 mpi_set(v3, t3); 137 mpi_set(v3, t3);
138 t3->sign = sign; 138 t3->sign = sign;
139 } 139 }
140 mpi_sub(t1, u1, v1); 140 mpi_sub(t1, u1, v1);
141 mpi_sub(t2, u2, v2); 141 mpi_sub(t2, u2, v2);
142 mpi_sub(t3, u3, v3); 142 mpi_sub(t3, u3, v3);
143 if( t1->sign ) { 143 if( t1->sign ) {
144 mpi_add(t1, t1, v); 144 mpi_add(t1, t1, v);
145 mpi_sub(t2, t2, u); 145 mpi_sub(t2, t2, u);
146 } 146 }
147 } while( mpi_cmp_ui( t3, 0 ) ); /* while t3 != 0 */ 147 } while( mpi_cmp_ui( t3, 0 ) ); /* while t3 != 0 */
148 /* mpi_lshift( u3, k ); */ 148 /* mpi_lshift( u3, k ); */
149 mpi_set(x, u1); 149 mpi_set(x, u1);
150 150
151 mpi_free(u1); 151 mpi_free(u1);
152 mpi_free(u2); 152 mpi_free(u2);
153 mpi_free(u3); 153 mpi_free(u3);
154 mpi_free(v1); 154 mpi_free(v1);
155 mpi_free(v2); 155 mpi_free(v2);
156 mpi_free(v3); 156 mpi_free(v3);
157 mpi_free(t1); 157 mpi_free(t1);
158 mpi_free(t2); 158 mpi_free(t2);
159 mpi_free(t3); 159 mpi_free(t3);
160#else 160#else
161 /* Extended Euclid's algorithm (See TAOCP Vol II, 4.5.2, Alg X) 161 /* Extended Euclid's algorithm (See TAOCP Vol II, 4.5.2, Alg X)
162 * modified according to Michael Penk's solution for Exercise 35 162 * modified according to Michael Penk's solution for Exercise 35
163 * with further enhancement */ 163 * with further enhancement */
164 gcry_mpi_t u, v, u1, u2=NULL, u3, v1, v2=NULL, v3, t1, t2=NULL, t3; 164 gcry_mpi_t u, v, u1, u2=NULL, u3, v1, v2=NULL, v3, t1, t2=NULL, t3;
165 unsigned k; 165 unsigned k;
166 int sign; 166 int sign;
167 int odd ; 167 int odd ;
168 168
169 u = mpi_copy(a); 169 u = mpi_copy(a);
170 v = mpi_copy(n); 170 v = mpi_copy(n);
171 171
172 for(k=0; !mpi_test_bit(u,0) && !mpi_test_bit(v,0); k++ ) { 172 for(k=0; !mpi_test_bit(u,0) && !mpi_test_bit(v,0); k++ ) {
173 mpi_rshift(u, u, 1); 173 mpi_rshift(u, u, 1);
174 mpi_rshift(v, v, 1); 174 mpi_rshift(v, v, 1);
175 } 175 }
176 odd = mpi_test_bit(v,0); 176 odd = mpi_test_bit(v,0);
177 177
178 u1 = mpi_alloc_set_ui(1); 178 u1 = mpi_alloc_set_ui(1);
179 if( !odd ) 179 if( !odd )
180 u2 = mpi_alloc_set_ui(0); 180 u2 = mpi_alloc_set_ui(0);
181 u3 = mpi_copy(u); 181 u3 = mpi_copy(u);
182 v1 = mpi_copy(v); 182 v1 = mpi_copy(v);
183 if( !odd ) { 183 if( !odd ) {
184 v2 = mpi_alloc( mpi_get_nlimbs(u) ); 184 v2 = mpi_alloc( mpi_get_nlimbs(u) );
185 mpi_sub( v2, u1, u ); /* U is used as const 1 */ 185 mpi_sub( v2, u1, u ); /* U is used as const 1 */
186 } 186 }
187 v3 = mpi_copy(v); 187 v3 = mpi_copy(v);
188 if( mpi_test_bit(u, 0) ) { /* u is odd */ 188 if( mpi_test_bit(u, 0) ) { /* u is odd */
189 t1 = mpi_alloc_set_ui(0); 189 t1 = mpi_alloc_set_ui(0);
190 if( !odd ) { 190 if( !odd ) {
191 t2 = mpi_alloc_set_ui(1); t2->sign = 1; 191 t2 = mpi_alloc_set_ui(1); t2->sign = 1;
192 } 192 }
193 t3 = mpi_copy(v); t3->sign = !t3->sign; 193 t3 = mpi_copy(v); t3->sign = !t3->sign;
194 goto Y4; 194 goto Y4;
195 } 195 }
196 else { 196 else {
197 t1 = mpi_alloc_set_ui(1); 197 t1 = mpi_alloc_set_ui(1);
198 if( !odd ) 198 if( !odd )
199 t2 = mpi_alloc_set_ui(0); 199 t2 = mpi_alloc_set_ui(0);
200 t3 = mpi_copy(u); 200 t3 = mpi_copy(u);
201 } 201 }
202 do { 202 do {
203 do { 203 do {
204 if( !odd ) { 204 if( !odd ) {
205 if( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */ 205 if( mpi_test_bit(t1, 0) || mpi_test_bit(t2, 0) ) { /* one is odd */
206 mpi_add(t1, t1, v); 206 mpi_add(t1, t1, v);
207 mpi_sub(t2, t2, u); 207 mpi_sub(t2, t2, u);
208 } 208 }
209 mpi_rshift(t1, t1, 1); 209 mpi_rshift(t1, t1, 1);
210 mpi_rshift(t2, t2, 1); 210 mpi_rshift(t2, t2, 1);
211 mpi_rshift(t3, t3, 1); 211 mpi_rshift(t3, t3, 1);
212 } 212 }
213 else { 213 else {
214 if( mpi_test_bit(t1, 0) ) 214 if( mpi_test_bit(t1, 0) )
215 mpi_add(t1, t1, v); 215 mpi_add(t1, t1, v);
216 mpi_rshift(t1, t1, 1); 216 mpi_rshift(t1, t1, 1);
217 mpi_rshift(t3, t3, 1); 217 mpi_rshift(t3, t3, 1);
218 } 218 }
219 Y4: 219 Y4:
220 ; 220 ;
221 } while( !mpi_test_bit( t3, 0 ) ); /* while t3 is even */ 221 } while( !mpi_test_bit( t3, 0 ) ); /* while t3 is even */
222 222
223 if( !t3->sign ) { 223 if( !t3->sign ) {
224 mpi_set(u1, t1); 224 mpi_set(u1, t1);
225 if( !odd ) 225 if( !odd )
226 mpi_set(u2, t2); 226 mpi_set(u2, t2);
227 mpi_set(u3, t3); 227 mpi_set(u3, t3);
228 } 228 }
229 else { 229 else {
230 mpi_sub(v1, v, t1); 230 mpi_sub(v1, v, t1);
231 sign = u->sign; u->sign = !u->sign; 231 sign = u->sign; u->sign = !u->sign;
232 if( !odd ) 232 if( !odd )
233 mpi_sub(v2, u, t2); 233 mpi_sub(v2, u, t2);
234 u->sign = sign; 234 u->sign = sign;
235 sign = t3->sign; t3->sign = !t3->sign; 235 sign = t3->sign; t3->sign = !t3->sign;
236 mpi_set(v3, t3); 236 mpi_set(v3, t3);
237 t3->sign = sign; 237 t3->sign = sign;
238 } 238 }
239 mpi_sub(t1, u1, v1); 239 mpi_sub(t1, u1, v1);
240 if( !odd ) 240 if( !odd )
241 mpi_sub(t2, u2, v2); 241 mpi_sub(t2, u2, v2);
242 mpi_sub(t3, u3, v3); 242 mpi_sub(t3, u3, v3);
243 if( t1->sign ) { 243 if( t1->sign ) {
244 mpi_add(t1, t1, v); 244 mpi_add(t1, t1, v);
245 if( !odd ) 245 if( !odd )
246 mpi_sub(t2, t2, u); 246 mpi_sub(t2, t2, u);
247 } 247 }
248 } while( mpi_cmp_ui( t3, 0 ) ); /* while t3 != 0 */ 248 } while( mpi_cmp_ui( t3, 0 ) ); /* while t3 != 0 */
249 /* mpi_lshift( u3, k ); */ 249 /* mpi_lshift( u3, k ); */
250 mpi_set(x, u1); 250 mpi_set(x, u1);
251 251
252 mpi_free(u1); 252 mpi_free(u1);
253 mpi_free(v1); 253 mpi_free(v1);
254 mpi_free(t1); 254 mpi_free(t1);
255 if( !odd ) { 255 if( !odd ) {
256 mpi_free(u2); 256 mpi_free(u2);
257 mpi_free(v2); 257 mpi_free(v2);
258 mpi_free(t2); 258 mpi_free(t2);
259 } 259 }
260 mpi_free(u3); 260 mpi_free(u3);
261 mpi_free(v3); 261 mpi_free(v3);
262 mpi_free(t3); 262 mpi_free(t3);
263 263
264 mpi_free(u); 264 mpi_free(u);
265 mpi_free(v); 265 mpi_free(v);
266#endif 266#endif
267} 267}
268 268
269 269
270int 270int
271gcry_mpi_invm (gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n) 271gcry_mpi_invm (gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n)
272{ 272{
273 _gcry_mpi_invm (x, a, n); 273 _gcry_mpi_invm (x, a, n);
274 return 1; 274 return 1;
275} 275}
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mpow.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mpow.c
index 463dee8..f37c6f9 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mpow.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mpow.c
@@ -1,224 +1,224 @@
1/* mpi-mpow.c - MPI functions 1/* mpi-mpow.c - MPI functions
2 * Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include "mpi-internal.h" 24#include "mpi-internal.h"
25#include "longlong.h" 25#include "longlong.h"
26#include "g10lib.h" 26#include "g10lib.h"
27#include <assert.h> 27#include <assert.h>
28 28
29 29
30/* Barrett is slower than the classical way. It can be tweaked by 30/* Barrett is slower than the classical way. It can be tweaked by
31 * using partial multiplications 31 * using partial multiplications
32 */ 32 */
33/*#define USE_BARRETT*/ 33/*#define USE_BARRETT*/
34 34
35 35
36 36
37#ifdef USE_BARRETT 37#ifdef USE_BARRETT
38static void barrett_mulm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 ); 38static void barrett_mulm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 );
39static gcry_mpi_t init_barrett( gcry_mpi_t m, int *k, gcry_mpi_t *r1, gcry_mpi_t *r2 ); 39static gcry_mpi_t init_barrett( gcry_mpi_t m, int *k, gcry_mpi_t *r1, gcry_mpi_t *r2 );
40static int calc_barrett( gcry_mpi_t r, gcry_mpi_t x, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 ); 40static int calc_barrett( gcry_mpi_t r, gcry_mpi_t x, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 );
41#else 41#else
42#define barrett_mulm( w, u, v, m, y, k, r1, r2 ) gcry_mpi_mulm( (w), (u), (v), (m) ) 42#define barrett_mulm( w, u, v, m, y, k, r1, r2 ) gcry_mpi_mulm( (w), (u), (v), (m) )
43#endif 43#endif
44 44
45 45
46static int 46static int
47build_index( gcry_mpi_t *exparray, int k, int i, int t ) 47build_index( gcry_mpi_t *exparray, int k, int i, int t )
48{ 48{
49 int j, bitno; 49 int j, bitno;
50 int idx = 0; 50 int idx = 0;
51 51
52 bitno = t-i; 52 bitno = t-i;
53 for(j=k-1; j >= 0; j-- ) { 53 for(j=k-1; j >= 0; j-- ) {
54 idx <<= 1; 54 idx <<= 1;
55 if( mpi_test_bit( exparray[j], bitno ) ) 55 if( mpi_test_bit( exparray[j], bitno ) )
56 idx |= 1; 56 idx |= 1;
57 } 57 }
58 /*log_debug("t=%d i=%d idx=%d\n", t, i, idx );*/ 58 /*log_debug("t=%d i=%d idx=%d\n", t, i, idx );*/
59 return idx; 59 return idx;
60} 60}
61 61
62/**************** 62/****************
63 * RES = (BASE[0] ^ EXP[0]) * (BASE[1] ^ EXP[1]) * ... * mod M 63 * RES = (BASE[0] ^ EXP[0]) * (BASE[1] ^ EXP[1]) * ... * mod M
64 */ 64 */
65void 65void
66_gcry_mpi_mulpowm( gcry_mpi_t res, gcry_mpi_t *basearray, gcry_mpi_t *exparray, gcry_mpi_t m) 66_gcry_mpi_mulpowm( gcry_mpi_t res, gcry_mpi_t *basearray, gcry_mpi_t *exparray, gcry_mpi_t m)
67{ 67{
68 int k; /* number of elements */ 68 int k; /* number of elements */
69 int t; /* bit size of largest exponent */ 69 int t; /* bit size of largest exponent */
70 int i, j, idx; 70 int i, j, idx;
71 gcry_mpi_t *G; /* table with precomputed values of size 2^k */ 71 gcry_mpi_t *G; /* table with precomputed values of size 2^k */
72 gcry_mpi_t tmp; 72 gcry_mpi_t tmp;
73#ifdef USE_BARRETT 73#ifdef USE_BARRETT
74 gcry_mpi_t barrett_y, barrett_r1, barrett_r2; 74 gcry_mpi_t barrett_y, barrett_r1, barrett_r2;
75 int barrett_k; 75 int barrett_k;
76#endif 76#endif
77 77
78 for(k=0; basearray[k]; k++ ) 78 for(k=0; basearray[k]; k++ )
79 ; 79 ;
80 assert(k); 80 assert(k);
81 for(t=0, i=0; (tmp=exparray[i]); i++ ) { 81 for(t=0, i=0; (tmp=exparray[i]); i++ ) {
82 /*log_mpidump("exp: ", tmp );*/ 82 /*log_mpidump("exp: ", tmp );*/
83 j = mpi_get_nbits(tmp); 83 j = mpi_get_nbits(tmp);
84 if( j > t ) 84 if( j > t )
85 t = j; 85 t = j;
86 } 86 }
87 /*log_mpidump("mod: ", m );*/ 87 /*log_mpidump("mod: ", m );*/
88 assert(i==k); 88 assert(i==k);
89 assert(t); 89 assert(t);
90 assert( k < 10 ); 90 assert( k < 10 );
91 91
92 G = gcry_xcalloc( (1<<k) , sizeof *G ); 92 G = gcry_xcalloc( (1<<k) , sizeof *G );
93#ifdef USE_BARRETT 93#ifdef USE_BARRETT
94 barrett_y = init_barrett( m, &barrett_k, &barrett_r1, &barrett_r2 ); 94 barrett_y = init_barrett( m, &barrett_k, &barrett_r1, &barrett_r2 );
95#endif 95#endif
96 /* and calculate */ 96 /* and calculate */
97 tmp = mpi_alloc( mpi_get_nlimbs(m)+1 ); 97 tmp = mpi_alloc( mpi_get_nlimbs(m)+1 );
98 mpi_set_ui( res, 1 ); 98 mpi_set_ui( res, 1 );
99 for(i = 1; i <= t; i++ ) { 99 for(i = 1; i <= t; i++ ) {
100 barrett_mulm(tmp, res, res, m, barrett_y, barrett_k, 100 barrett_mulm(tmp, res, res, m, barrett_y, barrett_k,
101 barrett_r1, barrett_r2 ); 101 barrett_r1, barrett_r2 );
102 idx = build_index( exparray, k, i, t ); 102 idx = build_index( exparray, k, i, t );
103 assert( idx >= 0 && idx < (1<<k) ); 103 assert( idx >= 0 && idx < (1<<k) );
104 if( !G[idx] ) { 104 if( !G[idx] ) {
105 if( !idx ) 105 if( !idx )
106 G[0] = mpi_alloc_set_ui( 1 ); 106 G[0] = mpi_alloc_set_ui( 1 );
107 else { 107 else {
108 for(j=0; j < k; j++ ) { 108 for(j=0; j < k; j++ ) {
109 if( (idx & (1<<j) ) ) { 109 if( (idx & (1<<j) ) ) {
110 if( !G[idx] ) 110 if( !G[idx] )
111 G[idx] = mpi_copy( basearray[j] ); 111 G[idx] = mpi_copy( basearray[j] );
112 else 112 else
113 barrett_mulm( G[idx], G[idx], basearray[j], 113 barrett_mulm( G[idx], G[idx], basearray[j],
114 m, barrett_y, barrett_k, barrett_r1, barrett_r2 ); 114 m, barrett_y, barrett_k, barrett_r1, barrett_r2 );
115 } 115 }
116 } 116 }
117 if( !G[idx] ) 117 if( !G[idx] )
118 G[idx] = mpi_alloc(0); 118 G[idx] = mpi_alloc(0);
119 } 119 }
120 } 120 }
121 barrett_mulm(res, tmp, G[idx], m, barrett_y, barrett_k, barrett_r1, barrett_r2 ); 121 barrett_mulm(res, tmp, G[idx], m, barrett_y, barrett_k, barrett_r1, barrett_r2 );
122 } 122 }
123 123
124 /* cleanup */ 124 /* cleanup */
125 mpi_free(tmp); 125 mpi_free(tmp);
126#ifdef USE_BARRETT 126#ifdef USE_BARRETT
127 mpi_free(barrett_y); 127 mpi_free(barrett_y);
128 mpi_free(barrett_r1); 128 mpi_free(barrett_r1);
129 mpi_free(barrett_r2); 129 mpi_free(barrett_r2);
130#endif 130#endif
131 for(i=0; i < (1<<k); i++ ) 131 for(i=0; i < (1<<k); i++ )
132 mpi_free(G[i]); 132 mpi_free(G[i]);
133 gcry_free(G); 133 gcry_free(G);
134} 134}
135 135
136 136
137 137
138#ifdef USE_BARRETT 138#ifdef USE_BARRETT
139static void 139static void
140barrett_mulm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 ) 140barrett_mulm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 )
141{ 141{
142 mpi_mul(w, u, v); 142 mpi_mul(w, u, v);
143 if( calc_barrett( w, w, m, y, k, r1, r2 ) ) 143 if( calc_barrett( w, w, m, y, k, r1, r2 ) )
144 mpi_fdiv_r( w, w, m ); 144 mpi_fdiv_r( w, w, m );
145} 145}
146 146
147/**************** 147/****************
148 * Barrett precalculation: y = floor(b^(2k) / m) 148 * Barrett precalculation: y = floor(b^(2k) / m)
149 */ 149 */
150static gcry_mpi_t 150static gcry_mpi_t
151init_barrett( gcry_mpi_t m, int *k, gcry_mpi_t *r1, gcry_mpi_t *r2 ) 151init_barrett( gcry_mpi_t m, int *k, gcry_mpi_t *r1, gcry_mpi_t *r2 )
152{ 152{
153 gcry_mpi_t tmp; 153 gcry_mpi_t tmp;
154 154
155 mpi_normalize( m ); 155 mpi_normalize( m );
156 *k = mpi_get_nlimbs( m ); 156 *k = mpi_get_nlimbs( m );
157 tmp = mpi_alloc( *k + 1 ); 157 tmp = mpi_alloc( *k + 1 );
158 mpi_set_ui( tmp, 1 ); 158 mpi_set_ui( tmp, 1 );
159 mpi_lshift_limbs( tmp, 2 * *k ); 159 mpi_lshift_limbs( tmp, 2 * *k );
160 mpi_fdiv_q( tmp, tmp, m ); 160 mpi_fdiv_q( tmp, tmp, m );
161 *r1 = mpi_alloc( 2* *k + 1 ); 161 *r1 = mpi_alloc( 2* *k + 1 );
162 *r2 = mpi_alloc( 2* *k + 1 ); 162 *r2 = mpi_alloc( 2* *k + 1 );
163 return tmp; 163 return tmp;
164} 164}
165 165
166/**************** 166/****************
167 * Barrett reduction: We assume that these conditions are met: 167 * Barrett reduction: We assume that these conditions are met:
168 * Given x =(x_2k-1 ...x_0)_b 168 * Given x =(x_2k-1 ...x_0)_b
169 * m =(m_k-1 ....m_0)_b with m_k-1 != 0 169 * m =(m_k-1 ....m_0)_b with m_k-1 != 0
170 * Output r = x mod m 170 * Output r = x mod m
171 * Before using this function init_barret must be used to calucalte y and k. 171 * Before using this function init_barret must be used to calucalte y and k.
172 * Returns: false = no error 172 * Returns: false = no error
173 * true = can't perform barret reduction 173 * true = can't perform barret reduction
174 */ 174 */
175static int 175static int
176calc_barrett( gcry_mpi_t r, gcry_mpi_t x, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 ) 176calc_barrett( gcry_mpi_t r, gcry_mpi_t x, gcry_mpi_t m, gcry_mpi_t y, int k, gcry_mpi_t r1, gcry_mpi_t r2 )
177{ 177{
178 int xx = k > 3 ? k-3:0; 178 int xx = k > 3 ? k-3:0;
179 179
180 mpi_normalize( x ); 180 mpi_normalize( x );
181 if( mpi_get_nlimbs(x) > 2*k ) 181 if( mpi_get_nlimbs(x) > 2*k )
182 return 1; /* can't do it */ 182 return 1; /* can't do it */
183 183
184 /* 1. q1 = floor( x / b^k-1) 184 /* 1. q1 = floor( x / b^k-1)
185 * q2 = q1 * y 185 * q2 = q1 * y
186 * q3 = floor( q2 / b^k+1 ) 186 * q3 = floor( q2 / b^k+1 )
187 * Actually, we don't need qx, we can work direct on r2 187 * Actually, we don't need qx, we can work direct on r2
188 */ 188 */
189 mpi_set( r2, x ); 189 mpi_set( r2, x );
190 mpi_rshift_limbs( r2, k-1 ); 190 mpi_rshift_limbs( r2, k-1 );
191 mpi_mul( r2, r2, y ); 191 mpi_mul( r2, r2, y );
192 mpi_rshift_limbs( r2, k+1 ); 192 mpi_rshift_limbs( r2, k+1 );
193 193
194 /* 2. r1 = x mod b^k+1 194 /* 2. r1 = x mod b^k+1
195 * r2 = q3 * m mod b^k+1 195 * r2 = q3 * m mod b^k+1
196 * r = r1 - r2 196 * r = r1 - r2
197 * 3. if r < 0 then r = r + b^k+1 197 * 3. if r < 0 then r = r + b^k+1
198 */ 198 */
199 mpi_set( r1, x ); 199 mpi_set( r1, x );
200 if( r1->nlimbs > k+1 ) /* quick modulo operation */ 200 if( r1->nlimbs > k+1 ) /* quick modulo operation */
201 r1->nlimbs = k+1; 201 r1->nlimbs = k+1;
202 mpi_mul( r2, r2, m ); 202 mpi_mul( r2, r2, m );
203 if( r2->nlimbs > k+1 ) /* quick modulo operation */ 203 if( r2->nlimbs > k+1 ) /* quick modulo operation */
204 r2->nlimbs = k+1; 204 r2->nlimbs = k+1;
205 mpi_sub( r, r1, r2 ); 205 mpi_sub( r, r1, r2 );
206 206
207 if( mpi_is_neg( r ) ) { 207 if( mpi_is_neg( r ) ) {
208 gcry_mpi_t tmp; 208 gcry_mpi_t tmp;
209 209
210 tmp = mpi_alloc( k + 2 ); 210 tmp = mpi_alloc( k + 2 );
211 mpi_set_ui( tmp, 1 ); 211 mpi_set_ui( tmp, 1 );
212 mpi_lshift_limbs( tmp, k+1 ); 212 mpi_lshift_limbs( tmp, k+1 );
213 mpi_add( r, r, tmp ); 213 mpi_add( r, r, tmp );
214 mpi_free(tmp); 214 mpi_free(tmp);
215 } 215 }
216 216
217 /* 4. while r >= m do r = r - m */ 217 /* 4. while r >= m do r = r - m */
218 while( mpi_cmp( r, m ) >= 0 ) 218 while( mpi_cmp( r, m ) >= 0 )
219 mpi_sub( r, r, m ); 219 mpi_sub( r, r, m );
220 220
221 return 0; 221 return 0;
222} 222}
223#endif /* USE_BARRETT */ 223#endif /* USE_BARRETT */
224 224
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mul.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mul.c
index a9e2976..23beee0 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mul.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-mul.c
@@ -1,220 +1,220 @@
1/* mpi-mul.c - MPI functions 1/* mpi-mul.c - MPI functions
2 * Copyright (C) 1994, 1996, 1998, 2001, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1994, 1996, 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 * 19 *
20 * Note: This code is heavily based on the GNU MP Library. 20 * Note: This code is heavily based on the GNU MP Library.
21 * Actually it's the same code with only minor changes in the 21 * Actually it's the same code with only minor changes in the
22 * way the data is stored; this is to support the abstraction 22 * way the data is stored; this is to support the abstraction
23 * of an optional secure memory allocation which may be used 23 * of an optional secure memory allocation which may be used
24 * to avoid revealing of sensitive data due to paging etc. 24 * to avoid revealing of sensitive data due to paging etc.
25 */ 25 */
26 26
27#include <config.h> 27#include <config.h>
28#include <stdio.h> 28#include <stdio.h>
29#include <stdlib.h> 29#include <stdlib.h>
30#include "mpi-internal.h" 30#include "mpi-internal.h"
31 31
32 32
33void 33void
34gcry_mpi_mul_ui( gcry_mpi_t prod, gcry_mpi_t mult, unsigned long small_mult ) 34gcry_mpi_mul_ui( gcry_mpi_t prod, gcry_mpi_t mult, unsigned long small_mult )
35{ 35{
36 mpi_size_t size, prod_size; 36 mpi_size_t size, prod_size;
37 mpi_ptr_t prod_ptr; 37 mpi_ptr_t prod_ptr;
38 mpi_limb_t cy; 38 mpi_limb_t cy;
39 int sign; 39 int sign;
40 40
41 size = mult->nlimbs; 41 size = mult->nlimbs;
42 sign = mult->sign; 42 sign = mult->sign;
43 43
44 if( !size || !small_mult ) { 44 if( !size || !small_mult ) {
45 prod->nlimbs = 0; 45 prod->nlimbs = 0;
46 prod->sign = 0; 46 prod->sign = 0;
47 return; 47 return;
48 } 48 }
49 49
50 prod_size = size + 1; 50 prod_size = size + 1;
51 if( prod->alloced < prod_size ) 51 if( prod->alloced < prod_size )
52 mpi_resize( prod, prod_size ); 52 mpi_resize( prod, prod_size );
53 prod_ptr = prod->d; 53 prod_ptr = prod->d;
54 54
55 cy = _gcry_mpih_mul_1( prod_ptr, mult->d, size, (mpi_limb_t)small_mult ); 55 cy = _gcry_mpih_mul_1( prod_ptr, mult->d, size, (mpi_limb_t)small_mult );
56 if( cy ) 56 if( cy )
57 prod_ptr[size++] = cy; 57 prod_ptr[size++] = cy;
58 prod->nlimbs = size; 58 prod->nlimbs = size;
59 prod->sign = sign; 59 prod->sign = sign;
60} 60}
61 61
62 62
63void 63void
64_gcry_mpi_mul_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt) 64_gcry_mpi_mul_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt)
65{ 65{
66 mpi_size_t usize, wsize, limb_cnt; 66 mpi_size_t usize, wsize, limb_cnt;
67 mpi_ptr_t wp; 67 mpi_ptr_t wp;
68 mpi_limb_t wlimb; 68 mpi_limb_t wlimb;
69 int usign, wsign; 69 int usign, wsign;
70 70
71 usize = u->nlimbs; 71 usize = u->nlimbs;
72 usign = u->sign; 72 usign = u->sign;
73 73
74 if( !usize ) { 74 if( !usize ) {
75 w->nlimbs = 0; 75 w->nlimbs = 0;
76 w->sign = 0; 76 w->sign = 0;
77 return; 77 return;
78 } 78 }
79 79
80 limb_cnt = cnt / BITS_PER_MPI_LIMB; 80 limb_cnt = cnt / BITS_PER_MPI_LIMB;
81 wsize = usize + limb_cnt + 1; 81 wsize = usize + limb_cnt + 1;
82 if( w->alloced < wsize ) 82 if( w->alloced < wsize )
83 mpi_resize(w, wsize ); 83 mpi_resize(w, wsize );
84 wp = w->d; 84 wp = w->d;
85 wsize = usize + limb_cnt; 85 wsize = usize + limb_cnt;
86 wsign = usign; 86 wsign = usign;
87 87
88 cnt %= BITS_PER_MPI_LIMB; 88 cnt %= BITS_PER_MPI_LIMB;
89 if( cnt ) { 89 if( cnt ) {
90 wlimb = _gcry_mpih_lshift( wp + limb_cnt, u->d, usize, cnt ); 90 wlimb = _gcry_mpih_lshift( wp + limb_cnt, u->d, usize, cnt );
91 if( wlimb ) { 91 if( wlimb ) {
92 wp[wsize] = wlimb; 92 wp[wsize] = wlimb;
93 wsize++; 93 wsize++;
94 } 94 }
95 } 95 }
96 else { 96 else {
97 MPN_COPY_DECR( wp + limb_cnt, u->d, usize ); 97 MPN_COPY_DECR( wp + limb_cnt, u->d, usize );
98 } 98 }
99 99
100 /* Zero all whole limbs at low end. Do it here and not before calling 100 /* Zero all whole limbs at low end. Do it here and not before calling
101 * mpn_lshift, not to lose for U == W. */ 101 * mpn_lshift, not to lose for U == W. */
102 MPN_ZERO( wp, limb_cnt ); 102 MPN_ZERO( wp, limb_cnt );
103 103
104 w->nlimbs = wsize; 104 w->nlimbs = wsize;
105 w->sign = wsign; 105 w->sign = wsign;
106} 106}
107 107
108 108
109void 109void
110gcry_mpi_mul_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt) 110gcry_mpi_mul_2exp( gcry_mpi_t w, gcry_mpi_t u, unsigned long cnt)
111{ 111{
112 _gcry_mpi_mul_2exp (w, u, cnt); 112 _gcry_mpi_mul_2exp (w, u, cnt);
113} 113}
114 114
115 115
116void 116void
117gcry_mpi_mul( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v) 117gcry_mpi_mul( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v)
118{ 118{
119 mpi_size_t usize, vsize, wsize; 119 mpi_size_t usize, vsize, wsize;
120 mpi_ptr_t up, vp, wp; 120 mpi_ptr_t up, vp, wp;
121 mpi_limb_t cy; 121 mpi_limb_t cy;
122 int usign, vsign, usecure, vsecure, sign_product; 122 int usign, vsign, usecure, vsecure, sign_product;
123 int assign_wp=0; 123 int assign_wp=0;
124 mpi_ptr_t tmp_limb=NULL; 124 mpi_ptr_t tmp_limb=NULL;
125 unsigned int tmp_limb_nlimbs = 0; 125 unsigned int tmp_limb_nlimbs = 0;
126 126
127 if( u->nlimbs < v->nlimbs ) { /* Swap U and V. */ 127 if( u->nlimbs < v->nlimbs ) { /* Swap U and V. */
128 usize = v->nlimbs; 128 usize = v->nlimbs;
129 usign = v->sign; 129 usign = v->sign;
130 usecure = mpi_is_secure(v); 130 usecure = mpi_is_secure(v);
131 up = v->d; 131 up = v->d;
132 vsize = u->nlimbs; 132 vsize = u->nlimbs;
133 vsign = u->sign; 133 vsign = u->sign;
134 vsecure = mpi_is_secure(u); 134 vsecure = mpi_is_secure(u);
135 vp = u->d; 135 vp = u->d;
136 } 136 }
137 else { 137 else {
138 usize = u->nlimbs; 138 usize = u->nlimbs;
139 usign = u->sign; 139 usign = u->sign;
140 usecure = mpi_is_secure(u); 140 usecure = mpi_is_secure(u);
141 up = u->d; 141 up = u->d;
142 vsize = v->nlimbs; 142 vsize = v->nlimbs;
143 vsign = v->sign; 143 vsign = v->sign;
144 vsecure = mpi_is_secure(v); 144 vsecure = mpi_is_secure(v);
145 vp = v->d; 145 vp = v->d;
146 } 146 }
147 sign_product = usign ^ vsign; 147 sign_product = usign ^ vsign;
148 wp = w->d; 148 wp = w->d;
149 149
150 /* Ensure W has space enough to store the result. */ 150 /* Ensure W has space enough to store the result. */
151 wsize = usize + vsize; 151 wsize = usize + vsize;
152 if ( !mpi_is_secure (w) && (mpi_is_secure (u) || mpi_is_secure (v)) ) { 152 if ( !mpi_is_secure (w) && (mpi_is_secure (u) || mpi_is_secure (v)) ) {
153 /* w is not allocated in secure space but u or v is. To make sure 153 /* w is not allocated in secure space but u or v is. To make sure
154 * that no temporray results are stored in w, we temporary use 154 * that no temporray results are stored in w, we temporary use
155 * a newly allocated limb space for w */ 155 * a newly allocated limb space for w */
156 wp = mpi_alloc_limb_space( wsize, 1 ); 156 wp = mpi_alloc_limb_space( wsize, 1 );
157 assign_wp = 2; /* mark it as 2 so that we can later copy it back to 157 assign_wp = 2; /* mark it as 2 so that we can later copy it back to
158 * mormal memory */ 158 * mormal memory */
159 } 159 }
160 else if( w->alloced < wsize ) { 160 else if( w->alloced < wsize ) {
161 if( wp == up || wp == vp ) { 161 if( wp == up || wp == vp ) {
162 wp = mpi_alloc_limb_space( wsize, mpi_is_secure(w) ); 162 wp = mpi_alloc_limb_space( wsize, mpi_is_secure(w) );
163 assign_wp = 1; 163 assign_wp = 1;
164 } 164 }
165 else { 165 else {
166 mpi_resize(w, wsize ); 166 mpi_resize(w, wsize );
167 wp = w->d; 167 wp = w->d;
168 } 168 }
169 } 169 }
170 else { /* Make U and V not overlap with W. */ 170 else { /* Make U and V not overlap with W. */
171 if( wp == up ) { 171 if( wp == up ) {
172 /* W and U are identical. Allocate temporary space for U. */ 172 /* W and U are identical. Allocate temporary space for U. */
173 tmp_limb_nlimbs = usize; 173 tmp_limb_nlimbs = usize;
174 up = tmp_limb = mpi_alloc_limb_space( usize, usecure ); 174 up = tmp_limb = mpi_alloc_limb_space( usize, usecure );
175 /* Is V identical too? Keep it identical with U. */ 175 /* Is V identical too? Keep it identical with U. */
176 if( wp == vp ) 176 if( wp == vp )
177 vp = up; 177 vp = up;
178 /* Copy to the temporary space. */ 178 /* Copy to the temporary space. */
179 MPN_COPY( up, wp, usize ); 179 MPN_COPY( up, wp, usize );
180 } 180 }
181 else if( wp == vp ) { 181 else if( wp == vp ) {
182 /* W and V are identical. Allocate temporary space for V. */ 182 /* W and V are identical. Allocate temporary space for V. */
183 tmp_limb_nlimbs = vsize; 183 tmp_limb_nlimbs = vsize;
184 vp = tmp_limb = mpi_alloc_limb_space( vsize, vsecure ); 184 vp = tmp_limb = mpi_alloc_limb_space( vsize, vsecure );
185 /* Copy to the temporary space. */ 185 /* Copy to the temporary space. */
186 MPN_COPY( vp, wp, vsize ); 186 MPN_COPY( vp, wp, vsize );
187 } 187 }
188 } 188 }
189 189
190 if( !vsize ) 190 if( !vsize )
191 wsize = 0; 191 wsize = 0;
192 else { 192 else {
193 cy = _gcry_mpih_mul( wp, up, usize, vp, vsize ); 193 cy = _gcry_mpih_mul( wp, up, usize, vp, vsize );
194 wsize -= cy? 0:1; 194 wsize -= cy? 0:1;
195 } 195 }
196 196
197 if( assign_wp ) { 197 if( assign_wp ) {
198 if (assign_wp == 2) { 198 if (assign_wp == 2) {
199 /* copy the temp wp from secure memory back to normal memory */ 199 /* copy the temp wp from secure memory back to normal memory */
200 mpi_ptr_t tmp_wp = mpi_alloc_limb_space (wsize, 0); 200 mpi_ptr_t tmp_wp = mpi_alloc_limb_space (wsize, 0);
201 MPN_COPY (tmp_wp, wp, wsize); 201 MPN_COPY (tmp_wp, wp, wsize);
202 _gcry_mpi_free_limb_space (wp, 0); 202 _gcry_mpi_free_limb_space (wp, 0);
203 wp = tmp_wp; 203 wp = tmp_wp;
204 } 204 }
205 _gcry_mpi_assign_limb_space( w, wp, wsize ); 205 _gcry_mpi_assign_limb_space( w, wp, wsize );
206 } 206 }
207 w->nlimbs = wsize; 207 w->nlimbs = wsize;
208 w->sign = sign_product; 208 w->sign = sign_product;
209 if( tmp_limb ) 209 if( tmp_limb )
210 _gcry_mpi_free_limb_space (tmp_limb, tmp_limb_nlimbs); 210 _gcry_mpi_free_limb_space (tmp_limb, tmp_limb_nlimbs);
211} 211}
212 212
213 213
214void 214void
215gcry_mpi_mulm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m) 215gcry_mpi_mulm( gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, gcry_mpi_t m)
216{ 216{
217 gcry_mpi_mul(w, u, v); 217 gcry_mpi_mul(w, u, v);
218 _gcry_mpi_fdiv_r( w, w, m ); 218 _gcry_mpi_fdiv_r( w, w, m );
219} 219}
220 220
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-pow.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-pow.c
index 1eb4188..61a115f 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-pow.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-pow.c
@@ -1,302 +1,302 @@
1/* mpi-pow.c - MPI functions 1/* mpi-pow.c - MPI functions
2 * Copyright (C) 1994, 1996, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1994, 1996, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 * 19 *
20 * Note: This code is heavily based on the GNU MP Library. 20 * Note: This code is heavily based on the GNU MP Library.
21 * Actually it's the same code with only minor changes in the 21 * Actually it's the same code with only minor changes in the
22 * way the data is stored; this is to support the abstraction 22 * way the data is stored; this is to support the abstraction
23 * of an optional secure memory allocation which may be used 23 * of an optional secure memory allocation which may be used
24 * to avoid revealing of sensitive data due to paging etc. 24 * to avoid revealing of sensitive data due to paging etc.
25 */ 25 */
26 26
27#include <config.h> 27#include <config.h>
28#include <stdio.h> 28#include <stdio.h>
29#include <stdlib.h> 29#include <stdlib.h>
30#include <string.h> 30#include <string.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33#include <assert.h> 33#include <assert.h>
34 34
35 35
36/**************** 36/****************
37 * RES = BASE ^ EXPO mod MOD 37 * RES = BASE ^ EXPO mod MOD
38 */ 38 */
39void 39void
40gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t expo, gcry_mpi_t mod) 40gcry_mpi_powm( gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t expo, gcry_mpi_t mod)
41{ 41{
42 mpi_ptr_t rp, ep, mp, bp; 42 mpi_ptr_t rp, ep, mp, bp;
43 mpi_size_t esize, msize, bsize, rsize; 43 mpi_size_t esize, msize, bsize, rsize;
44 int esign, msign, bsign, rsign; 44 int esign, msign, bsign, rsign;
45 int esec, msec, bsec, rsec; 45 int esec, msec, bsec, rsec;
46 mpi_size_t size; 46 mpi_size_t size;
47 int mod_shift_cnt; 47 int mod_shift_cnt;
48 int negative_result; 48 int negative_result;
49 mpi_ptr_t mp_marker=NULL, bp_marker=NULL, ep_marker=NULL; 49 mpi_ptr_t mp_marker=NULL, bp_marker=NULL, ep_marker=NULL;
50 mpi_ptr_t xp_marker=NULL; 50 mpi_ptr_t xp_marker=NULL;
51 unsigned int mp_nlimbs = 0, bp_nlimbs = 0, ep_nlimbs = 0; 51 unsigned int mp_nlimbs = 0, bp_nlimbs = 0, ep_nlimbs = 0;
52 unsigned int xp_nlimbs = 0; 52 unsigned int xp_nlimbs = 0;
53 int assign_rp = 0; 53 int assign_rp = 0;
54 mpi_ptr_t tspace = NULL; 54 mpi_ptr_t tspace = NULL;
55 mpi_size_t tsize=0; /* to avoid compiler warning */ 55 mpi_size_t tsize=0; /* to avoid compiler warning */
56 /* fixme: we should check that the warning is void*/ 56 /* fixme: we should check that the warning is void*/
57 57
58 esize = expo->nlimbs; 58 esize = expo->nlimbs;
59 msize = mod->nlimbs; 59 msize = mod->nlimbs;
60 size = 2 * msize; 60 size = 2 * msize;
61 esign = expo->sign; 61 esign = expo->sign;
62 msign = mod->sign; 62 msign = mod->sign;
63 63
64 esec = mpi_is_secure(expo); 64 esec = mpi_is_secure(expo);
65 msec = mpi_is_secure(mod); 65 msec = mpi_is_secure(mod);
66 bsec = mpi_is_secure(base); 66 bsec = mpi_is_secure(base);
67 rsec = mpi_is_secure(res); 67 rsec = mpi_is_secure(res);
68 68
69 rp = res->d; 69 rp = res->d;
70 ep = expo->d; 70 ep = expo->d;
71 71
72 if( !msize ) 72 if( !msize )
73 msize = 1 / msize; /* provoke a signal */ 73 msize = 1 / msize; /* provoke a signal */
74 74
75 if( !esize ) { 75 if( !esize ) {
76 /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0 76 /* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0
77 * depending on if MOD equals 1. */ 77 * depending on if MOD equals 1. */
78 rp[0] = 1; 78 rp[0] = 1;
79 res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1; 79 res->nlimbs = (msize == 1 && mod->d[0] == 1) ? 0 : 1;
80 res->sign = 0; 80 res->sign = 0;
81 goto leave; 81 goto leave;
82 } 82 }
83 83
84 /* Normalize MOD (i.e. make its most significant bit set) as required by 84 /* Normalize MOD (i.e. make its most significant bit set) as required by
85 * mpn_divrem. This will make the intermediate values in the calculation 85 * mpn_divrem. This will make the intermediate values in the calculation
86 * slightly larger, but the correct result is obtained after a final 86 * slightly larger, but the correct result is obtained after a final
87 * reduction using the original MOD value. */ 87 * reduction using the original MOD value. */
88 mp_nlimbs = msec? msize:0; 88 mp_nlimbs = msec? msize:0;
89 mp = mp_marker = mpi_alloc_limb_space(msize, msec); 89 mp = mp_marker = mpi_alloc_limb_space(msize, msec);
90 count_leading_zeros( mod_shift_cnt, mod->d[msize-1] ); 90 count_leading_zeros( mod_shift_cnt, mod->d[msize-1] );
91 if( mod_shift_cnt ) 91 if( mod_shift_cnt )
92 _gcry_mpih_lshift( mp, mod->d, msize, mod_shift_cnt ); 92 _gcry_mpih_lshift( mp, mod->d, msize, mod_shift_cnt );
93 else 93 else
94 MPN_COPY( mp, mod->d, msize ); 94 MPN_COPY( mp, mod->d, msize );
95 95
96 bsize = base->nlimbs; 96 bsize = base->nlimbs;
97 bsign = base->sign; 97 bsign = base->sign;
98 if( bsize > msize ) { /* The base is larger than the module. Reduce it. */ 98 if( bsize > msize ) { /* The base is larger than the module. Reduce it. */
99 /* Allocate (BSIZE + 1) with space for remainder and quotient. 99 /* Allocate (BSIZE + 1) with space for remainder and quotient.
100 * (The quotient is (bsize - msize + 1) limbs.) */ 100 * (The quotient is (bsize - msize + 1) limbs.) */
101 bp_nlimbs = bsec ? (bsize + 1):0; 101 bp_nlimbs = bsec ? (bsize + 1):0;
102 bp = bp_marker = mpi_alloc_limb_space( bsize + 1, bsec ); 102 bp = bp_marker = mpi_alloc_limb_space( bsize + 1, bsec );
103 MPN_COPY( bp, base->d, bsize ); 103 MPN_COPY( bp, base->d, bsize );
104 /* We don't care about the quotient, store it above the remainder, 104 /* We don't care about the quotient, store it above the remainder,
105 * at BP + MSIZE. */ 105 * at BP + MSIZE. */
106 _gcry_mpih_divrem( bp + msize, 0, bp, bsize, mp, msize ); 106 _gcry_mpih_divrem( bp + msize, 0, bp, bsize, mp, msize );
107 bsize = msize; 107 bsize = msize;
108 /* Canonicalize the base, since we are going to multiply with it 108 /* Canonicalize the base, since we are going to multiply with it
109 * quite a few times. */ 109 * quite a few times. */
110 MPN_NORMALIZE( bp, bsize ); 110 MPN_NORMALIZE( bp, bsize );
111 } 111 }
112 else 112 else
113 bp = base->d; 113 bp = base->d;
114 114
115 if( !bsize ) { 115 if( !bsize ) {
116 res->nlimbs = 0; 116 res->nlimbs = 0;
117 res->sign = 0; 117 res->sign = 0;
118 goto leave; 118 goto leave;
119 } 119 }
120 120
121 if( res->alloced < size ) { 121 if( res->alloced < size ) {
122 /* We have to allocate more space for RES. If any of the input 122 /* We have to allocate more space for RES. If any of the input
123 * parameters are identical to RES, defer deallocation of the old 123 * parameters are identical to RES, defer deallocation of the old
124 * space. */ 124 * space. */
125 if( rp == ep || rp == mp || rp == bp ) { 125 if( rp == ep || rp == mp || rp == bp ) {
126 rp = mpi_alloc_limb_space( size, rsec ); 126 rp = mpi_alloc_limb_space( size, rsec );
127 assign_rp = 1; 127 assign_rp = 1;
128 } 128 }
129 else { 129 else {
130 mpi_resize( res, size ); 130 mpi_resize( res, size );
131 rp = res->d; 131 rp = res->d;
132 } 132 }
133 } 133 }
134 else { /* Make BASE, EXPO and MOD not overlap with RES. */ 134 else { /* Make BASE, EXPO and MOD not overlap with RES. */
135 if( rp == bp ) { 135 if( rp == bp ) {
136 /* RES and BASE are identical. Allocate temp. space for BASE. */ 136 /* RES and BASE are identical. Allocate temp. space for BASE. */
137 assert( !bp_marker ); 137 assert( !bp_marker );
138 bp_nlimbs = bsec? bsize:0; 138 bp_nlimbs = bsec? bsize:0;
139 bp = bp_marker = mpi_alloc_limb_space( bsize, bsec ); 139 bp = bp_marker = mpi_alloc_limb_space( bsize, bsec );
140 MPN_COPY(bp, rp, bsize); 140 MPN_COPY(bp, rp, bsize);
141 } 141 }
142 if( rp == ep ) { 142 if( rp == ep ) {
143 /* RES and EXPO are identical. Allocate temp. space for EXPO. */ 143 /* RES and EXPO are identical. Allocate temp. space for EXPO. */
144 ep_nlimbs = esec? esize:0; 144 ep_nlimbs = esec? esize:0;
145 ep = ep_marker = mpi_alloc_limb_space( esize, esec ); 145 ep = ep_marker = mpi_alloc_limb_space( esize, esec );
146 MPN_COPY(ep, rp, esize); 146 MPN_COPY(ep, rp, esize);
147 } 147 }
148 if( rp == mp ) { 148 if( rp == mp ) {
149 /* RES and MOD are identical. Allocate temporary space for MOD.*/ 149 /* RES and MOD are identical. Allocate temporary space for MOD.*/
150 assert( !mp_marker ); 150 assert( !mp_marker );
151 mp_nlimbs = msec?msize:0; 151 mp_nlimbs = msec?msize:0;
152 mp = mp_marker = mpi_alloc_limb_space( msize, msec ); 152 mp = mp_marker = mpi_alloc_limb_space( msize, msec );
153 MPN_COPY(mp, rp, msize); 153 MPN_COPY(mp, rp, msize);
154 } 154 }
155 } 155 }
156 156
157 MPN_COPY( rp, bp, bsize ); 157 MPN_COPY( rp, bp, bsize );
158 rsize = bsize; 158 rsize = bsize;
159 rsign = bsign; 159 rsign = bsign;
160 160
161 { 161 {
162 mpi_size_t i; 162 mpi_size_t i;
163 mpi_ptr_t xp; 163 mpi_ptr_t xp;
164 int c; 164 int c;
165 mpi_limb_t e; 165 mpi_limb_t e;
166 mpi_limb_t carry_limb; 166 mpi_limb_t carry_limb;
167 struct karatsuba_ctx karactx; 167 struct karatsuba_ctx karactx;
168 168
169 xp_nlimbs = msec? (2 * (msize + 1)):0; 169 xp_nlimbs = msec? (2 * (msize + 1)):0;
170 xp = xp_marker = mpi_alloc_limb_space( 2 * (msize + 1), msec ); 170 xp = xp_marker = mpi_alloc_limb_space( 2 * (msize + 1), msec );
171 171
172 memset( &karactx, 0, sizeof karactx ); 172 memset( &karactx, 0, sizeof karactx );
173 negative_result = (ep[0] & 1) && base->sign; 173 negative_result = (ep[0] & 1) && base->sign;
174 174
175 i = esize - 1; 175 i = esize - 1;
176 e = ep[i]; 176 e = ep[i];
177 count_leading_zeros (c, e); 177 count_leading_zeros (c, e);
178 e = (e << c) << 1; /* shift the expo bits to the left, lose msb */ 178 e = (e << c) << 1; /* shift the expo bits to the left, lose msb */
179 c = BITS_PER_MPI_LIMB - 1 - c; 179 c = BITS_PER_MPI_LIMB - 1 - c;
180 180
181 /* Main loop. 181 /* Main loop.
182 * 182 *
183 * Make the result be pointed to alternately by XP and RP. This 183 * Make the result be pointed to alternately by XP and RP. This
184 * helps us avoid block copying, which would otherwise be necessary 184 * helps us avoid block copying, which would otherwise be necessary
185 * with the overlap restrictions of _gcry_mpih_divmod. With 50% probability 185 * with the overlap restrictions of _gcry_mpih_divmod. With 50% probability
186 * the result after this loop will be in the area originally pointed 186 * the result after this loop will be in the area originally pointed
187 * by RP (==RES->d), and with 50% probability in the area originally 187 * by RP (==RES->d), and with 50% probability in the area originally
188 * pointed to by XP. 188 * pointed to by XP.
189 */ 189 */
190 190
191 for(;;) { 191 for(;;) {
192 while( c ) { 192 while( c ) {
193 mpi_ptr_t tp; 193 mpi_ptr_t tp;
194 mpi_size_t xsize; 194 mpi_size_t xsize;
195 195
196 /*mpih_mul_n(xp, rp, rp, rsize);*/ 196 /*mpih_mul_n(xp, rp, rp, rsize);*/
197 if( rsize < KARATSUBA_THRESHOLD ) 197 if( rsize < KARATSUBA_THRESHOLD )
198 _gcry_mpih_sqr_n_basecase( xp, rp, rsize ); 198 _gcry_mpih_sqr_n_basecase( xp, rp, rsize );
199 else { 199 else {
200 if( !tspace ) { 200 if( !tspace ) {
201 tsize = 2 * rsize; 201 tsize = 2 * rsize;
202 tspace = mpi_alloc_limb_space( tsize, 0 ); 202 tspace = mpi_alloc_limb_space( tsize, 0 );
203 } 203 }
204 else if( tsize < (2*rsize) ) { 204 else if( tsize < (2*rsize) ) {
205 _gcry_mpi_free_limb_space (tspace, 0); 205 _gcry_mpi_free_limb_space (tspace, 0);
206 tsize = 2 * rsize; 206 tsize = 2 * rsize;
207 tspace = mpi_alloc_limb_space( tsize, 0 ); 207 tspace = mpi_alloc_limb_space( tsize, 0 );
208 } 208 }
209 _gcry_mpih_sqr_n( xp, rp, rsize, tspace ); 209 _gcry_mpih_sqr_n( xp, rp, rsize, tspace );
210 } 210 }
211 211
212 xsize = 2 * rsize; 212 xsize = 2 * rsize;
213 if( xsize > msize ) { 213 if( xsize > msize ) {
214 _gcry_mpih_divrem(xp + msize, 0, xp, xsize, mp, msize); 214 _gcry_mpih_divrem(xp + msize, 0, xp, xsize, mp, msize);
215 xsize = msize; 215 xsize = msize;
216 } 216 }
217 217
218 tp = rp; rp = xp; xp = tp; 218 tp = rp; rp = xp; xp = tp;
219 rsize = xsize; 219 rsize = xsize;
220 220
221 if( (mpi_limb_signed_t)e < 0 ) { 221 if( (mpi_limb_signed_t)e < 0 ) {
222 /*mpih_mul( xp, rp, rsize, bp, bsize );*/ 222 /*mpih_mul( xp, rp, rsize, bp, bsize );*/
223 if( bsize < KARATSUBA_THRESHOLD ) { 223 if( bsize < KARATSUBA_THRESHOLD ) {
224 _gcry_mpih_mul( xp, rp, rsize, bp, bsize ); 224 _gcry_mpih_mul( xp, rp, rsize, bp, bsize );
225 } 225 }
226 else { 226 else {
227 _gcry_mpih_mul_karatsuba_case( 227 _gcry_mpih_mul_karatsuba_case(
228 xp, rp, rsize, bp, bsize, &karactx ); 228 xp, rp, rsize, bp, bsize, &karactx );
229 } 229 }
230 230
231 xsize = rsize + bsize; 231 xsize = rsize + bsize;
232 if( xsize > msize ) { 232 if( xsize > msize ) {
233 _gcry_mpih_divrem(xp + msize, 0, xp, xsize, mp, msize); 233 _gcry_mpih_divrem(xp + msize, 0, xp, xsize, mp, msize);
234 xsize = msize; 234 xsize = msize;
235 } 235 }
236 236
237 tp = rp; rp = xp; xp = tp; 237 tp = rp; rp = xp; xp = tp;
238 rsize = xsize; 238 rsize = xsize;
239 } 239 }
240 e <<= 1; 240 e <<= 1;
241 c--; 241 c--;
242 } 242 }
243 243
244 i--; 244 i--;
245 if( i < 0 ) 245 if( i < 0 )
246 break; 246 break;
247 e = ep[i]; 247 e = ep[i];
248 c = BITS_PER_MPI_LIMB; 248 c = BITS_PER_MPI_LIMB;
249 } 249 }
250 250
251 /* We shifted MOD, the modulo reduction argument, left MOD_SHIFT_CNT 251 /* We shifted MOD, the modulo reduction argument, left MOD_SHIFT_CNT
252 * steps. Adjust the result by reducing it with the original MOD. 252 * steps. Adjust the result by reducing it with the original MOD.
253 * 253 *
254 * Also make sure the result is put in RES->d (where it already 254 * Also make sure the result is put in RES->d (where it already
255 * might be, see above). 255 * might be, see above).
256 */ 256 */
257 if( mod_shift_cnt ) { 257 if( mod_shift_cnt ) {
258 carry_limb = _gcry_mpih_lshift( res->d, rp, rsize, mod_shift_cnt); 258 carry_limb = _gcry_mpih_lshift( res->d, rp, rsize, mod_shift_cnt);
259 rp = res->d; 259 rp = res->d;
260 if( carry_limb ) { 260 if( carry_limb ) {
261 rp[rsize] = carry_limb; 261 rp[rsize] = carry_limb;
262 rsize++; 262 rsize++;
263 } 263 }
264 } 264 }
265 else { 265 else {
266 MPN_COPY( res->d, rp, rsize); 266 MPN_COPY( res->d, rp, rsize);
267 rp = res->d; 267 rp = res->d;
268 } 268 }
269 269
270 if( rsize >= msize ) { 270 if( rsize >= msize ) {
271 _gcry_mpih_divrem(rp + msize, 0, rp, rsize, mp, msize); 271 _gcry_mpih_divrem(rp + msize, 0, rp, rsize, mp, msize);
272 rsize = msize; 272 rsize = msize;
273 } 273 }
274 274
275 /* Remove any leading zero words from the result. */ 275 /* Remove any leading zero words from the result. */
276 if( mod_shift_cnt ) 276 if( mod_shift_cnt )
277 _gcry_mpih_rshift( rp, rp, rsize, mod_shift_cnt); 277 _gcry_mpih_rshift( rp, rp, rsize, mod_shift_cnt);
278 MPN_NORMALIZE (rp, rsize); 278 MPN_NORMALIZE (rp, rsize);
279 279
280 _gcry_mpih_release_karatsuba_ctx( &karactx ); 280 _gcry_mpih_release_karatsuba_ctx( &karactx );
281 } 281 }
282 282
283 if( negative_result && rsize ) { 283 if( negative_result && rsize ) {
284 if( mod_shift_cnt ) 284 if( mod_shift_cnt )
285 _gcry_mpih_rshift( mp, mp, msize, mod_shift_cnt); 285 _gcry_mpih_rshift( mp, mp, msize, mod_shift_cnt);
286 _gcry_mpih_sub( rp, mp, msize, rp, rsize); 286 _gcry_mpih_sub( rp, mp, msize, rp, rsize);
287 rsize = msize; 287 rsize = msize;
288 rsign = msign; 288 rsign = msign;
289 MPN_NORMALIZE(rp, rsize); 289 MPN_NORMALIZE(rp, rsize);
290 } 290 }
291 res->nlimbs = rsize; 291 res->nlimbs = rsize;
292 res->sign = rsign; 292 res->sign = rsign;
293 293
294 leave: 294 leave:
295 if( assign_rp ) _gcry_mpi_assign_limb_space( res, rp, size ); 295 if( assign_rp ) _gcry_mpi_assign_limb_space( res, rp, size );
296 if( mp_marker ) _gcry_mpi_free_limb_space( mp_marker, mp_nlimbs ); 296 if( mp_marker ) _gcry_mpi_free_limb_space( mp_marker, mp_nlimbs );
297 if( bp_marker ) _gcry_mpi_free_limb_space( bp_marker, bp_nlimbs ); 297 if( bp_marker ) _gcry_mpi_free_limb_space( bp_marker, bp_nlimbs );
298 if( ep_marker ) _gcry_mpi_free_limb_space( ep_marker, ep_nlimbs ); 298 if( ep_marker ) _gcry_mpi_free_limb_space( ep_marker, ep_nlimbs );
299 if( xp_marker ) _gcry_mpi_free_limb_space( xp_marker, xp_nlimbs ); 299 if( xp_marker ) _gcry_mpi_free_limb_space( xp_marker, xp_nlimbs );
300 if( tspace ) _gcry_mpi_free_limb_space( tspace, 0 ); 300 if( tspace ) _gcry_mpi_free_limb_space( tspace, 0 );
301} 301}
302 302
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-scan.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-scan.c
index 3ee09d2..90699cd 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-scan.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpi-scan.c
@@ -1,132 +1,132 @@
1/* mpi-scan.c - MPI functions 1/* mpi-scan.c - MPI functions
2 * Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include "mpi-internal.h" 24#include "mpi-internal.h"
25#include "longlong.h" 25#include "longlong.h"
26 26
27/**************** 27/****************
28 * Scan through an mpi and return byte for byte. a -1 is returned to indicate 28 * Scan through an mpi and return byte for byte. a -1 is returned to indicate
29 * the end of the mpi. Scanning is done from the lsb to the msb, returned 29 * the end of the mpi. Scanning is done from the lsb to the msb, returned
30 * values are in the range of 0 .. 255. 30 * values are in the range of 0 .. 255.
31 * 31 *
32 * FIXME: This code is VERY ugly! 32 * FIXME: This code is VERY ugly!
33 */ 33 */
34int 34int
35_gcry_mpi_getbyte( gcry_mpi_t a, unsigned idx ) 35_gcry_mpi_getbyte( gcry_mpi_t a, unsigned idx )
36{ 36{
37 int i, j; 37 int i, j;
38 unsigned n; 38 unsigned n;
39 mpi_ptr_t ap; 39 mpi_ptr_t ap;
40 mpi_limb_t limb; 40 mpi_limb_t limb;
41 41
42 ap = a->d; 42 ap = a->d;
43 for(n=0,i=0; i < a->nlimbs; i++ ) { 43 for(n=0,i=0; i < a->nlimbs; i++ ) {
44 limb = ap[i]; 44 limb = ap[i];
45 for( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ ) 45 for( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ )
46 if( n == idx ) 46 if( n == idx )
47 return (limb >> j*8) & 0xff; 47 return (limb >> j*8) & 0xff;
48 } 48 }
49 return -1; 49 return -1;
50} 50}
51 51
52 52
53/**************** 53/****************
54 * Put a value at position IDX into A. idx counts from lsb to msb 54 * Put a value at position IDX into A. idx counts from lsb to msb
55 */ 55 */
56void 56void
57_gcry_mpi_putbyte( gcry_mpi_t a, unsigned idx, int xc ) 57_gcry_mpi_putbyte( gcry_mpi_t a, unsigned idx, int xc )
58{ 58{
59 int i, j; 59 int i, j;
60 unsigned n; 60 unsigned n;
61 mpi_ptr_t ap; 61 mpi_ptr_t ap;
62 mpi_limb_t limb, c; 62 mpi_limb_t limb, c;
63 63
64 c = xc & 0xff; 64 c = xc & 0xff;
65 ap = a->d; 65 ap = a->d;
66 for(n=0,i=0; i < a->alloced; i++ ) { 66 for(n=0,i=0; i < a->alloced; i++ ) {
67 limb = ap[i]; 67 limb = ap[i];
68 for( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ ) 68 for( j=0; j < BYTES_PER_MPI_LIMB; j++, n++ )
69 if( n == idx ) { 69 if( n == idx ) {
70 #if BYTES_PER_MPI_LIMB == 4 70 #if BYTES_PER_MPI_LIMB == 4
71 if( j == 0 ) 71 if( j == 0 )
72 limb = (limb & 0xffffff00) | c; 72 limb = (limb & 0xffffff00) | c;
73 else if( j == 1 ) 73 else if( j == 1 )
74 limb = (limb & 0xffff00ff) | (c<<8); 74 limb = (limb & 0xffff00ff) | (c<<8);
75 else if( j == 2 ) 75 else if( j == 2 )
76 limb = (limb & 0xff00ffff) | (c<<16); 76 limb = (limb & 0xff00ffff) | (c<<16);
77 else 77 else
78 limb = (limb & 0x00ffffff) | (c<<24); 78 limb = (limb & 0x00ffffff) | (c<<24);
79 #elif BYTES_PER_MPI_LIMB == 8 79 #elif BYTES_PER_MPI_LIMB == 8
80 if( j == 0 ) 80 if( j == 0 )
81 limb = (limb & 0xffffffffffffff00) | c; 81 limb = (limb & 0xffffffffffffff00) | c;
82 else if( j == 1 ) 82 else if( j == 1 )
83 limb = (limb & 0xffffffffffff00ff) | (c<<8); 83 limb = (limb & 0xffffffffffff00ff) | (c<<8);
84 else if( j == 2 ) 84 else if( j == 2 )
85 limb = (limb & 0xffffffffff00ffff) | (c<<16); 85 limb = (limb & 0xffffffffff00ffff) | (c<<16);
86 else if( j == 3 ) 86 else if( j == 3 )
87 limb = (limb & 0xffffffff00ffffff) | (c<<24); 87 limb = (limb & 0xffffffff00ffffff) | (c<<24);
88 else if( j == 4 ) 88 else if( j == 4 )
89 limb = (limb & 0xffffff00ffffffff) | (c<<32); 89 limb = (limb & 0xffffff00ffffffff) | (c<<32);
90 else if( j == 5 ) 90 else if( j == 5 )
91 limb = (limb & 0xffff00ffffffffff) | (c<<40); 91 limb = (limb & 0xffff00ffffffffff) | (c<<40);
92 else if( j == 6 ) 92 else if( j == 6 )
93 limb = (limb & 0xff00ffffffffffff) | (c<<48); 93 limb = (limb & 0xff00ffffffffffff) | (c<<48);
94 else 94 else
95 limb = (limb & 0x00ffffffffffffff) | (c<<56); 95 limb = (limb & 0x00ffffffffffffff) | (c<<56);
96 #else 96 #else
97 #error please enhance this function, its ugly - i know. 97 #error please enhance this function, its ugly - i know.
98 #endif 98 #endif
99 if( a->nlimbs <= i ) 99 if( a->nlimbs <= i )
100 a->nlimbs = i+1; 100 a->nlimbs = i+1;
101 ap[i] = limb; 101 ap[i] = limb;
102 return; 102 return;
103 } 103 }
104 } 104 }
105 abort(); /* index out of range */ 105 abort(); /* index out of range */
106} 106}
107 107
108 108
109/**************** 109/****************
110 * Count the number of zerobits at the low end of A 110 * Count the number of zerobits at the low end of A
111 */ 111 */
112unsigned 112unsigned
113_gcry_mpi_trailing_zeros( gcry_mpi_t a ) 113_gcry_mpi_trailing_zeros( gcry_mpi_t a )
114{ 114{
115 unsigned n, count = 0; 115 unsigned n, count = 0;
116 116
117 for(n=0; n < a->nlimbs; n++ ) { 117 for(n=0; n < a->nlimbs; n++ ) {
118 if( a->d[n] ) { 118 if( a->d[n] ) {
119 unsigned nn; 119 unsigned nn;
120 mpi_limb_t alimb = a->d[n]; 120 mpi_limb_t alimb = a->d[n];
121 121
122 count_trailing_zeros( nn, alimb ); 122 count_trailing_zeros( nn, alimb );
123 count += nn; 123 count += nn;
124 break; 124 break;
125 } 125 }
126 count += BITS_PER_MPI_LIMB; 126 count += BITS_PER_MPI_LIMB;
127 } 127 }
128 return count; 128 return count;
129 129
130} 130}
131 131
132 132
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpicoder.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpicoder.c
index ba0255c..4a90850 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpicoder.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpicoder.c
@@ -1,650 +1,650 @@
1/* mpicoder.c - Coder for the external representation of MPIs 1/* mpicoder.c - Coder for the external representation of MPIs
2 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2 * Copyright (C) 1998, 1999, 2000, 2001, 2002,
3 * 2003 Free Software Foundation, Inc. 3 * 2003 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */ 20 */
21 21
22#include <config.h> 22#include <config.h>
23#include <stdio.h> 23#include <stdio.h>
24#include <string.h> 24#include <string.h>
25#include <stdlib.h> 25#include <stdlib.h>
26#include <assert.h> 26#include <assert.h>
27 27
28#include "mpi-internal.h" 28#include "mpi-internal.h"
29#include "g10lib.h" 29#include "g10lib.h"
30 30
31#define MAX_EXTERN_MPI_BITS 16384 31#define MAX_EXTERN_MPI_BITS 16384
32 32
33 33
34static gcry_mpi_t 34static gcry_mpi_t
35mpi_read_from_buffer (const unsigned char *buffer, unsigned int *ret_nread, 35mpi_read_from_buffer (const unsigned char *buffer, unsigned int *ret_nread,
36 int secure) 36 int secure)
37{ 37{
38 int i, j; 38 int i, j;
39 unsigned int nbits, nbytes, nlimbs, nread=0; 39 unsigned int nbits, nbytes, nlimbs, nread=0;
40 mpi_limb_t a; 40 mpi_limb_t a;
41 gcry_mpi_t val = MPI_NULL; 41 gcry_mpi_t val = MPI_NULL;
42 42
43 if (*ret_nread < 2) 43 if (*ret_nread < 2)
44 goto leave; 44 goto leave;
45 nbits = buffer[0] << 8 | buffer[1]; 45 nbits = buffer[0] << 8 | buffer[1];
46 if (nbits > MAX_EXTERN_MPI_BITS) 46 if (nbits > MAX_EXTERN_MPI_BITS)
47 { 47 {
48 log_error ("mpi too large (%u bits)\n", nbits); 48 log_error ("mpi too large (%u bits)\n", nbits);
49 goto leave; 49 goto leave;
50 } 50 }
51 else if (!nbits) 51 else if (!nbits)
52 { 52 {
53 log_error ("an mpi of size 0 is not allowed\n"); 53 log_error ("an mpi of size 0 is not allowed\n");
54 goto leave; 54 goto leave;
55 } 55 }
56 buffer += 2; 56 buffer += 2;
57 nread = 2; 57 nread = 2;
58 58
59 nbytes = (nbits+7) / 8; 59 nbytes = (nbits+7) / 8;
60 nlimbs = (nbytes+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB; 60 nlimbs = (nbytes+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB;
61 val = secure? mpi_alloc_secure( nlimbs ) 61 val = secure? mpi_alloc_secure( nlimbs )
62 : mpi_alloc( nlimbs ); 62 : mpi_alloc( nlimbs );
63 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; 63 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
64 i %= BYTES_PER_MPI_LIMB; 64 i %= BYTES_PER_MPI_LIMB;
65 j= val->nlimbs = nlimbs; 65 j= val->nlimbs = nlimbs;
66 val->sign = 0; 66 val->sign = 0;
67 for( ; j > 0; j-- ) 67 for( ; j > 0; j-- )
68 { 68 {
69 a = 0; 69 a = 0;
70 for (; i < BYTES_PER_MPI_LIMB; i++ ) 70 for (; i < BYTES_PER_MPI_LIMB; i++ )
71 { 71 {
72 if ( ++nread > *ret_nread ) 72 if ( ++nread > *ret_nread )
73 log_bug ("mpi larger than buffer"); 73 log_bug ("mpi larger than buffer");
74 a <<= 8; 74 a <<= 8;
75 a |= *buffer++; 75 a |= *buffer++;
76 } 76 }
77 i = 0; 77 i = 0;
78 val->d[j-1] = a; 78 val->d[j-1] = a;
79 } 79 }
80 80
81 leave: 81 leave:
82 *ret_nread = nread; 82 *ret_nread = nread;
83 return val; 83 return val;
84} 84}
85 85
86 86
87/**************** 87/****************
88 * Make an mpi from a hex character string. 88 * Make an mpi from a hex character string.
89 */ 89 */
90static int 90static int
91mpi_fromstr(gcry_mpi_t val, const char *str) 91mpi_fromstr(gcry_mpi_t val, const char *str)
92{ 92{
93 int sign=0, prepend_zero=0, i, j, c, c1, c2; 93 int sign=0, prepend_zero=0, i, j, c, c1, c2;
94 unsigned nbits, nbytes, nlimbs; 94 unsigned nbits, nbytes, nlimbs;
95 mpi_limb_t a; 95 mpi_limb_t a;
96 96
97 if( *str == '-' ) { 97 if( *str == '-' ) {
98 sign = 1; 98 sign = 1;
99 str++; 99 str++;
100 } 100 }
101 101
102 /* skip optional hex prefix */ 102 /* skip optional hex prefix */
103 if ( *str == '0' && str[1] == 'x' ) { 103 if ( *str == '0' && str[1] == 'x' ) {
104 str += 2; 104 str += 2;
105 } 105 }
106 106
107 nbits = strlen(str)*4; 107 nbits = strlen(str)*4;
108 if( nbits % 8 ) 108 if( nbits % 8 )
109 prepend_zero = 1; 109 prepend_zero = 1;
110 nbytes = (nbits+7) / 8; 110 nbytes = (nbits+7) / 8;
111 nlimbs = (nbytes+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB; 111 nlimbs = (nbytes+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB;
112 if( val->alloced < nlimbs ) 112 if( val->alloced < nlimbs )
113 mpi_resize(val, nlimbs ); 113 mpi_resize(val, nlimbs );
114 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; 114 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
115 i %= BYTES_PER_MPI_LIMB; 115 i %= BYTES_PER_MPI_LIMB;
116 j= val->nlimbs = nlimbs; 116 j= val->nlimbs = nlimbs;
117 val->sign = sign; 117 val->sign = sign;
118 for( ; j > 0; j-- ) { 118 for( ; j > 0; j-- ) {
119 a = 0; 119 a = 0;
120 for(; i < BYTES_PER_MPI_LIMB; i++ ) { 120 for(; i < BYTES_PER_MPI_LIMB; i++ ) {
121 if( prepend_zero ) { 121 if( prepend_zero ) {
122 c1 = '0'; 122 c1 = '0';
123 prepend_zero = 0; 123 prepend_zero = 0;
124 } 124 }
125 else 125 else
126 c1 = *str++; 126 c1 = *str++;
127 assert(c1); 127 assert(c1);
128 c2 = *str++; 128 c2 = *str++;
129 assert(c2); 129 assert(c2);
130 if( c1 >= '0' && c1 <= '9' ) 130 if( c1 >= '0' && c1 <= '9' )
131 c = c1 - '0'; 131 c = c1 - '0';
132 else if( c1 >= 'a' && c1 <= 'f' ) 132 else if( c1 >= 'a' && c1 <= 'f' )
133 c = c1 - 'a' + 10; 133 c = c1 - 'a' + 10;
134 else if( c1 >= 'A' && c1 <= 'F' ) 134 else if( c1 >= 'A' && c1 <= 'F' )
135 c = c1 - 'A' + 10; 135 c = c1 - 'A' + 10;
136 else { 136 else {
137 mpi_clear(val); 137 mpi_clear(val);
138 return 1; 138 return 1;
139 } 139 }
140 c <<= 4; 140 c <<= 4;
141 if( c2 >= '0' && c2 <= '9' ) 141 if( c2 >= '0' && c2 <= '9' )
142 c |= c2 - '0'; 142 c |= c2 - '0';
143 else if( c2 >= 'a' && c2 <= 'f' ) 143 else if( c2 >= 'a' && c2 <= 'f' )
144 c |= c2 - 'a' + 10; 144 c |= c2 - 'a' + 10;
145 else if( c2 >= 'A' && c2 <= 'F' ) 145 else if( c2 >= 'A' && c2 <= 'F' )
146 c |= c2 - 'A' + 10; 146 c |= c2 - 'A' + 10;
147 else { 147 else {
148 mpi_clear(val); 148 mpi_clear(val);
149 return 1; 149 return 1;
150 } 150 }
151 a <<= 8; 151 a <<= 8;
152 a |= c; 152 a |= c;
153 } 153 }
154 i = 0; 154 i = 0;
155 val->d[j-1] = a; 155 val->d[j-1] = a;
156 } 156 }
157 157
158 return 0; 158 return 0;
159} 159}
160 160
161 161
162/* Dump the value of A in a format suitable for debugging to 162/* Dump the value of A in a format suitable for debugging to
163 Libgcrypt's logging stream. Note that one leading space but no 163 Libgcrypt's logging stream. Note that one leading space but no
164 trailing space or linefeed will be printed. It is okay to pass 164 trailing space or linefeed will be printed. It is okay to pass
165 NULL for A. */ 165 NULL for A. */
166void 166void
167gcry_mpi_dump (const gcry_mpi_t a) 167gcry_mpi_dump (const gcry_mpi_t a)
168{ 168{
169 int i; 169 int i;
170 170
171 log_printf (" "); 171 log_printf (" ");
172 if (!a) 172 if (!a)
173 log_printf ("[MPI_NULL]"); 173 log_printf ("[MPI_NULL]");
174 else 174 else
175 { 175 {
176 if (a->sign) 176 if (a->sign)
177 log_printf ( "-"); 177 log_printf ( "-");
178#if BYTES_PER_MPI_LIMB == 2 178#if BYTES_PER_MPI_LIMB == 2
179# define X "4" 179# define X "4"
180#elif BYTES_PER_MPI_LIMB == 4 180#elif BYTES_PER_MPI_LIMB == 4
181# define X "8" 181# define X "8"
182#elif BYTES_PER_MPI_LIMB == 8 182#elif BYTES_PER_MPI_LIMB == 8
183# define X "16" 183# define X "16"
184#elif BYTES_PER_MPI_LIMB == 16 184#elif BYTES_PER_MPI_LIMB == 16
185# define X "32" 185# define X "32"
186#else 186#else
187# error please define the format here 187# error please define the format here
188#endif 188#endif
189 for (i=a->nlimbs; i > 0 ; i-- ) 189 for (i=a->nlimbs; i > 0 ; i-- )
190 { 190 {
191 log_printf (i != a->nlimbs? "%0" X "lX":"%lX", (ulong)a->d[i-1]); 191 log_printf (i != a->nlimbs? "%0" X "lX":"%lX", (ulong)a->d[i-1]);
192 } 192 }
193#undef X 193#undef X
194 if (!a->nlimbs) 194 if (!a->nlimbs)
195 log_printf ("0"); 195 log_printf ("0");
196 } 196 }
197} 197}
198 198
199/* Convience function used internally. */ 199/* Convience function used internally. */
200void 200void
201_gcry_log_mpidump (const char *text, gcry_mpi_t a) 201_gcry_log_mpidump (const char *text, gcry_mpi_t a)
202{ 202{
203 log_printf ("%s:", text); 203 log_printf ("%s:", text);
204 gcry_mpi_dump (a); 204 gcry_mpi_dump (a);
205 log_printf ("\n"); 205 log_printf ("\n");
206} 206}
207 207
208 208
209/**************** 209/****************
210 * Return an m_alloced buffer with the MPI (msb first). 210 * Return an m_alloced buffer with the MPI (msb first).
211 * NBYTES receives the length of this buffer. Caller must free the 211 * NBYTES receives the length of this buffer. Caller must free the
212 * return string (This function does return a 0 byte buffer with NBYTES 212 * return string (This function does return a 0 byte buffer with NBYTES
213 * set to zero if the value of A is zero. If sign is not NULL, it will 213 * set to zero if the value of A is zero. If sign is not NULL, it will
214 * be set to the sign of the A. 214 * be set to the sign of the A.
215 */ 215 */
216static byte * 216static byte *
217do_get_buffer( gcry_mpi_t a, unsigned *nbytes, int *sign, int force_secure ) 217do_get_buffer( gcry_mpi_t a, unsigned *nbytes, int *sign, int force_secure )
218{ 218{
219 byte *p, *buffer; 219 byte *p, *buffer;
220 mpi_limb_t alimb; 220 mpi_limb_t alimb;
221 int i; 221 int i;
222 size_t n; 222 size_t n;
223 223
224 if( sign ) 224 if( sign )
225 *sign = a->sign; 225 *sign = a->sign;
226 *nbytes = a->nlimbs * BYTES_PER_MPI_LIMB; 226 *nbytes = a->nlimbs * BYTES_PER_MPI_LIMB;
227 n = *nbytes? *nbytes:1; /* allocate at least one byte */ 227 n = *nbytes? *nbytes:1; /* allocate at least one byte */
228 p = buffer = force_secure || mpi_is_secure(a) ? gcry_xmalloc_secure(n) 228 p = buffer = force_secure || mpi_is_secure(a) ? gcry_xmalloc_secure(n)
229 : gcry_xmalloc(n); 229 : gcry_xmalloc(n);
230 230
231 for(i=a->nlimbs-1; i >= 0; i-- ) { 231 for(i=a->nlimbs-1; i >= 0; i-- ) {
232 alimb = a->d[i]; 232 alimb = a->d[i];
233#if BYTES_PER_MPI_LIMB == 4 233#if BYTES_PER_MPI_LIMB == 4
234 *p++ = alimb >> 24; 234 *p++ = alimb >> 24;
235 *p++ = alimb >> 16; 235 *p++ = alimb >> 16;
236 *p++ = alimb >> 8; 236 *p++ = alimb >> 8;
237 *p++ = alimb ; 237 *p++ = alimb ;
238#elif BYTES_PER_MPI_LIMB == 8 238#elif BYTES_PER_MPI_LIMB == 8
239 *p++ = alimb >> 56; 239 *p++ = alimb >> 56;
240 *p++ = alimb >> 48; 240 *p++ = alimb >> 48;
241 *p++ = alimb >> 40; 241 *p++ = alimb >> 40;
242 *p++ = alimb >> 32; 242 *p++ = alimb >> 32;
243 *p++ = alimb >> 24; 243 *p++ = alimb >> 24;
244 *p++ = alimb >> 16; 244 *p++ = alimb >> 16;
245 *p++ = alimb >> 8; 245 *p++ = alimb >> 8;
246 *p++ = alimb ; 246 *p++ = alimb ;
247#else 247#else
248 #error please implement for this limb size. 248 #error please implement for this limb size.
249#endif 249#endif
250 } 250 }
251 251
252 /* this is sub-optimal but we need to do the shift oepration because 252 /* this is sub-optimal but we need to do the shift oepration because
253 * the caller has to free the returned buffer */ 253 * the caller has to free the returned buffer */
254 for(p=buffer; !*p && *nbytes; p++, --*nbytes ) 254 for(p=buffer; !*p && *nbytes; p++, --*nbytes )
255 ; 255 ;
256 if( p != buffer ) 256 if( p != buffer )
257 memmove(buffer,p, *nbytes); 257 memmove(buffer,p, *nbytes);
258 return buffer; 258 return buffer;
259} 259}
260 260
261 261
262byte * 262byte *
263_gcry_mpi_get_buffer( gcry_mpi_t a, unsigned *nbytes, int *sign ) 263_gcry_mpi_get_buffer( gcry_mpi_t a, unsigned *nbytes, int *sign )
264{ 264{
265 return do_get_buffer( a, nbytes, sign, 0 ); 265 return do_get_buffer( a, nbytes, sign, 0 );
266} 266}
267 267
268byte * 268byte *
269_gcry_mpi_get_secure_buffer( gcry_mpi_t a, unsigned *nbytes, int *sign ) 269_gcry_mpi_get_secure_buffer( gcry_mpi_t a, unsigned *nbytes, int *sign )
270{ 270{
271 return do_get_buffer( a, nbytes, sign, 1 ); 271 return do_get_buffer( a, nbytes, sign, 1 );
272} 272}
273 273
274/**************** 274/****************
275 * Use BUFFER to update MPI. 275 * Use BUFFER to update MPI.
276 */ 276 */
277void 277void
278_gcry_mpi_set_buffer( gcry_mpi_t a, const byte *buffer, unsigned nbytes, int sign ) 278_gcry_mpi_set_buffer( gcry_mpi_t a, const byte *buffer, unsigned nbytes, int sign )
279{ 279{
280 const byte *p; 280 const byte *p;
281 mpi_limb_t alimb; 281 mpi_limb_t alimb;
282 int nlimbs; 282 int nlimbs;
283 int i; 283 int i;
284 284
285 nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB; 285 nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
286 RESIZE_IF_NEEDED(a, nlimbs); 286 RESIZE_IF_NEEDED(a, nlimbs);
287 a->sign = sign; 287 a->sign = sign;
288 288
289 for(i=0, p = buffer+nbytes-1; p >= buffer+BYTES_PER_MPI_LIMB; ) { 289 for(i=0, p = buffer+nbytes-1; p >= buffer+BYTES_PER_MPI_LIMB; ) {
290#if BYTES_PER_MPI_LIMB == 4 290#if BYTES_PER_MPI_LIMB == 4
291 alimb = *p-- ; 291 alimb = *p-- ;
292 alimb |= *p-- << 8 ; 292 alimb |= *p-- << 8 ;
293 alimb |= *p-- << 16 ; 293 alimb |= *p-- << 16 ;
294 alimb |= *p-- << 24 ; 294 alimb |= *p-- << 24 ;
295#elif BYTES_PER_MPI_LIMB == 8 295#elif BYTES_PER_MPI_LIMB == 8
296 alimb = (mpi_limb_t)*p-- ; 296 alimb = (mpi_limb_t)*p-- ;
297 alimb |= (mpi_limb_t)*p-- << 8 ; 297 alimb |= (mpi_limb_t)*p-- << 8 ;
298 alimb |= (mpi_limb_t)*p-- << 16 ; 298 alimb |= (mpi_limb_t)*p-- << 16 ;
299 alimb |= (mpi_limb_t)*p-- << 24 ; 299 alimb |= (mpi_limb_t)*p-- << 24 ;
300 alimb |= (mpi_limb_t)*p-- << 32 ; 300 alimb |= (mpi_limb_t)*p-- << 32 ;
301 alimb |= (mpi_limb_t)*p-- << 40 ; 301 alimb |= (mpi_limb_t)*p-- << 40 ;
302 alimb |= (mpi_limb_t)*p-- << 48 ; 302 alimb |= (mpi_limb_t)*p-- << 48 ;
303 alimb |= (mpi_limb_t)*p-- << 56 ; 303 alimb |= (mpi_limb_t)*p-- << 56 ;
304#else 304#else
305 #error please implement for this limb size. 305 #error please implement for this limb size.
306#endif 306#endif
307 a->d[i++] = alimb; 307 a->d[i++] = alimb;
308 } 308 }
309 if( p >= buffer ) { 309 if( p >= buffer ) {
310#if BYTES_PER_MPI_LIMB == 4 310#if BYTES_PER_MPI_LIMB == 4
311 alimb = *p-- ; 311 alimb = *p-- ;
312 if( p >= buffer ) alimb |= *p-- << 8 ; 312 if( p >= buffer ) alimb |= *p-- << 8 ;
313 if( p >= buffer ) alimb |= *p-- << 16 ; 313 if( p >= buffer ) alimb |= *p-- << 16 ;
314 if( p >= buffer ) alimb |= *p-- << 24 ; 314 if( p >= buffer ) alimb |= *p-- << 24 ;
315#elif BYTES_PER_MPI_LIMB == 8 315#elif BYTES_PER_MPI_LIMB == 8
316 alimb = (mpi_limb_t)*p-- ; 316 alimb = (mpi_limb_t)*p-- ;
317 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 8 ; 317 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 8 ;
318 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 16 ; 318 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 16 ;
319 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 24 ; 319 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 24 ;
320 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 32 ; 320 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 32 ;
321 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 40 ; 321 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 40 ;
322 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 48 ; 322 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 48 ;
323 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 56 ; 323 if( p >= buffer ) alimb |= (mpi_limb_t)*p-- << 56 ;
324#else 324#else
325 #error please implement for this limb size. 325 #error please implement for this limb size.
326#endif 326#endif
327 a->d[i++] = alimb; 327 a->d[i++] = alimb;
328 } 328 }
329 a->nlimbs = i; 329 a->nlimbs = i;
330 assert( i == nlimbs ); 330 assert( i == nlimbs );
331} 331}
332 332
333 333
334 334
335/* Convert the external representation of an integer stored in BUFFER 335/* Convert the external representation of an integer stored in BUFFER
336 with a length of BUFLEN into a newly create MPI returned in 336 with a length of BUFLEN into a newly create MPI returned in
337 RET_MPI. If NBYTES is not NULL, it will receive the number of 337 RET_MPI. If NBYTES is not NULL, it will receive the number of
338 bytes actually scanned after a successful operation. */ 338 bytes actually scanned after a successful operation. */
339gcry_error_t 339gcry_error_t
340gcry_mpi_scan( struct gcry_mpi **ret_mpi, enum gcry_mpi_format format, 340gcry_mpi_scan( struct gcry_mpi **ret_mpi, enum gcry_mpi_format format,
341 const void *buffer_arg, size_t buflen, size_t *nscanned ) 341 const void *buffer_arg, size_t buflen, size_t *nscanned )
342{ 342{
343 const unsigned char *buffer = (const unsigned char*)buffer_arg; 343 const unsigned char *buffer = (const unsigned char*)buffer_arg;
344 struct gcry_mpi *a = NULL; 344 struct gcry_mpi *a = NULL;
345 unsigned int len; 345 unsigned int len;
346 int secure = (buffer && gcry_is_secure (buffer)); 346 int secure = (buffer && gcry_is_secure (buffer));
347 347
348 if (format == GCRYMPI_FMT_SSH) 348 if (format == GCRYMPI_FMT_SSH)
349 len = 0; 349 len = 0;
350 else 350 else
351 len = buflen; 351 len = buflen;
352 352
353 if( format == GCRYMPI_FMT_STD ) { 353 if( format == GCRYMPI_FMT_STD ) {
354 const byte *s = buffer; 354 const byte *s = buffer;
355 355
356 a = secure? mpi_alloc_secure ((len+BYTES_PER_MPI_LIMB-1) 356 a = secure? mpi_alloc_secure ((len+BYTES_PER_MPI_LIMB-1)
357 /BYTES_PER_MPI_LIMB) 357 /BYTES_PER_MPI_LIMB)
358 : mpi_alloc ((len+BYTES_PER_MPI_LIMB-1)/BYTES_PER_MPI_LIMB); 358 : mpi_alloc ((len+BYTES_PER_MPI_LIMB-1)/BYTES_PER_MPI_LIMB);
359 if( len ) { /* not zero */ 359 if( len ) { /* not zero */
360 a->sign = *s & 0x80; 360 a->sign = *s & 0x80;
361 if( a->sign ) { 361 if( a->sign ) {
362 /* FIXME: we have to convert from 2compl to magnitude format */ 362 /* FIXME: we have to convert from 2compl to magnitude format */
363 mpi_free(a); 363 mpi_free(a);
364 return gcry_error (GPG_ERR_INTERNAL); 364 return gcry_error (GPG_ERR_INTERNAL);
365 } 365 }
366 else 366 else
367 _gcry_mpi_set_buffer( a, s, len, 0 ); 367 _gcry_mpi_set_buffer( a, s, len, 0 );
368 } 368 }
369 if( ret_mpi ) { 369 if( ret_mpi ) {
370 mpi_normalize ( a ); 370 mpi_normalize ( a );
371 *ret_mpi = a; 371 *ret_mpi = a;
372 } 372 }
373 else 373 else
374 mpi_free(a); 374 mpi_free(a);
375 return gcry_error (GPG_ERR_NO_ERROR); 375 return gcry_error (GPG_ERR_NO_ERROR);
376 } 376 }
377 else if( format == GCRYMPI_FMT_USG ) { 377 else if( format == GCRYMPI_FMT_USG ) {
378 a = secure? mpi_alloc_secure ((len+BYTES_PER_MPI_LIMB-1) 378 a = secure? mpi_alloc_secure ((len+BYTES_PER_MPI_LIMB-1)
379 /BYTES_PER_MPI_LIMB) 379 /BYTES_PER_MPI_LIMB)
380 : mpi_alloc ((len+BYTES_PER_MPI_LIMB-1)/BYTES_PER_MPI_LIMB); 380 : mpi_alloc ((len+BYTES_PER_MPI_LIMB-1)/BYTES_PER_MPI_LIMB);
381 381
382 if( len ) /* not zero */ 382 if( len ) /* not zero */
383 _gcry_mpi_set_buffer( a, buffer, len, 0 ); 383 _gcry_mpi_set_buffer( a, buffer, len, 0 );
384 if( ret_mpi ) { 384 if( ret_mpi ) {
385 mpi_normalize ( a ); 385 mpi_normalize ( a );
386 *ret_mpi = a; 386 *ret_mpi = a;
387 } 387 }
388 else 388 else
389 mpi_free(a); 389 mpi_free(a);
390 return gcry_error (GPG_ERR_NO_ERROR); 390 return gcry_error (GPG_ERR_NO_ERROR);
391 } 391 }
392 else if( format == GCRYMPI_FMT_PGP ) { 392 else if( format == GCRYMPI_FMT_PGP ) {
393 a = mpi_read_from_buffer (buffer, &len, secure); 393 a = mpi_read_from_buffer (buffer, &len, secure);
394 if( nscanned ) 394 if( nscanned )
395 *nscanned = len; 395 *nscanned = len;
396 if( ret_mpi && a ) { 396 if( ret_mpi && a ) {
397 mpi_normalize ( a ); 397 mpi_normalize ( a );
398 *ret_mpi = a; 398 *ret_mpi = a;
399 } 399 }
400 else 400 else
401 mpi_free(a); 401 mpi_free(a);
402 return gcry_error (a ? GPG_ERR_NO_ERROR : GPG_ERR_INV_OBJ); 402 return gcry_error (a ? GPG_ERR_NO_ERROR : GPG_ERR_INV_OBJ);
403 } 403 }
404 else if( format == GCRYMPI_FMT_SSH ) { 404 else if( format == GCRYMPI_FMT_SSH ) {
405 const unsigned char *s = buffer; 405 const unsigned char *s = buffer;
406 size_t n; 406 size_t n;
407 407
408 if( len && len < 4 ) 408 if( len && len < 4 )
409 return gcry_error (GPG_ERR_TOO_SHORT); 409 return gcry_error (GPG_ERR_TOO_SHORT);
410 n = s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]; 410 n = s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
411 s += 4; 411 s += 4;
412 if (len) 412 if (len)
413 len -= 4; 413 len -= 4;
414 if( len && n > len ) 414 if( len && n > len )
415 return gcry_error (GPG_ERR_TOO_LARGE); /* or should it be 415 return gcry_error (GPG_ERR_TOO_LARGE); /* or should it be
416 too_short */ 416 too_short */
417 417
418 a = secure? mpi_alloc_secure ((n+BYTES_PER_MPI_LIMB-1) 418 a = secure? mpi_alloc_secure ((n+BYTES_PER_MPI_LIMB-1)
419 /BYTES_PER_MPI_LIMB) 419 /BYTES_PER_MPI_LIMB)
420 : mpi_alloc ((n+BYTES_PER_MPI_LIMB-1)/BYTES_PER_MPI_LIMB); 420 : mpi_alloc ((n+BYTES_PER_MPI_LIMB-1)/BYTES_PER_MPI_LIMB);
421 if( n ) { /* not zero */ 421 if( n ) { /* not zero */
422 a->sign = *s & 0x80; 422 a->sign = *s & 0x80;
423 if( a->sign ) { 423 if( a->sign ) {
424 /* FIXME: we have to convert from 2compl to magnitude format */ 424 /* FIXME: we have to convert from 2compl to magnitude format */
425 mpi_free(a); 425 mpi_free(a);
426 return gcry_error (GPG_ERR_INTERNAL); 426 return gcry_error (GPG_ERR_INTERNAL);
427 } 427 }
428 else 428 else
429 _gcry_mpi_set_buffer( a, s, n, 0 ); 429 _gcry_mpi_set_buffer( a, s, n, 0 );
430 } 430 }
431 if( nscanned ) 431 if( nscanned )
432 *nscanned = n+4; 432 *nscanned = n+4;
433 if( ret_mpi ) { 433 if( ret_mpi ) {
434 mpi_normalize ( a ); 434 mpi_normalize ( a );
435 *ret_mpi = a; 435 *ret_mpi = a;
436 } 436 }
437 else 437 else
438 mpi_free(a); 438 mpi_free(a);
439 return gcry_error (GPG_ERR_NO_ERROR); 439 return gcry_error (GPG_ERR_NO_ERROR);
440 } 440 }
441 else if( format == GCRYMPI_FMT_HEX ) { 441 else if( format == GCRYMPI_FMT_HEX ) {
442 if( buflen ) 442 if( buflen )
443 return gcry_error (GPG_ERR_INV_ARG); /* can only handle C 443 return gcry_error (GPG_ERR_INV_ARG); /* can only handle C
444 strings for now */ 444 strings for now */
445 a = secure? mpi_alloc_secure (0) : mpi_alloc(0); 445 a = secure? mpi_alloc_secure (0) : mpi_alloc(0);
446 if( mpi_fromstr ( a, (const char *)buffer ) ) 446 if( mpi_fromstr ( a, (const char *)buffer ) )
447 return gcry_error (GPG_ERR_INV_OBJ); 447 return gcry_error (GPG_ERR_INV_OBJ);
448 if( ret_mpi ) { 448 if( ret_mpi ) {
449 mpi_normalize ( a ); 449 mpi_normalize ( a );
450 *ret_mpi = a; 450 *ret_mpi = a;
451 } 451 }
452 else 452 else
453 mpi_free(a); 453 mpi_free(a);
454 return gcry_error (GPG_ERR_NO_ERROR); 454 return gcry_error (GPG_ERR_NO_ERROR);
455 } 455 }
456 else 456 else
457 return gcry_error (GPG_ERR_INV_ARG); 457 return gcry_error (GPG_ERR_INV_ARG);
458} 458}
459 459
460/* Convert the big integer A into the external representation 460/* Convert the big integer A into the external representation
461 described by FORMAT and store it in the provided BUFFER which has 461 described by FORMAT and store it in the provided BUFFER which has
462 been allocated by the user with a size of BUFLEN bytes. NWRITTEN 462 been allocated by the user with a size of BUFLEN bytes. NWRITTEN
463 receives the actual length of the external representation unless it 463 receives the actual length of the external representation unless it
464 has been passed as NULL. BUFFER may be NULL to query the required 464 has been passed as NULL. BUFFER may be NULL to query the required
465 length.*/ 465 length.*/
466gcry_error_t 466gcry_error_t
467gcry_mpi_print( enum gcry_mpi_format format, 467gcry_mpi_print( enum gcry_mpi_format format,
468 unsigned char *buffer, size_t buflen, 468 unsigned char *buffer, size_t buflen,
469 size_t *nwritten, struct gcry_mpi *a) 469 size_t *nwritten, struct gcry_mpi *a)
470{ 470{
471 unsigned int nbits = mpi_get_nbits(a); 471 unsigned int nbits = mpi_get_nbits(a);
472 size_t len; 472 size_t len;
473 size_t dummy_nwritten; 473 size_t dummy_nwritten;
474 474
475 if (!nwritten) 475 if (!nwritten)
476 nwritten = &dummy_nwritten; 476 nwritten = &dummy_nwritten;
477 477
478 len = buflen; 478 len = buflen;
479 *nwritten = 0; 479 *nwritten = 0;
480 if( format == GCRYMPI_FMT_STD ) { 480 if( format == GCRYMPI_FMT_STD ) {
481 unsigned char *tmp; 481 unsigned char *tmp;
482 int extra = 0; 482 int extra = 0;
483 unsigned int n; 483 unsigned int n;
484 484
485 if( a->sign ) 485 if( a->sign )
486 return gcry_error (GPG_ERR_INTERNAL); /* can't handle it yet */ 486 return gcry_error (GPG_ERR_INTERNAL); /* can't handle it yet */
487 487
488 tmp = _gcry_mpi_get_buffer( a, &n, NULL ); 488 tmp = _gcry_mpi_get_buffer( a, &n, NULL );
489 if( n && (*tmp & 0x80) ) { 489 if( n && (*tmp & 0x80) ) {
490 n++; 490 n++;
491 extra=1; 491 extra=1;
492 } 492 }
493 493
494 if (buffer && n > len) { 494 if (buffer && n > len) {
495 /* The provided buffer is too short. */ 495 /* The provided buffer is too short. */
496 gcry_free(tmp); 496 gcry_free(tmp);
497 return gcry_error (GPG_ERR_TOO_SHORT); 497 return gcry_error (GPG_ERR_TOO_SHORT);
498 } 498 }
499 if( buffer ) { 499 if( buffer ) {
500 byte *s = buffer; 500 byte *s = buffer;
501 if( extra ) 501 if( extra )
502 *s++ = 0; 502 *s++ = 0;
503 503
504 memcpy( s, tmp, n-extra ); 504 memcpy( s, tmp, n-extra );
505 } 505 }
506 gcry_free(tmp); 506 gcry_free(tmp);
507 *nwritten = n; 507 *nwritten = n;
508 return gcry_error (GPG_ERR_NO_ERROR); 508 return gcry_error (GPG_ERR_NO_ERROR);
509 } 509 }
510 else if( format == GCRYMPI_FMT_USG ) { 510 else if( format == GCRYMPI_FMT_USG ) {
511 unsigned int n = (nbits + 7)/8; 511 unsigned int n = (nbits + 7)/8;
512 512
513 /* we ignore the sign for this format */ 513 /* we ignore the sign for this format */
514 /* FIXME: for performance reasons we should put this into 514 /* FIXME: for performance reasons we should put this into
515 * mpi_aprint becuase we can then use the buffer directly */ 515 * mpi_aprint becuase we can then use the buffer directly */
516 if (buffer && n > len) 516 if (buffer && n > len)
517 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */ 517 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */
518 if( buffer ) { 518 if( buffer ) {
519 unsigned char *tmp; 519 unsigned char *tmp;
520 tmp = _gcry_mpi_get_buffer( a, &n, NULL ); 520 tmp = _gcry_mpi_get_buffer( a, &n, NULL );
521 memcpy( buffer, tmp, n ); 521 memcpy( buffer, tmp, n );
522 gcry_free(tmp); 522 gcry_free(tmp);
523 } 523 }
524 *nwritten = n; 524 *nwritten = n;
525 return gcry_error (GPG_ERR_NO_ERROR); 525 return gcry_error (GPG_ERR_NO_ERROR);
526 } 526 }
527 else if( format == GCRYMPI_FMT_PGP ) { 527 else if( format == GCRYMPI_FMT_PGP ) {
528 unsigned int n = (nbits + 7)/8; 528 unsigned int n = (nbits + 7)/8;
529 529
530 if( a->sign ) 530 if( a->sign )
531 return gcry_error (GPG_ERR_INV_ARG); /* pgp format can only handle unsigned */ 531 return gcry_error (GPG_ERR_INV_ARG); /* pgp format can only handle unsigned */
532 532
533 if (buffer && n+2 > len) 533 if (buffer && n+2 > len)
534 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */ 534 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */
535 if( buffer ) { 535 if( buffer ) {
536 unsigned char *tmp; 536 unsigned char *tmp;
537 unsigned char *s = buffer; 537 unsigned char *s = buffer;
538 s[0] = nbits >> 8; 538 s[0] = nbits >> 8;
539 s[1] = nbits; 539 s[1] = nbits;
540 540
541 tmp = _gcry_mpi_get_buffer( a, &n, NULL ); 541 tmp = _gcry_mpi_get_buffer( a, &n, NULL );
542 memcpy( s+2, tmp, n ); 542 memcpy( s+2, tmp, n );
543 gcry_free(tmp); 543 gcry_free(tmp);
544 } 544 }
545 *nwritten = n+2; 545 *nwritten = n+2;
546 return gcry_error (GPG_ERR_NO_ERROR); 546 return gcry_error (GPG_ERR_NO_ERROR);
547 } 547 }
548 else if( format == GCRYMPI_FMT_SSH ) { 548 else if( format == GCRYMPI_FMT_SSH ) {
549 unsigned char *tmp; 549 unsigned char *tmp;
550 int extra = 0; 550 int extra = 0;
551 unsigned int n; 551 unsigned int n;
552 552
553 if( a->sign ) 553 if( a->sign )
554 return gcry_error (GPG_ERR_INTERNAL); /* can't handle it yet */ 554 return gcry_error (GPG_ERR_INTERNAL); /* can't handle it yet */
555 555
556 tmp = _gcry_mpi_get_buffer( a, &n, NULL ); 556 tmp = _gcry_mpi_get_buffer( a, &n, NULL );
557 if( n && (*tmp & 0x80) ) { 557 if( n && (*tmp & 0x80) ) {
558 n++; 558 n++;
559 extra=1; 559 extra=1;
560 } 560 }
561 561
562 if (buffer && n+4 > len) { 562 if (buffer && n+4 > len) {
563 gcry_free(tmp); 563 gcry_free(tmp);
564 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */ 564 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */
565 } 565 }
566 if( buffer ) { 566 if( buffer ) {
567 byte *s = buffer; 567 byte *s = buffer;
568 *s++ = n >> 24; 568 *s++ = n >> 24;
569 *s++ = n >> 16; 569 *s++ = n >> 16;
570 *s++ = n >> 8; 570 *s++ = n >> 8;
571 *s++ = n; 571 *s++ = n;
572 if( extra ) 572 if( extra )
573 *s++ = 0; 573 *s++ = 0;
574 574
575 memcpy( s, tmp, n-extra ); 575 memcpy( s, tmp, n-extra );
576 } 576 }
577 gcry_free(tmp); 577 gcry_free(tmp);
578 *nwritten = 4+n; 578 *nwritten = 4+n;
579 return gcry_error (GPG_ERR_NO_ERROR); 579 return gcry_error (GPG_ERR_NO_ERROR);
580 } 580 }
581 else if( format == GCRYMPI_FMT_HEX ) { 581 else if( format == GCRYMPI_FMT_HEX ) {
582 byte *tmp; 582 byte *tmp;
583 int i; 583 int i;
584 int extra = 0; 584 int extra = 0;
585 unsigned int n=0; 585 unsigned int n=0;
586 586
587 tmp = _gcry_mpi_get_buffer( a, &n, NULL ); 587 tmp = _gcry_mpi_get_buffer( a, &n, NULL );
588 if( !n || (*tmp & 0x80) ) 588 if( !n || (*tmp & 0x80) )
589 extra=2; 589 extra=2;
590 590
591 if(buffer && 2*n + extra + !!a->sign + 1 > len) { 591 if(buffer && 2*n + extra + !!a->sign + 1 > len) {
592 gcry_free(tmp); 592 gcry_free(tmp);
593 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */ 593 return gcry_error (GPG_ERR_TOO_SHORT); /* the provided buffer is too short */
594 } 594 }
595 if( buffer ) { 595 if( buffer ) {
596 byte *s = buffer; 596 byte *s = buffer;
597 if( a->sign ) 597 if( a->sign )
598 *s++ = '-'; 598 *s++ = '-';
599 if( extra ) { 599 if( extra ) {
600 *s++ = '0'; 600 *s++ = '0';
601 *s++ = '0'; 601 *s++ = '0';
602 } 602 }
603 603
604 for(i=0; i < n; i++ ) { 604 for(i=0; i < n; i++ ) {
605 unsigned int c = tmp[i]; 605 unsigned int c = tmp[i];
606 *s++ = (c >> 4) < 10? '0'+(c>>4) : 'A'+(c>>4)-10 ; 606 *s++ = (c >> 4) < 10? '0'+(c>>4) : 'A'+(c>>4)-10 ;
607 c &= 15; 607 c &= 15;
608 *s++ = c < 10? '0'+c : 'A'+c-10 ; 608 *s++ = c < 10? '0'+c : 'A'+c-10 ;
609 } 609 }
610 *s++ = 0; 610 *s++ = 0;
611 *nwritten = s - buffer; 611 *nwritten = s - buffer;
612 } 612 }
613 else { 613 else {
614 *nwritten = 2*n + extra + !!a->sign + 1; 614 *nwritten = 2*n + extra + !!a->sign + 1;
615 } 615 }
616 gcry_free(tmp); 616 gcry_free(tmp);
617 return gcry_error (GPG_ERR_NO_ERROR); 617 return gcry_error (GPG_ERR_NO_ERROR);
618 } 618 }
619 else 619 else
620 return gcry_error (GPG_ERR_INV_ARG); 620 return gcry_error (GPG_ERR_INV_ARG);
621} 621}
622 622
623/**************** 623/****************
624 * Like gcry_mpi_print but this function allocates the buffer itself. 624 * Like gcry_mpi_print but this function allocates the buffer itself.
625 * The caller has to supply the address of a pointer. NWRITTEN may be 625 * The caller has to supply the address of a pointer. NWRITTEN may be
626 * NULL. 626 * NULL.
627 */ 627 */
628gcry_error_t 628gcry_error_t
629gcry_mpi_aprint( enum gcry_mpi_format format, 629gcry_mpi_aprint( enum gcry_mpi_format format,
630 unsigned char **buffer, size_t *nwritten, 630 unsigned char **buffer, size_t *nwritten,
631 struct gcry_mpi *a ) 631 struct gcry_mpi *a )
632{ 632{
633 size_t n; 633 size_t n;
634 gcry_error_t rc; 634 gcry_error_t rc;
635 635
636 *buffer = NULL; 636 *buffer = NULL;
637 rc = gcry_mpi_print( format, NULL, 0, &n, a ); 637 rc = gcry_mpi_print( format, NULL, 0, &n, a );
638 if( rc ) 638 if( rc )
639 return rc; 639 return rc;
640 *buffer = mpi_is_secure(a) ? gcry_xmalloc_secure( n ) : gcry_xmalloc( n ); 640 *buffer = mpi_is_secure(a) ? gcry_xmalloc_secure( n ) : gcry_xmalloc( n );
641 rc = gcry_mpi_print( format, *buffer, n, &n, a ); 641 rc = gcry_mpi_print( format, *buffer, n, &n, a );
642 if( rc ) { 642 if( rc ) {
643 gcry_free(*buffer); 643 gcry_free(*buffer);
644 *buffer = NULL; 644 *buffer = NULL;
645 } 645 }
646 else if( nwritten ) 646 else if( nwritten )
647 *nwritten = n; 647 *nwritten = n;
648 return rc; 648 return rc;
649} 649}
650 650
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-div.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-div.c
index 9f32c75..e41e205 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-div.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-div.c
@@ -1,535 +1,535 @@
1/* mpih-div.c - MPI helper functions 1/* mpih-div.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1998, 2000, 2 * Copyright (C) 1994, 1996, 1998, 2000,
3 * 2001, 2002 Free Software Foundation, Inc. 3 * 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include "mpi-internal.h" 31#include "mpi-internal.h"
32#include "longlong.h" 32#include "longlong.h"
33 33
34#ifndef UMUL_TIME 34#ifndef UMUL_TIME
35#define UMUL_TIME 1 35#define UMUL_TIME 1
36#endif 36#endif
37#ifndef UDIV_TIME 37#ifndef UDIV_TIME
38#define UDIV_TIME UMUL_TIME 38#define UDIV_TIME UMUL_TIME
39#endif 39#endif
40 40
41/* FIXME: We should be using invert_limb (or invert_normalized_limb) 41/* FIXME: We should be using invert_limb (or invert_normalized_limb)
42 * here (not udiv_qrnnd). 42 * here (not udiv_qrnnd).
43 */ 43 */
44 44
45mpi_limb_t 45mpi_limb_t
46_gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, 46_gcry_mpih_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
47 mpi_limb_t divisor_limb) 47 mpi_limb_t divisor_limb)
48{ 48{
49 mpi_size_t i; 49 mpi_size_t i;
50 mpi_limb_t n1, n0, r; 50 mpi_limb_t n1, n0, r;
51 int dummy; 51 int dummy;
52 52
53 /* Botch: Should this be handled at all? Rely on callers? */ 53 /* Botch: Should this be handled at all? Rely on callers? */
54 if( !dividend_size ) 54 if( !dividend_size )
55 return 0; 55 return 0;
56 56
57 /* If multiplication is much faster than division, and the 57 /* If multiplication is much faster than division, and the
58 * dividend is large, pre-invert the divisor, and use 58 * dividend is large, pre-invert the divisor, and use
59 * only multiplications in the inner loop. 59 * only multiplications in the inner loop.
60 * 60 *
61 * This test should be read: 61 * This test should be read:
62 * Does it ever help to use udiv_qrnnd_preinv? 62 * Does it ever help to use udiv_qrnnd_preinv?
63 * && Does what we save compensate for the inversion overhead? 63 * && Does what we save compensate for the inversion overhead?
64 */ 64 */
65 if( UDIV_TIME > (2 * UMUL_TIME + 6) 65 if( UDIV_TIME > (2 * UMUL_TIME + 6)
66 && (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME ) { 66 && (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME ) {
67 int normalization_steps; 67 int normalization_steps;
68 68
69 count_leading_zeros( normalization_steps, divisor_limb ); 69 count_leading_zeros( normalization_steps, divisor_limb );
70 if( normalization_steps ) { 70 if( normalization_steps ) {
71 mpi_limb_t divisor_limb_inverted; 71 mpi_limb_t divisor_limb_inverted;
72 72
73 divisor_limb <<= normalization_steps; 73 divisor_limb <<= normalization_steps;
74 74
75 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The 75 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The
76 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the 76 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the
77 * most significant bit (with weight 2**N) implicit. 77 * most significant bit (with weight 2**N) implicit.
78 * 78 *
79 * Special case for DIVISOR_LIMB == 100...000. 79 * Special case for DIVISOR_LIMB == 100...000.
80 */ 80 */
81 if( !(divisor_limb << 1) ) 81 if( !(divisor_limb << 1) )
82 divisor_limb_inverted = ~(mpi_limb_t)0; 82 divisor_limb_inverted = ~(mpi_limb_t)0;
83 else 83 else
84 udiv_qrnnd(divisor_limb_inverted, dummy, 84 udiv_qrnnd(divisor_limb_inverted, dummy,
85 -divisor_limb, 0, divisor_limb); 85 -divisor_limb, 0, divisor_limb);
86 86
87 n1 = dividend_ptr[dividend_size - 1]; 87 n1 = dividend_ptr[dividend_size - 1];
88 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps); 88 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps);
89 89
90 /* Possible optimization: 90 /* Possible optimization:
91 * if (r == 0 91 * if (r == 0
92 * && divisor_limb > ((n1 << normalization_steps) 92 * && divisor_limb > ((n1 << normalization_steps)
93 * | (dividend_ptr[dividend_size - 2] >> ...))) 93 * | (dividend_ptr[dividend_size - 2] >> ...)))
94 * ...one division less... 94 * ...one division less...
95 */ 95 */
96 for( i = dividend_size - 2; i >= 0; i--) { 96 for( i = dividend_size - 2; i >= 0; i--) {
97 n0 = dividend_ptr[i]; 97 n0 = dividend_ptr[i];
98 UDIV_QRNND_PREINV(dummy, r, r, 98 UDIV_QRNND_PREINV(dummy, r, r,
99 ((n1 << normalization_steps) 99 ((n1 << normalization_steps)
100 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))), 100 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))),
101 divisor_limb, divisor_limb_inverted); 101 divisor_limb, divisor_limb_inverted);
102 n1 = n0; 102 n1 = n0;
103 } 103 }
104 UDIV_QRNND_PREINV(dummy, r, r, 104 UDIV_QRNND_PREINV(dummy, r, r,
105 n1 << normalization_steps, 105 n1 << normalization_steps,
106 divisor_limb, divisor_limb_inverted); 106 divisor_limb, divisor_limb_inverted);
107 return r >> normalization_steps; 107 return r >> normalization_steps;
108 } 108 }
109 else { 109 else {
110 mpi_limb_t divisor_limb_inverted; 110 mpi_limb_t divisor_limb_inverted;
111 111
112 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The 112 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The
113 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the 113 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the
114 * most significant bit (with weight 2**N) implicit. 114 * most significant bit (with weight 2**N) implicit.
115 * 115 *
116 * Special case for DIVISOR_LIMB == 100...000. 116 * Special case for DIVISOR_LIMB == 100...000.
117 */ 117 */
118 if( !(divisor_limb << 1) ) 118 if( !(divisor_limb << 1) )
119 divisor_limb_inverted = ~(mpi_limb_t)0; 119 divisor_limb_inverted = ~(mpi_limb_t)0;
120 else 120 else
121 udiv_qrnnd(divisor_limb_inverted, dummy, 121 udiv_qrnnd(divisor_limb_inverted, dummy,
122 -divisor_limb, 0, divisor_limb); 122 -divisor_limb, 0, divisor_limb);
123 123
124 i = dividend_size - 1; 124 i = dividend_size - 1;
125 r = dividend_ptr[i]; 125 r = dividend_ptr[i];
126 126
127 if( r >= divisor_limb ) 127 if( r >= divisor_limb )
128 r = 0; 128 r = 0;
129 else 129 else
130 i--; 130 i--;
131 131
132 for( ; i >= 0; i--) { 132 for( ; i >= 0; i--) {
133 n0 = dividend_ptr[i]; 133 n0 = dividend_ptr[i];
134 UDIV_QRNND_PREINV(dummy, r, r, 134 UDIV_QRNND_PREINV(dummy, r, r,
135 n0, divisor_limb, divisor_limb_inverted); 135 n0, divisor_limb, divisor_limb_inverted);
136 } 136 }
137 return r; 137 return r;
138 } 138 }
139 } 139 }
140 else { 140 else {
141 if( UDIV_NEEDS_NORMALIZATION ) { 141 if( UDIV_NEEDS_NORMALIZATION ) {
142 int normalization_steps; 142 int normalization_steps;
143 143
144 count_leading_zeros(normalization_steps, divisor_limb); 144 count_leading_zeros(normalization_steps, divisor_limb);
145 if( normalization_steps ) { 145 if( normalization_steps ) {
146 divisor_limb <<= normalization_steps; 146 divisor_limb <<= normalization_steps;
147 147
148 n1 = dividend_ptr[dividend_size - 1]; 148 n1 = dividend_ptr[dividend_size - 1];
149 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps); 149 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps);
150 150
151 /* Possible optimization: 151 /* Possible optimization:
152 * if (r == 0 152 * if (r == 0
153 * && divisor_limb > ((n1 << normalization_steps) 153 * && divisor_limb > ((n1 << normalization_steps)
154 * | (dividend_ptr[dividend_size - 2] >> ...))) 154 * | (dividend_ptr[dividend_size - 2] >> ...)))
155 * ...one division less... 155 * ...one division less...
156 */ 156 */
157 for(i = dividend_size - 2; i >= 0; i--) { 157 for(i = dividend_size - 2; i >= 0; i--) {
158 n0 = dividend_ptr[i]; 158 n0 = dividend_ptr[i];
159 udiv_qrnnd (dummy, r, r, 159 udiv_qrnnd (dummy, r, r,
160 ((n1 << normalization_steps) 160 ((n1 << normalization_steps)
161 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))), 161 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))),
162 divisor_limb); 162 divisor_limb);
163 n1 = n0; 163 n1 = n0;
164 } 164 }
165 udiv_qrnnd (dummy, r, r, 165 udiv_qrnnd (dummy, r, r,
166 n1 << normalization_steps, 166 n1 << normalization_steps,
167 divisor_limb); 167 divisor_limb);
168 return r >> normalization_steps; 168 return r >> normalization_steps;
169 } 169 }
170 } 170 }
171 /* No normalization needed, either because udiv_qrnnd doesn't require 171 /* No normalization needed, either because udiv_qrnnd doesn't require
172 * it, or because DIVISOR_LIMB is already normalized. */ 172 * it, or because DIVISOR_LIMB is already normalized. */
173 i = dividend_size - 1; 173 i = dividend_size - 1;
174 r = dividend_ptr[i]; 174 r = dividend_ptr[i];
175 175
176 if(r >= divisor_limb) 176 if(r >= divisor_limb)
177 r = 0; 177 r = 0;
178 else 178 else
179 i--; 179 i--;
180 180
181 for(; i >= 0; i--) { 181 for(; i >= 0; i--) {
182 n0 = dividend_ptr[i]; 182 n0 = dividend_ptr[i];
183 udiv_qrnnd (dummy, r, r, n0, divisor_limb); 183 udiv_qrnnd (dummy, r, r, n0, divisor_limb);
184 } 184 }
185 return r; 185 return r;
186 } 186 }
187} 187}
188 188
189/* Divide num (NP/NSIZE) by den (DP/DSIZE) and write 189/* Divide num (NP/NSIZE) by den (DP/DSIZE) and write
190 * the NSIZE-DSIZE least significant quotient limbs at QP 190 * the NSIZE-DSIZE least significant quotient limbs at QP
191 * and the DSIZE long remainder at NP. If QEXTRA_LIMBS is 191 * and the DSIZE long remainder at NP. If QEXTRA_LIMBS is
192 * non-zero, generate that many fraction bits and append them after the 192 * non-zero, generate that many fraction bits and append them after the
193 * other quotient limbs. 193 * other quotient limbs.
194 * Return the most significant limb of the quotient, this is always 0 or 1. 194 * Return the most significant limb of the quotient, this is always 0 or 1.
195 * 195 *
196 * Preconditions: 196 * Preconditions:
197 * 0. NSIZE >= DSIZE. 197 * 0. NSIZE >= DSIZE.
198 * 1. The most significant bit of the divisor must be set. 198 * 1. The most significant bit of the divisor must be set.
199 * 2. QP must either not overlap with the input operands at all, or 199 * 2. QP must either not overlap with the input operands at all, or
200 * QP + DSIZE >= NP must hold true. (This means that it's 200 * QP + DSIZE >= NP must hold true. (This means that it's
201 * possible to put the quotient in the high part of NUM, right after the 201 * possible to put the quotient in the high part of NUM, right after the
202 * remainder in NUM. 202 * remainder in NUM.
203 * 3. NSIZE >= DSIZE, even if QEXTRA_LIMBS is non-zero. 203 * 3. NSIZE >= DSIZE, even if QEXTRA_LIMBS is non-zero.
204 */ 204 */
205 205
206mpi_limb_t 206mpi_limb_t
207_gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs, 207_gcry_mpih_divrem( mpi_ptr_t qp, mpi_size_t qextra_limbs,
208 mpi_ptr_t np, mpi_size_t nsize, 208 mpi_ptr_t np, mpi_size_t nsize,
209 mpi_ptr_t dp, mpi_size_t dsize) 209 mpi_ptr_t dp, mpi_size_t dsize)
210{ 210{
211 mpi_limb_t most_significant_q_limb = 0; 211 mpi_limb_t most_significant_q_limb = 0;
212 212
213 switch(dsize) { 213 switch(dsize) {
214 case 0: 214 case 0:
215 /* We are asked to divide by zero, so go ahead and do it! (To make 215 /* We are asked to divide by zero, so go ahead and do it! (To make
216 the compiler not remove this statement, return the value.) */ 216 the compiler not remove this statement, return the value.) */
217 return 1 / dsize; 217 return 1 / dsize;
218 218
219 case 1: 219 case 1:
220 { 220 {
221 mpi_size_t i; 221 mpi_size_t i;
222 mpi_limb_t n1; 222 mpi_limb_t n1;
223 mpi_limb_t d; 223 mpi_limb_t d;
224 224
225 d = dp[0]; 225 d = dp[0];
226 n1 = np[nsize - 1]; 226 n1 = np[nsize - 1];
227 227
228 if( n1 >= d ) { 228 if( n1 >= d ) {
229 n1 -= d; 229 n1 -= d;
230 most_significant_q_limb = 1; 230 most_significant_q_limb = 1;
231 } 231 }
232 232
233 qp += qextra_limbs; 233 qp += qextra_limbs;
234 for( i = nsize - 2; i >= 0; i--) 234 for( i = nsize - 2; i >= 0; i--)
235 udiv_qrnnd( qp[i], n1, n1, np[i], d ); 235 udiv_qrnnd( qp[i], n1, n1, np[i], d );
236 qp -= qextra_limbs; 236 qp -= qextra_limbs;
237 237
238 for( i = qextra_limbs - 1; i >= 0; i-- ) 238 for( i = qextra_limbs - 1; i >= 0; i-- )
239 udiv_qrnnd (qp[i], n1, n1, 0, d); 239 udiv_qrnnd (qp[i], n1, n1, 0, d);
240 240
241 np[0] = n1; 241 np[0] = n1;
242 } 242 }
243 break; 243 break;
244 244
245 case 2: 245 case 2:
246 { 246 {
247 mpi_size_t i; 247 mpi_size_t i;
248 mpi_limb_t n1, n0, n2; 248 mpi_limb_t n1, n0, n2;
249 mpi_limb_t d1, d0; 249 mpi_limb_t d1, d0;
250 250
251 np += nsize - 2; 251 np += nsize - 2;
252 d1 = dp[1]; 252 d1 = dp[1];
253 d0 = dp[0]; 253 d0 = dp[0];
254 n1 = np[1]; 254 n1 = np[1];
255 n0 = np[0]; 255 n0 = np[0];
256 256
257 if( n1 >= d1 && (n1 > d1 || n0 >= d0) ) { 257 if( n1 >= d1 && (n1 > d1 || n0 >= d0) ) {
258 sub_ddmmss (n1, n0, n1, n0, d1, d0); 258 sub_ddmmss (n1, n0, n1, n0, d1, d0);
259 most_significant_q_limb = 1; 259 most_significant_q_limb = 1;
260 } 260 }
261 261
262 for( i = qextra_limbs + nsize - 2 - 1; i >= 0; i-- ) { 262 for( i = qextra_limbs + nsize - 2 - 1; i >= 0; i-- ) {
263 mpi_limb_t q; 263 mpi_limb_t q;
264 mpi_limb_t r; 264 mpi_limb_t r;
265 265
266 if( i >= qextra_limbs ) 266 if( i >= qextra_limbs )
267 np--; 267 np--;
268 else 268 else
269 np[0] = 0; 269 np[0] = 0;
270 270
271 if( n1 == d1 ) { 271 if( n1 == d1 ) {
272 /* Q should be either 111..111 or 111..110. Need special 272 /* Q should be either 111..111 or 111..110. Need special
273 * treatment of this rare case as normal division would 273 * treatment of this rare case as normal division would
274 * give overflow. */ 274 * give overflow. */
275 q = ~(mpi_limb_t)0; 275 q = ~(mpi_limb_t)0;
276 276
277 r = n0 + d1; 277 r = n0 + d1;
278 if( r < d1 ) { /* Carry in the addition? */ 278 if( r < d1 ) { /* Carry in the addition? */
279 add_ssaaaa( n1, n0, r - d0, np[0], 0, d0 ); 279 add_ssaaaa( n1, n0, r - d0, np[0], 0, d0 );
280 qp[i] = q; 280 qp[i] = q;
281 continue; 281 continue;
282 } 282 }
283 n1 = d0 - (d0 != 0?1:0); 283 n1 = d0 - (d0 != 0?1:0);
284 n0 = -d0; 284 n0 = -d0;
285 } 285 }
286 else { 286 else {
287 udiv_qrnnd (q, r, n1, n0, d1); 287 udiv_qrnnd (q, r, n1, n0, d1);
288 umul_ppmm (n1, n0, d0, q); 288 umul_ppmm (n1, n0, d0, q);
289 } 289 }
290 290
291 n2 = np[0]; 291 n2 = np[0];
292 q_test: 292 q_test:
293 if( n1 > r || (n1 == r && n0 > n2) ) { 293 if( n1 > r || (n1 == r && n0 > n2) ) {
294 /* The estimated Q was too large. */ 294 /* The estimated Q was too large. */
295 q--; 295 q--;
296 sub_ddmmss (n1, n0, n1, n0, 0, d0); 296 sub_ddmmss (n1, n0, n1, n0, 0, d0);
297 r += d1; 297 r += d1;
298 if( r >= d1 ) /* If not carry, test Q again. */ 298 if( r >= d1 ) /* If not carry, test Q again. */
299 goto q_test; 299 goto q_test;
300 } 300 }
301 301
302 qp[i] = q; 302 qp[i] = q;
303 sub_ddmmss (n1, n0, r, n2, n1, n0); 303 sub_ddmmss (n1, n0, r, n2, n1, n0);
304 } 304 }
305 np[1] = n1; 305 np[1] = n1;
306 np[0] = n0; 306 np[0] = n0;
307 } 307 }
308 break; 308 break;
309 309
310 default: 310 default:
311 { 311 {
312 mpi_size_t i; 312 mpi_size_t i;
313 mpi_limb_t dX, d1, n0; 313 mpi_limb_t dX, d1, n0;
314 314
315 np += nsize - dsize; 315 np += nsize - dsize;
316 dX = dp[dsize - 1]; 316 dX = dp[dsize - 1];
317 d1 = dp[dsize - 2]; 317 d1 = dp[dsize - 2];
318 n0 = np[dsize - 1]; 318 n0 = np[dsize - 1];
319 319
320 if( n0 >= dX ) { 320 if( n0 >= dX ) {
321 if(n0 > dX || _gcry_mpih_cmp(np, dp, dsize - 1) >= 0 ) { 321 if(n0 > dX || _gcry_mpih_cmp(np, dp, dsize - 1) >= 0 ) {
322 _gcry_mpih_sub_n(np, np, dp, dsize); 322 _gcry_mpih_sub_n(np, np, dp, dsize);
323 n0 = np[dsize - 1]; 323 n0 = np[dsize - 1];
324 most_significant_q_limb = 1; 324 most_significant_q_limb = 1;
325 } 325 }
326 } 326 }
327 327
328 for( i = qextra_limbs + nsize - dsize - 1; i >= 0; i--) { 328 for( i = qextra_limbs + nsize - dsize - 1; i >= 0; i--) {
329 mpi_limb_t q; 329 mpi_limb_t q;
330 mpi_limb_t n1, n2; 330 mpi_limb_t n1, n2;
331 mpi_limb_t cy_limb; 331 mpi_limb_t cy_limb;
332 332
333 if( i >= qextra_limbs ) { 333 if( i >= qextra_limbs ) {
334 np--; 334 np--;
335 n2 = np[dsize]; 335 n2 = np[dsize];
336 } 336 }
337 else { 337 else {
338 n2 = np[dsize - 1]; 338 n2 = np[dsize - 1];
339 MPN_COPY_DECR (np + 1, np, dsize - 1); 339 MPN_COPY_DECR (np + 1, np, dsize - 1);
340 np[0] = 0; 340 np[0] = 0;
341 } 341 }
342 342
343 if( n0 == dX ) { 343 if( n0 == dX ) {
344 /* This might over-estimate q, but it's probably not worth 344 /* This might over-estimate q, but it's probably not worth
345 * the extra code here to find out. */ 345 * the extra code here to find out. */
346 q = ~(mpi_limb_t)0; 346 q = ~(mpi_limb_t)0;
347 } 347 }
348 else { 348 else {
349 mpi_limb_t r; 349 mpi_limb_t r;
350 350
351 udiv_qrnnd(q, r, n0, np[dsize - 1], dX); 351 udiv_qrnnd(q, r, n0, np[dsize - 1], dX);
352 umul_ppmm(n1, n0, d1, q); 352 umul_ppmm(n1, n0, d1, q);
353 353
354 while( n1 > r || (n1 == r && n0 > np[dsize - 2])) { 354 while( n1 > r || (n1 == r && n0 > np[dsize - 2])) {
355 q--; 355 q--;
356 r += dX; 356 r += dX;
357 if( r < dX ) /* I.e. "carry in previous addition?" */ 357 if( r < dX ) /* I.e. "carry in previous addition?" */
358 break; 358 break;
359 n1 -= n0 < d1; 359 n1 -= n0 < d1;
360 n0 -= d1; 360 n0 -= d1;
361 } 361 }
362 } 362 }
363 363
364 /* Possible optimization: We already have (q * n0) and (1 * n1) 364 /* Possible optimization: We already have (q * n0) and (1 * n1)
365 * after the calculation of q. Taking advantage of that, we 365 * after the calculation of q. Taking advantage of that, we
366 * could make this loop make two iterations less. */ 366 * could make this loop make two iterations less. */
367 cy_limb = _gcry_mpih_submul_1(np, dp, dsize, q); 367 cy_limb = _gcry_mpih_submul_1(np, dp, dsize, q);
368 368
369 if( n2 != cy_limb ) { 369 if( n2 != cy_limb ) {
370 _gcry_mpih_add_n(np, np, dp, dsize); 370 _gcry_mpih_add_n(np, np, dp, dsize);
371 q--; 371 q--;
372 } 372 }
373 373
374 qp[i] = q; 374 qp[i] = q;
375 n0 = np[dsize - 1]; 375 n0 = np[dsize - 1];
376 } 376 }
377 } 377 }
378 } 378 }
379 379
380 return most_significant_q_limb; 380 return most_significant_q_limb;
381} 381}
382 382
383 383
384/**************** 384/****************
385 * Divide (DIVIDEND_PTR,,DIVIDEND_SIZE) by DIVISOR_LIMB. 385 * Divide (DIVIDEND_PTR,,DIVIDEND_SIZE) by DIVISOR_LIMB.
386 * Write DIVIDEND_SIZE limbs of quotient at QUOT_PTR. 386 * Write DIVIDEND_SIZE limbs of quotient at QUOT_PTR.
387 * Return the single-limb remainder. 387 * Return the single-limb remainder.
388 * There are no constraints on the value of the divisor. 388 * There are no constraints on the value of the divisor.
389 * 389 *
390 * QUOT_PTR and DIVIDEND_PTR might point to the same limb. 390 * QUOT_PTR and DIVIDEND_PTR might point to the same limb.
391 */ 391 */
392 392
393mpi_limb_t 393mpi_limb_t
394_gcry_mpih_divmod_1( mpi_ptr_t quot_ptr, 394_gcry_mpih_divmod_1( mpi_ptr_t quot_ptr,
395 mpi_ptr_t dividend_ptr, mpi_size_t dividend_size, 395 mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
396 mpi_limb_t divisor_limb) 396 mpi_limb_t divisor_limb)
397{ 397{
398 mpi_size_t i; 398 mpi_size_t i;
399 mpi_limb_t n1, n0, r; 399 mpi_limb_t n1, n0, r;
400 int dummy; 400 int dummy;
401 401
402 if( !dividend_size ) 402 if( !dividend_size )
403 return 0; 403 return 0;
404 404
405 /* If multiplication is much faster than division, and the 405 /* If multiplication is much faster than division, and the
406 * dividend is large, pre-invert the divisor, and use 406 * dividend is large, pre-invert the divisor, and use
407 * only multiplications in the inner loop. 407 * only multiplications in the inner loop.
408 * 408 *
409 * This test should be read: 409 * This test should be read:
410 * Does it ever help to use udiv_qrnnd_preinv? 410 * Does it ever help to use udiv_qrnnd_preinv?
411 * && Does what we save compensate for the inversion overhead? 411 * && Does what we save compensate for the inversion overhead?
412 */ 412 */
413 if( UDIV_TIME > (2 * UMUL_TIME + 6) 413 if( UDIV_TIME > (2 * UMUL_TIME + 6)
414 && (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME ) { 414 && (UDIV_TIME - (2 * UMUL_TIME + 6)) * dividend_size > UDIV_TIME ) {
415 int normalization_steps; 415 int normalization_steps;
416 416
417 count_leading_zeros( normalization_steps, divisor_limb ); 417 count_leading_zeros( normalization_steps, divisor_limb );
418 if( normalization_steps ) { 418 if( normalization_steps ) {
419 mpi_limb_t divisor_limb_inverted; 419 mpi_limb_t divisor_limb_inverted;
420 420
421 divisor_limb <<= normalization_steps; 421 divisor_limb <<= normalization_steps;
422 422
423 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The 423 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The
424 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the 424 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the
425 * most significant bit (with weight 2**N) implicit. 425 * most significant bit (with weight 2**N) implicit.
426 */ 426 */
427 /* Special case for DIVISOR_LIMB == 100...000. */ 427 /* Special case for DIVISOR_LIMB == 100...000. */
428 if( !(divisor_limb << 1) ) 428 if( !(divisor_limb << 1) )
429 divisor_limb_inverted = ~(mpi_limb_t)0; 429 divisor_limb_inverted = ~(mpi_limb_t)0;
430 else 430 else
431 udiv_qrnnd(divisor_limb_inverted, dummy, 431 udiv_qrnnd(divisor_limb_inverted, dummy,
432 -divisor_limb, 0, divisor_limb); 432 -divisor_limb, 0, divisor_limb);
433 433
434 n1 = dividend_ptr[dividend_size - 1]; 434 n1 = dividend_ptr[dividend_size - 1];
435 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps); 435 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps);
436 436
437 /* Possible optimization: 437 /* Possible optimization:
438 * if (r == 0 438 * if (r == 0
439 * && divisor_limb > ((n1 << normalization_steps) 439 * && divisor_limb > ((n1 << normalization_steps)
440 * | (dividend_ptr[dividend_size - 2] >> ...))) 440 * | (dividend_ptr[dividend_size - 2] >> ...)))
441 * ...one division less... 441 * ...one division less...
442 */ 442 */
443 for( i = dividend_size - 2; i >= 0; i--) { 443 for( i = dividend_size - 2; i >= 0; i--) {
444 n0 = dividend_ptr[i]; 444 n0 = dividend_ptr[i];
445 UDIV_QRNND_PREINV( quot_ptr[i + 1], r, r, 445 UDIV_QRNND_PREINV( quot_ptr[i + 1], r, r,
446 ((n1 << normalization_steps) 446 ((n1 << normalization_steps)
447 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))), 447 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))),
448 divisor_limb, divisor_limb_inverted); 448 divisor_limb, divisor_limb_inverted);
449 n1 = n0; 449 n1 = n0;
450 } 450 }
451 UDIV_QRNND_PREINV( quot_ptr[0], r, r, 451 UDIV_QRNND_PREINV( quot_ptr[0], r, r,
452 n1 << normalization_steps, 452 n1 << normalization_steps,
453 divisor_limb, divisor_limb_inverted); 453 divisor_limb, divisor_limb_inverted);
454 return r >> normalization_steps; 454 return r >> normalization_steps;
455 } 455 }
456 else { 456 else {
457 mpi_limb_t divisor_limb_inverted; 457 mpi_limb_t divisor_limb_inverted;
458 458
459 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The 459 /* Compute (2**2N - 2**N * DIVISOR_LIMB) / DIVISOR_LIMB. The
460 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the 460 * result is a (N+1)-bit approximation to 1/DIVISOR_LIMB, with the
461 * most significant bit (with weight 2**N) implicit. 461 * most significant bit (with weight 2**N) implicit.
462 */ 462 */
463 /* Special case for DIVISOR_LIMB == 100...000. */ 463 /* Special case for DIVISOR_LIMB == 100...000. */
464 if( !(divisor_limb << 1) ) 464 if( !(divisor_limb << 1) )
465 divisor_limb_inverted = ~(mpi_limb_t) 0; 465 divisor_limb_inverted = ~(mpi_limb_t) 0;
466 else 466 else
467 udiv_qrnnd(divisor_limb_inverted, dummy, 467 udiv_qrnnd(divisor_limb_inverted, dummy,
468 -divisor_limb, 0, divisor_limb); 468 -divisor_limb, 0, divisor_limb);
469 469
470 i = dividend_size - 1; 470 i = dividend_size - 1;
471 r = dividend_ptr[i]; 471 r = dividend_ptr[i];
472 472
473 if( r >= divisor_limb ) 473 if( r >= divisor_limb )
474 r = 0; 474 r = 0;
475 else 475 else
476 quot_ptr[i--] = 0; 476 quot_ptr[i--] = 0;
477 477
478 for( ; i >= 0; i-- ) { 478 for( ; i >= 0; i-- ) {
479 n0 = dividend_ptr[i]; 479 n0 = dividend_ptr[i];
480 UDIV_QRNND_PREINV( quot_ptr[i], r, r, 480 UDIV_QRNND_PREINV( quot_ptr[i], r, r,
481 n0, divisor_limb, divisor_limb_inverted); 481 n0, divisor_limb, divisor_limb_inverted);
482 } 482 }
483 return r; 483 return r;
484 } 484 }
485 } 485 }
486 else { 486 else {
487 if(UDIV_NEEDS_NORMALIZATION) { 487 if(UDIV_NEEDS_NORMALIZATION) {
488 int normalization_steps; 488 int normalization_steps;
489 489
490 count_leading_zeros (normalization_steps, divisor_limb); 490 count_leading_zeros (normalization_steps, divisor_limb);
491 if( normalization_steps ) { 491 if( normalization_steps ) {
492 divisor_limb <<= normalization_steps; 492 divisor_limb <<= normalization_steps;
493 493
494 n1 = dividend_ptr[dividend_size - 1]; 494 n1 = dividend_ptr[dividend_size - 1];
495 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps); 495 r = n1 >> (BITS_PER_MPI_LIMB - normalization_steps);
496 496
497 /* Possible optimization: 497 /* Possible optimization:
498 * if (r == 0 498 * if (r == 0
499 * && divisor_limb > ((n1 << normalization_steps) 499 * && divisor_limb > ((n1 << normalization_steps)
500 * | (dividend_ptr[dividend_size - 2] >> ...))) 500 * | (dividend_ptr[dividend_size - 2] >> ...)))
501 * ...one division less... 501 * ...one division less...
502 */ 502 */
503 for( i = dividend_size - 2; i >= 0; i--) { 503 for( i = dividend_size - 2; i >= 0; i--) {
504 n0 = dividend_ptr[i]; 504 n0 = dividend_ptr[i];
505 udiv_qrnnd (quot_ptr[i + 1], r, r, 505 udiv_qrnnd (quot_ptr[i + 1], r, r,
506 ((n1 << normalization_steps) 506 ((n1 << normalization_steps)
507 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))), 507 | (n0 >> (BITS_PER_MPI_LIMB - normalization_steps))),
508 divisor_limb); 508 divisor_limb);
509 n1 = n0; 509 n1 = n0;
510 } 510 }
511 udiv_qrnnd (quot_ptr[0], r, r, 511 udiv_qrnnd (quot_ptr[0], r, r,
512 n1 << normalization_steps, 512 n1 << normalization_steps,
513 divisor_limb); 513 divisor_limb);
514 return r >> normalization_steps; 514 return r >> normalization_steps;
515 } 515 }
516 } 516 }
517 /* No normalization needed, either because udiv_qrnnd doesn't require 517 /* No normalization needed, either because udiv_qrnnd doesn't require
518 * it, or because DIVISOR_LIMB is already normalized. */ 518 * it, or because DIVISOR_LIMB is already normalized. */
519 i = dividend_size - 1; 519 i = dividend_size - 1;
520 r = dividend_ptr[i]; 520 r = dividend_ptr[i];
521 521
522 if(r >= divisor_limb) 522 if(r >= divisor_limb)
523 r = 0; 523 r = 0;
524 else 524 else
525 quot_ptr[i--] = 0; 525 quot_ptr[i--] = 0;
526 526
527 for(; i >= 0; i--) { 527 for(; i >= 0; i--) {
528 n0 = dividend_ptr[i]; 528 n0 = dividend_ptr[i];
529 udiv_qrnnd( quot_ptr[i], r, r, n0, divisor_limb ); 529 udiv_qrnnd( quot_ptr[i], r, r, n0, divisor_limb );
530 } 530 }
531 return r; 531 return r;
532 } 532 }
533} 533}
534 534
535 535
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-mul.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-mul.c
index b8fb2f9..e1f6f58 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-mul.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpih-mul.c
@@ -1,530 +1,530 @@
1/* mpih-mul.c - MPI helper functions 1/* mpih-mul.c - MPI helper functions
2 * Copyright (C) 1994, 1996, 1998, 1999, 2000, 2 * Copyright (C) 1994, 1996, 1998, 1999, 2000,
3 * 2001, 2002 Free Software Foundation, Inc. 3 * 2001, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 * 20 *
21 * Note: This code is heavily based on the GNU MP Library. 21 * Note: This code is heavily based on the GNU MP Library.
22 * Actually it's the same code with only minor changes in the 22 * Actually it's the same code with only minor changes in the
23 * way the data is stored; this is to support the abstraction 23 * way the data is stored; this is to support the abstraction
24 * of an optional secure memory allocation which may be used 24 * of an optional secure memory allocation which may be used
25 * to avoid revealing of sensitive data due to paging etc. 25 * to avoid revealing of sensitive data due to paging etc.
26 */ 26 */
27 27
28#include <config.h> 28#include <config.h>
29#include <stdio.h> 29#include <stdio.h>
30#include <stdlib.h> 30#include <stdlib.h>
31#include <string.h> 31#include <string.h>
32#include "mpi-internal.h" 32#include "mpi-internal.h"
33#include "longlong.h" 33#include "longlong.h"
34#include "g10lib.h" 34#include "g10lib.h"
35 35
36#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \ 36#define MPN_MUL_N_RECURSE(prodp, up, vp, size, tspace) \
37 do { \ 37 do { \
38 if( (size) < KARATSUBA_THRESHOLD ) \ 38 if( (size) < KARATSUBA_THRESHOLD ) \
39 mul_n_basecase (prodp, up, vp, size); \ 39 mul_n_basecase (prodp, up, vp, size); \
40 else \ 40 else \
41 mul_n (prodp, up, vp, size, tspace); \ 41 mul_n (prodp, up, vp, size, tspace); \
42 } while (0); 42 } while (0);
43 43
44#define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \ 44#define MPN_SQR_N_RECURSE(prodp, up, size, tspace) \
45 do { \ 45 do { \
46 if ((size) < KARATSUBA_THRESHOLD) \ 46 if ((size) < KARATSUBA_THRESHOLD) \
47 _gcry_mpih_sqr_n_basecase (prodp, up, size); \ 47 _gcry_mpih_sqr_n_basecase (prodp, up, size); \
48 else \ 48 else \
49 _gcry_mpih_sqr_n (prodp, up, size, tspace); \ 49 _gcry_mpih_sqr_n (prodp, up, size, tspace); \
50 } while (0); 50 } while (0);
51 51
52 52
53 53
54 54
55/* Multiply the natural numbers u (pointed to by UP) and v (pointed to by VP), 55/* Multiply the natural numbers u (pointed to by UP) and v (pointed to by VP),
56 * both with SIZE limbs, and store the result at PRODP. 2 * SIZE limbs are 56 * both with SIZE limbs, and store the result at PRODP. 2 * SIZE limbs are
57 * always stored. Return the most significant limb. 57 * always stored. Return the most significant limb.
58 * 58 *
59 * Argument constraints: 59 * Argument constraints:
60 * 1. PRODP != UP and PRODP != VP, i.e. the destination 60 * 1. PRODP != UP and PRODP != VP, i.e. the destination
61 * must be distinct from the multiplier and the multiplicand. 61 * must be distinct from the multiplier and the multiplicand.
62 * 62 *
63 * 63 *
64 * Handle simple cases with traditional multiplication. 64 * Handle simple cases with traditional multiplication.
65 * 65 *
66 * This is the most critical code of multiplication. All multiplies rely 66 * This is the most critical code of multiplication. All multiplies rely
67 * on this, both small and huge. Small ones arrive here immediately. Huge 67 * on this, both small and huge. Small ones arrive here immediately. Huge
68 * ones arrive here as this is the base case for Karatsuba's recursive 68 * ones arrive here as this is the base case for Karatsuba's recursive
69 * algorithm below. 69 * algorithm below.
70 */ 70 */
71 71
72static mpi_limb_t 72static mpi_limb_t
73mul_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up, 73mul_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up,
74 mpi_ptr_t vp, mpi_size_t size) 74 mpi_ptr_t vp, mpi_size_t size)
75{ 75{
76 mpi_size_t i; 76 mpi_size_t i;
77 mpi_limb_t cy; 77 mpi_limb_t cy;
78 mpi_limb_t v_limb; 78 mpi_limb_t v_limb;
79 79
80 /* Multiply by the first limb in V separately, as the result can be 80 /* Multiply by the first limb in V separately, as the result can be
81 * stored (not added) to PROD. We also avoid a loop for zeroing. */ 81 * stored (not added) to PROD. We also avoid a loop for zeroing. */
82 v_limb = vp[0]; 82 v_limb = vp[0];
83 if( v_limb <= 1 ) { 83 if( v_limb <= 1 ) {
84 if( v_limb == 1 ) 84 if( v_limb == 1 )
85 MPN_COPY( prodp, up, size ); 85 MPN_COPY( prodp, up, size );
86 else 86 else
87 MPN_ZERO( prodp, size ); 87 MPN_ZERO( prodp, size );
88 cy = 0; 88 cy = 0;
89 } 89 }
90 else 90 else
91 cy = _gcry_mpih_mul_1( prodp, up, size, v_limb ); 91 cy = _gcry_mpih_mul_1( prodp, up, size, v_limb );
92 92
93 prodp[size] = cy; 93 prodp[size] = cy;
94 prodp++; 94 prodp++;
95 95
96 /* For each iteration in the outer loop, multiply one limb from 96 /* For each iteration in the outer loop, multiply one limb from
97 * U with one limb from V, and add it to PROD. */ 97 * U with one limb from V, and add it to PROD. */
98 for( i = 1; i < size; i++ ) { 98 for( i = 1; i < size; i++ ) {
99 v_limb = vp[i]; 99 v_limb = vp[i];
100 if( v_limb <= 1 ) { 100 if( v_limb <= 1 ) {
101 cy = 0; 101 cy = 0;
102 if( v_limb == 1 ) 102 if( v_limb == 1 )
103 cy = _gcry_mpih_add_n(prodp, prodp, up, size); 103 cy = _gcry_mpih_add_n(prodp, prodp, up, size);
104 } 104 }
105 else 105 else
106 cy = _gcry_mpih_addmul_1(prodp, up, size, v_limb); 106 cy = _gcry_mpih_addmul_1(prodp, up, size, v_limb);
107 107
108 prodp[size] = cy; 108 prodp[size] = cy;
109 prodp++; 109 prodp++;
110 } 110 }
111 111
112 return cy; 112 return cy;
113} 113}
114 114
115 115
116static void 116static void
117mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, 117mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
118 mpi_size_t size, mpi_ptr_t tspace ) 118 mpi_size_t size, mpi_ptr_t tspace )
119{ 119{
120 if( size & 1 ) { 120 if( size & 1 ) {
121 /* The size is odd, and the code below doesn't handle that. 121 /* The size is odd, and the code below doesn't handle that.
122 * Multiply the least significant (size - 1) limbs with a recursive 122 * Multiply the least significant (size - 1) limbs with a recursive
123 * call, and handle the most significant limb of S1 and S2 123 * call, and handle the most significant limb of S1 and S2
124 * separately. 124 * separately.
125 * A slightly faster way to do this would be to make the Karatsuba 125 * A slightly faster way to do this would be to make the Karatsuba
126 * code below behave as if the size were even, and let it check for 126 * code below behave as if the size were even, and let it check for
127 * odd size in the end. I.e., in essence move this code to the end. 127 * odd size in the end. I.e., in essence move this code to the end.
128 * Doing so would save us a recursive call, and potentially make the 128 * Doing so would save us a recursive call, and potentially make the
129 * stack grow a lot less. 129 * stack grow a lot less.
130 */ 130 */
131 mpi_size_t esize = size - 1; /* even size */ 131 mpi_size_t esize = size - 1; /* even size */
132 mpi_limb_t cy_limb; 132 mpi_limb_t cy_limb;
133 133
134 MPN_MUL_N_RECURSE( prodp, up, vp, esize, tspace ); 134 MPN_MUL_N_RECURSE( prodp, up, vp, esize, tspace );
135 cy_limb = _gcry_mpih_addmul_1( prodp + esize, up, esize, vp[esize] ); 135 cy_limb = _gcry_mpih_addmul_1( prodp + esize, up, esize, vp[esize] );
136 prodp[esize + esize] = cy_limb; 136 prodp[esize + esize] = cy_limb;
137 cy_limb = _gcry_mpih_addmul_1( prodp + esize, vp, size, up[esize] ); 137 cy_limb = _gcry_mpih_addmul_1( prodp + esize, vp, size, up[esize] );
138 prodp[esize + size] = cy_limb; 138 prodp[esize + size] = cy_limb;
139 } 139 }
140 else { 140 else {
141 /* Anatolij Alekseevich Karatsuba's divide-and-conquer algorithm. 141 /* Anatolij Alekseevich Karatsuba's divide-and-conquer algorithm.
142 * 142 *
143 * Split U in two pieces, U1 and U0, such that 143 * Split U in two pieces, U1 and U0, such that
144 * U = U0 + U1*(B**n), 144 * U = U0 + U1*(B**n),
145 * and V in V1 and V0, such that 145 * and V in V1 and V0, such that
146 * V = V0 + V1*(B**n). 146 * V = V0 + V1*(B**n).
147 * 147 *
148 * UV is then computed recursively using the identity 148 * UV is then computed recursively using the identity
149 * 149 *
150 * 2n n n n 150 * 2n n n n
151 * UV = (B + B )U V + B (U -U )(V -V ) + (B + 1)U V 151 * UV = (B + B )U V + B (U -U )(V -V ) + (B + 1)U V
152 * 1 1 1 0 0 1 0 0 152 * 1 1 1 0 0 1 0 0
153 * 153 *
154 * Where B = 2**BITS_PER_MP_LIMB. 154 * Where B = 2**BITS_PER_MP_LIMB.
155 */ 155 */
156 mpi_size_t hsize = size >> 1; 156 mpi_size_t hsize = size >> 1;
157 mpi_limb_t cy; 157 mpi_limb_t cy;
158 int negflg; 158 int negflg;
159 159
160 /* Product H. ________________ ________________ 160 /* Product H. ________________ ________________
161 * |_____U1 x V1____||____U0 x V0_____| 161 * |_____U1 x V1____||____U0 x V0_____|
162 * Put result in upper part of PROD and pass low part of TSPACE 162 * Put result in upper part of PROD and pass low part of TSPACE
163 * as new TSPACE. 163 * as new TSPACE.
164 */ 164 */
165 MPN_MUL_N_RECURSE(prodp + size, up + hsize, vp + hsize, hsize, tspace); 165 MPN_MUL_N_RECURSE(prodp + size, up + hsize, vp + hsize, hsize, tspace);
166 166
167 /* Product M. ________________ 167 /* Product M. ________________
168 * |_(U1-U0)(V0-V1)_| 168 * |_(U1-U0)(V0-V1)_|
169 */ 169 */
170 if( _gcry_mpih_cmp(up + hsize, up, hsize) >= 0 ) { 170 if( _gcry_mpih_cmp(up + hsize, up, hsize) >= 0 ) {
171 _gcry_mpih_sub_n(prodp, up + hsize, up, hsize); 171 _gcry_mpih_sub_n(prodp, up + hsize, up, hsize);
172 negflg = 0; 172 negflg = 0;
173 } 173 }
174 else { 174 else {
175 _gcry_mpih_sub_n(prodp, up, up + hsize, hsize); 175 _gcry_mpih_sub_n(prodp, up, up + hsize, hsize);
176 negflg = 1; 176 negflg = 1;
177 } 177 }
178 if( _gcry_mpih_cmp(vp + hsize, vp, hsize) >= 0 ) { 178 if( _gcry_mpih_cmp(vp + hsize, vp, hsize) >= 0 ) {
179 _gcry_mpih_sub_n(prodp + hsize, vp + hsize, vp, hsize); 179 _gcry_mpih_sub_n(prodp + hsize, vp + hsize, vp, hsize);
180 negflg ^= 1; 180 negflg ^= 1;
181 } 181 }
182 else { 182 else {
183 _gcry_mpih_sub_n(prodp + hsize, vp, vp + hsize, hsize); 183 _gcry_mpih_sub_n(prodp + hsize, vp, vp + hsize, hsize);
184 /* No change of NEGFLG. */ 184 /* No change of NEGFLG. */
185 } 185 }
186 /* Read temporary operands from low part of PROD. 186 /* Read temporary operands from low part of PROD.
187 * Put result in low part of TSPACE using upper part of TSPACE 187 * Put result in low part of TSPACE using upper part of TSPACE
188 * as new TSPACE. 188 * as new TSPACE.
189 */ 189 */
190 MPN_MUL_N_RECURSE(tspace, prodp, prodp + hsize, hsize, tspace + size); 190 MPN_MUL_N_RECURSE(tspace, prodp, prodp + hsize, hsize, tspace + size);
191 191
192 /* Add/copy product H. */ 192 /* Add/copy product H. */
193 MPN_COPY (prodp + hsize, prodp + size, hsize); 193 MPN_COPY (prodp + hsize, prodp + size, hsize);
194 cy = _gcry_mpih_add_n( prodp + size, prodp + size, 194 cy = _gcry_mpih_add_n( prodp + size, prodp + size,
195 prodp + size + hsize, hsize); 195 prodp + size + hsize, hsize);
196 196
197 /* Add product M (if NEGFLG M is a negative number) */ 197 /* Add product M (if NEGFLG M is a negative number) */
198 if(negflg) 198 if(negflg)
199 cy -= _gcry_mpih_sub_n(prodp + hsize, prodp + hsize, tspace, size); 199 cy -= _gcry_mpih_sub_n(prodp + hsize, prodp + hsize, tspace, size);
200 else 200 else
201 cy += _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace, size); 201 cy += _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace, size);
202 202
203 /* Product L. ________________ ________________ 203 /* Product L. ________________ ________________
204 * |________________||____U0 x V0_____| 204 * |________________||____U0 x V0_____|
205 * Read temporary operands from low part of PROD. 205 * Read temporary operands from low part of PROD.
206 * Put result in low part of TSPACE using upper part of TSPACE 206 * Put result in low part of TSPACE using upper part of TSPACE
207 * as new TSPACE. 207 * as new TSPACE.
208 */ 208 */
209 MPN_MUL_N_RECURSE(tspace, up, vp, hsize, tspace + size); 209 MPN_MUL_N_RECURSE(tspace, up, vp, hsize, tspace + size);
210 210
211 /* Add/copy Product L (twice) */ 211 /* Add/copy Product L (twice) */
212 212
213 cy += _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace, size); 213 cy += _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace, size);
214 if( cy ) 214 if( cy )
215 _gcry_mpih_add_1(prodp + hsize + size, prodp + hsize + size, hsize, cy); 215 _gcry_mpih_add_1(prodp + hsize + size, prodp + hsize + size, hsize, cy);
216 216
217 MPN_COPY(prodp, tspace, hsize); 217 MPN_COPY(prodp, tspace, hsize);
218 cy = _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace + hsize, hsize); 218 cy = _gcry_mpih_add_n(prodp + hsize, prodp + hsize, tspace + hsize, hsize);
219 if( cy ) 219 if( cy )
220 _gcry_mpih_add_1(prodp + size, prodp + size, size, 1); 220 _gcry_mpih_add_1(prodp + size, prodp + size, size, 1);
221 } 221 }
222} 222}
223 223
224 224
225void 225void
226_gcry_mpih_sqr_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size ) 226_gcry_mpih_sqr_n_basecase( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size )
227{ 227{
228 mpi_size_t i; 228 mpi_size_t i;
229 mpi_limb_t cy_limb; 229 mpi_limb_t cy_limb;
230 mpi_limb_t v_limb; 230 mpi_limb_t v_limb;
231 231
232 /* Multiply by the first limb in V separately, as the result can be 232 /* Multiply by the first limb in V separately, as the result can be
233 * stored (not added) to PROD. We also avoid a loop for zeroing. */ 233 * stored (not added) to PROD. We also avoid a loop for zeroing. */
234 v_limb = up[0]; 234 v_limb = up[0];
235 if( v_limb <= 1 ) { 235 if( v_limb <= 1 ) {
236 if( v_limb == 1 ) 236 if( v_limb == 1 )
237 MPN_COPY( prodp, up, size ); 237 MPN_COPY( prodp, up, size );
238 else 238 else
239 MPN_ZERO(prodp, size); 239 MPN_ZERO(prodp, size);
240 cy_limb = 0; 240 cy_limb = 0;
241 } 241 }
242 else 242 else
243 cy_limb = _gcry_mpih_mul_1( prodp, up, size, v_limb ); 243 cy_limb = _gcry_mpih_mul_1( prodp, up, size, v_limb );
244 244
245 prodp[size] = cy_limb; 245 prodp[size] = cy_limb;
246 prodp++; 246 prodp++;
247 247
248 /* For each iteration in the outer loop, multiply one limb from 248 /* For each iteration in the outer loop, multiply one limb from
249 * U with one limb from V, and add it to PROD. */ 249 * U with one limb from V, and add it to PROD. */
250 for( i=1; i < size; i++) { 250 for( i=1; i < size; i++) {
251 v_limb = up[i]; 251 v_limb = up[i];
252 if( v_limb <= 1 ) { 252 if( v_limb <= 1 ) {
253 cy_limb = 0; 253 cy_limb = 0;
254 if( v_limb == 1 ) 254 if( v_limb == 1 )
255 cy_limb = _gcry_mpih_add_n(prodp, prodp, up, size); 255 cy_limb = _gcry_mpih_add_n(prodp, prodp, up, size);
256 } 256 }
257 else 257 else
258 cy_limb = _gcry_mpih_addmul_1(prodp, up, size, v_limb); 258 cy_limb = _gcry_mpih_addmul_1(prodp, up, size, v_limb);
259 259
260 prodp[size] = cy_limb; 260 prodp[size] = cy_limb;
261 prodp++; 261 prodp++;
262 } 262 }
263} 263}
264 264
265 265
266void 266void
267_gcry_mpih_sqr_n( mpi_ptr_t prodp, 267_gcry_mpih_sqr_n( mpi_ptr_t prodp,
268 mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace) 268 mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace)
269{ 269{
270 if( size & 1 ) { 270 if( size & 1 ) {
271 /* The size is odd, and the code below doesn't handle that. 271 /* The size is odd, and the code below doesn't handle that.
272 * Multiply the least significant (size - 1) limbs with a recursive 272 * Multiply the least significant (size - 1) limbs with a recursive
273 * call, and handle the most significant limb of S1 and S2 273 * call, and handle the most significant limb of S1 and S2
274 * separately. 274 * separately.
275 * A slightly faster way to do this would be to make the Karatsuba 275 * A slightly faster way to do this would be to make the Karatsuba
276 * code below behave as if the size were even, and let it check for 276 * code below behave as if the size were even, and let it check for
277 * odd size in the end. I.e., in essence move this code to the end. 277 * odd size in the end. I.e., in essence move this code to the end.
278 * Doing so would save us a recursive call, and potentially make the 278 * Doing so would save us a recursive call, and potentially make the
279 * stack grow a lot less. 279 * stack grow a lot less.
280 */ 280 */
281 mpi_size_t esize = size - 1; /* even size */ 281 mpi_size_t esize = size - 1; /* even size */
282 mpi_limb_t cy_limb; 282 mpi_limb_t cy_limb;
283 283
284 MPN_SQR_N_RECURSE( prodp, up, esize, tspace ); 284 MPN_SQR_N_RECURSE( prodp, up, esize, tspace );
285 cy_limb = _gcry_mpih_addmul_1( prodp + esize, up, esize, up[esize] ); 285 cy_limb = _gcry_mpih_addmul_1( prodp + esize, up, esize, up[esize] );
286 prodp[esize + esize] = cy_limb; 286 prodp[esize + esize] = cy_limb;
287 cy_limb = _gcry_mpih_addmul_1( prodp + esize, up, size, up[esize] ); 287 cy_limb = _gcry_mpih_addmul_1( prodp + esize, up, size, up[esize] );
288 288
289 prodp[esize + size] = cy_limb; 289 prodp[esize + size] = cy_limb;
290 } 290 }
291 else { 291 else {
292 mpi_size_t hsize = size >> 1; 292 mpi_size_t hsize = size >> 1;
293 mpi_limb_t cy; 293 mpi_limb_t cy;
294 294
295 /* Product H. ________________ ________________ 295 /* Product H. ________________ ________________
296 * |_____U1 x U1____||____U0 x U0_____| 296 * |_____U1 x U1____||____U0 x U0_____|
297 * Put result in upper part of PROD and pass low part of TSPACE 297 * Put result in upper part of PROD and pass low part of TSPACE
298 * as new TSPACE. 298 * as new TSPACE.
299 */ 299 */
300 MPN_SQR_N_RECURSE(prodp + size, up + hsize, hsize, tspace); 300 MPN_SQR_N_RECURSE(prodp + size, up + hsize, hsize, tspace);
301 301
302 /* Product M. ________________ 302 /* Product M. ________________
303 * |_(U1-U0)(U0-U1)_| 303 * |_(U1-U0)(U0-U1)_|
304 */ 304 */
305 if( _gcry_mpih_cmp( up + hsize, up, hsize) >= 0 ) 305 if( _gcry_mpih_cmp( up + hsize, up, hsize) >= 0 )
306 _gcry_mpih_sub_n( prodp, up + hsize, up, hsize); 306 _gcry_mpih_sub_n( prodp, up + hsize, up, hsize);
307 else 307 else
308 _gcry_mpih_sub_n (prodp, up, up + hsize, hsize); 308 _gcry_mpih_sub_n (prodp, up, up + hsize, hsize);
309 309
310 /* Read temporary operands from low part of PROD. 310 /* Read temporary operands from low part of PROD.
311 * Put result in low part of TSPACE using upper part of TSPACE 311 * Put result in low part of TSPACE using upper part of TSPACE
312 * as new TSPACE. */ 312 * as new TSPACE. */
313 MPN_SQR_N_RECURSE(tspace, prodp, hsize, tspace + size); 313 MPN_SQR_N_RECURSE(tspace, prodp, hsize, tspace + size);
314 314
315 /* Add/copy product H */ 315 /* Add/copy product H */
316 MPN_COPY(prodp + hsize, prodp + size, hsize); 316 MPN_COPY(prodp + hsize, prodp + size, hsize);
317 cy = _gcry_mpih_add_n(prodp + size, prodp + size, 317 cy = _gcry_mpih_add_n(prodp + size, prodp + size,
318 prodp + size + hsize, hsize); 318 prodp + size + hsize, hsize);
319 319
320 /* Add product M (if NEGFLG M is a negative number). */ 320 /* Add product M (if NEGFLG M is a negative number). */
321 cy -= _gcry_mpih_sub_n (prodp + hsize, prodp + hsize, tspace, size); 321 cy -= _gcry_mpih_sub_n (prodp + hsize, prodp + hsize, tspace, size);
322 322
323 /* Product L. ________________ ________________ 323 /* Product L. ________________ ________________
324 * |________________||____U0 x U0_____| 324 * |________________||____U0 x U0_____|
325 * Read temporary operands from low part of PROD. 325 * Read temporary operands from low part of PROD.
326 * Put result in low part of TSPACE using upper part of TSPACE 326 * Put result in low part of TSPACE using upper part of TSPACE
327 * as new TSPACE. */ 327 * as new TSPACE. */
328 MPN_SQR_N_RECURSE (tspace, up, hsize, tspace + size); 328 MPN_SQR_N_RECURSE (tspace, up, hsize, tspace + size);
329 329
330 /* Add/copy Product L (twice). */ 330 /* Add/copy Product L (twice). */
331 cy += _gcry_mpih_add_n (prodp + hsize, prodp + hsize, tspace, size); 331 cy += _gcry_mpih_add_n (prodp + hsize, prodp + hsize, tspace, size);
332 if( cy ) 332 if( cy )
333 _gcry_mpih_add_1(prodp + hsize + size, prodp + hsize + size, 333 _gcry_mpih_add_1(prodp + hsize + size, prodp + hsize + size,
334 hsize, cy); 334 hsize, cy);
335 335
336 MPN_COPY(prodp, tspace, hsize); 336 MPN_COPY(prodp, tspace, hsize);
337 cy = _gcry_mpih_add_n (prodp + hsize, prodp + hsize, tspace + hsize, hsize); 337 cy = _gcry_mpih_add_n (prodp + hsize, prodp + hsize, tspace + hsize, hsize);
338 if( cy ) 338 if( cy )
339 _gcry_mpih_add_1 (prodp + size, prodp + size, size, 1); 339 _gcry_mpih_add_1 (prodp + size, prodp + size, size, 1);
340 } 340 }
341} 341}
342 342
343 343
344/* This should be made into an inline function in gmp.h. */ 344/* This should be made into an inline function in gmp.h. */
345void 345void
346_gcry_mpih_mul_n( mpi_ptr_t prodp, 346_gcry_mpih_mul_n( mpi_ptr_t prodp,
347 mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size) 347 mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size)
348{ 348{
349 int secure; 349 int secure;
350 350
351 if( up == vp ) { 351 if( up == vp ) {
352 if( size < KARATSUBA_THRESHOLD ) 352 if( size < KARATSUBA_THRESHOLD )
353 _gcry_mpih_sqr_n_basecase( prodp, up, size ); 353 _gcry_mpih_sqr_n_basecase( prodp, up, size );
354 else { 354 else {
355 mpi_ptr_t tspace; 355 mpi_ptr_t tspace;
356 secure = gcry_is_secure( up ); 356 secure = gcry_is_secure( up );
357 tspace = mpi_alloc_limb_space( 2 * size, secure ); 357 tspace = mpi_alloc_limb_space( 2 * size, secure );
358 _gcry_mpih_sqr_n( prodp, up, size, tspace ); 358 _gcry_mpih_sqr_n( prodp, up, size, tspace );
359 _gcry_mpi_free_limb_space (tspace, 2 * size ); 359 _gcry_mpi_free_limb_space (tspace, 2 * size );
360 } 360 }
361 } 361 }
362 else { 362 else {
363 if( size < KARATSUBA_THRESHOLD ) 363 if( size < KARATSUBA_THRESHOLD )
364 mul_n_basecase( prodp, up, vp, size ); 364 mul_n_basecase( prodp, up, vp, size );
365 else { 365 else {
366 mpi_ptr_t tspace; 366 mpi_ptr_t tspace;
367 secure = gcry_is_secure( up ) || gcry_is_secure( vp ); 367 secure = gcry_is_secure( up ) || gcry_is_secure( vp );
368 tspace = mpi_alloc_limb_space( 2 * size, secure ); 368 tspace = mpi_alloc_limb_space( 2 * size, secure );
369 mul_n (prodp, up, vp, size, tspace); 369 mul_n (prodp, up, vp, size, tspace);
370 _gcry_mpi_free_limb_space (tspace, 2 * size ); 370 _gcry_mpi_free_limb_space (tspace, 2 * size );
371 } 371 }
372 } 372 }
373} 373}
374 374
375 375
376 376
377void 377void
378_gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp, 378_gcry_mpih_mul_karatsuba_case( mpi_ptr_t prodp,
379 mpi_ptr_t up, mpi_size_t usize, 379 mpi_ptr_t up, mpi_size_t usize,
380 mpi_ptr_t vp, mpi_size_t vsize, 380 mpi_ptr_t vp, mpi_size_t vsize,
381 struct karatsuba_ctx *ctx ) 381 struct karatsuba_ctx *ctx )
382{ 382{
383 mpi_limb_t cy; 383 mpi_limb_t cy;
384 384
385 if( !ctx->tspace || ctx->tspace_size < vsize ) { 385 if( !ctx->tspace || ctx->tspace_size < vsize ) {
386 if( ctx->tspace ) 386 if( ctx->tspace )
387 _gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs ); 387 _gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs );
388 ctx->tspace_nlimbs = 2 * vsize; 388 ctx->tspace_nlimbs = 2 * vsize;
389 ctx->tspace = mpi_alloc_limb_space( 2 * vsize, 389 ctx->tspace = mpi_alloc_limb_space( 2 * vsize,
390 (gcry_is_secure( up ) 390 (gcry_is_secure( up )
391 || gcry_is_secure( vp )) ); 391 || gcry_is_secure( vp )) );
392 ctx->tspace_size = vsize; 392 ctx->tspace_size = vsize;
393 } 393 }
394 394
395 MPN_MUL_N_RECURSE( prodp, up, vp, vsize, ctx->tspace ); 395 MPN_MUL_N_RECURSE( prodp, up, vp, vsize, ctx->tspace );
396 396
397 prodp += vsize; 397 prodp += vsize;
398 up += vsize; 398 up += vsize;
399 usize -= vsize; 399 usize -= vsize;
400 if( usize >= vsize ) { 400 if( usize >= vsize ) {
401 if( !ctx->tp || ctx->tp_size < vsize ) { 401 if( !ctx->tp || ctx->tp_size < vsize ) {
402 if( ctx->tp ) 402 if( ctx->tp )
403 _gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs ); 403 _gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs );
404 ctx->tp_nlimbs = 2 * vsize; 404 ctx->tp_nlimbs = 2 * vsize;
405 ctx->tp = mpi_alloc_limb_space( 2 * vsize, gcry_is_secure( up ) 405 ctx->tp = mpi_alloc_limb_space( 2 * vsize, gcry_is_secure( up )
406 || gcry_is_secure( vp ) ); 406 || gcry_is_secure( vp ) );
407 ctx->tp_size = vsize; 407 ctx->tp_size = vsize;
408 } 408 }
409 409
410 do { 410 do {
411 MPN_MUL_N_RECURSE( ctx->tp, up, vp, vsize, ctx->tspace ); 411 MPN_MUL_N_RECURSE( ctx->tp, up, vp, vsize, ctx->tspace );
412 cy = _gcry_mpih_add_n( prodp, prodp, ctx->tp, vsize ); 412 cy = _gcry_mpih_add_n( prodp, prodp, ctx->tp, vsize );
413 _gcry_mpih_add_1( prodp + vsize, ctx->tp + vsize, vsize, cy ); 413 _gcry_mpih_add_1( prodp + vsize, ctx->tp + vsize, vsize, cy );
414 prodp += vsize; 414 prodp += vsize;
415 up += vsize; 415 up += vsize;
416 usize -= vsize; 416 usize -= vsize;
417 } while( usize >= vsize ); 417 } while( usize >= vsize );
418 } 418 }
419 419
420 if( usize ) { 420 if( usize ) {
421 if( usize < KARATSUBA_THRESHOLD ) { 421 if( usize < KARATSUBA_THRESHOLD ) {
422 _gcry_mpih_mul( ctx->tspace, vp, vsize, up, usize ); 422 _gcry_mpih_mul( ctx->tspace, vp, vsize, up, usize );
423 } 423 }
424 else { 424 else {
425 if( !ctx->next ) { 425 if( !ctx->next ) {
426 ctx->next = gcry_xcalloc( 1, sizeof *ctx ); 426 ctx->next = gcry_xcalloc( 1, sizeof *ctx );
427 } 427 }
428 _gcry_mpih_mul_karatsuba_case( ctx->tspace, 428 _gcry_mpih_mul_karatsuba_case( ctx->tspace,
429 vp, vsize, 429 vp, vsize,
430 up, usize, 430 up, usize,
431 ctx->next ); 431 ctx->next );
432 } 432 }
433 433
434 cy = _gcry_mpih_add_n( prodp, prodp, ctx->tspace, vsize); 434 cy = _gcry_mpih_add_n( prodp, prodp, ctx->tspace, vsize);
435 _gcry_mpih_add_1( prodp + vsize, ctx->tspace + vsize, usize, cy ); 435 _gcry_mpih_add_1( prodp + vsize, ctx->tspace + vsize, usize, cy );
436 } 436 }
437} 437}
438 438
439 439
440void 440void
441_gcry_mpih_release_karatsuba_ctx( struct karatsuba_ctx *ctx ) 441_gcry_mpih_release_karatsuba_ctx( struct karatsuba_ctx *ctx )
442{ 442{
443 struct karatsuba_ctx *ctx2; 443 struct karatsuba_ctx *ctx2;
444 444
445 if( ctx->tp ) 445 if( ctx->tp )
446 _gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs ); 446 _gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs );
447 if( ctx->tspace ) 447 if( ctx->tspace )
448 _gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs ); 448 _gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs );
449 for( ctx=ctx->next; ctx; ctx = ctx2 ) { 449 for( ctx=ctx->next; ctx; ctx = ctx2 ) {
450 ctx2 = ctx->next; 450 ctx2 = ctx->next;
451 if( ctx->tp ) 451 if( ctx->tp )
452 _gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs ); 452 _gcry_mpi_free_limb_space( ctx->tp, ctx->tp_nlimbs );
453 if( ctx->tspace ) 453 if( ctx->tspace )
454 _gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs ); 454 _gcry_mpi_free_limb_space( ctx->tspace, ctx->tspace_nlimbs );
455 gcry_free( ctx ); 455 gcry_free( ctx );
456 } 456 }
457} 457}
458 458
459/* Multiply the natural numbers u (pointed to by UP, with USIZE limbs) 459/* Multiply the natural numbers u (pointed to by UP, with USIZE limbs)
460 * and v (pointed to by VP, with VSIZE limbs), and store the result at 460 * and v (pointed to by VP, with VSIZE limbs), and store the result at
461 * PRODP. USIZE + VSIZE limbs are always stored, but if the input 461 * PRODP. USIZE + VSIZE limbs are always stored, but if the input
462 * operands are normalized. Return the most significant limb of the 462 * operands are normalized. Return the most significant limb of the
463 * result. 463 * result.
464 * 464 *
465 * NOTE: The space pointed to by PRODP is overwritten before finished 465 * NOTE: The space pointed to by PRODP is overwritten before finished
466 * with U and V, so overlap is an error. 466 * with U and V, so overlap is an error.
467 * 467 *
468 * Argument constraints: 468 * Argument constraints:
469 * 1. USIZE >= VSIZE. 469 * 1. USIZE >= VSIZE.
470 * 2. PRODP != UP and PRODP != VP, i.e. the destination 470 * 2. PRODP != UP and PRODP != VP, i.e. the destination
471 * must be distinct from the multiplier and the multiplicand. 471 * must be distinct from the multiplier and the multiplicand.
472 */ 472 */
473 473
474mpi_limb_t 474mpi_limb_t
475_gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize, 475_gcry_mpih_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize,
476 mpi_ptr_t vp, mpi_size_t vsize) 476 mpi_ptr_t vp, mpi_size_t vsize)
477{ 477{
478 mpi_ptr_t prod_endp = prodp + usize + vsize - 1; 478 mpi_ptr_t prod_endp = prodp + usize + vsize - 1;
479 mpi_limb_t cy; 479 mpi_limb_t cy;
480 struct karatsuba_ctx ctx; 480 struct karatsuba_ctx ctx;
481 481
482 if( vsize < KARATSUBA_THRESHOLD ) { 482 if( vsize < KARATSUBA_THRESHOLD ) {
483 mpi_size_t i; 483 mpi_size_t i;
484 mpi_limb_t v_limb; 484 mpi_limb_t v_limb;
485 485
486 if( !vsize ) 486 if( !vsize )
487 return 0; 487 return 0;
488 488
489 /* Multiply by the first limb in V separately, as the result can be 489 /* Multiply by the first limb in V separately, as the result can be
490 * stored (not added) to PROD. We also avoid a loop for zeroing. */ 490 * stored (not added) to PROD. We also avoid a loop for zeroing. */
491 v_limb = vp[0]; 491 v_limb = vp[0];
492 if( v_limb <= 1 ) { 492 if( v_limb <= 1 ) {
493 if( v_limb == 1 ) 493 if( v_limb == 1 )
494 MPN_COPY( prodp, up, usize ); 494 MPN_COPY( prodp, up, usize );
495 else 495 else
496 MPN_ZERO( prodp, usize ); 496 MPN_ZERO( prodp, usize );
497 cy = 0; 497 cy = 0;
498 } 498 }
499 else 499 else
500 cy = _gcry_mpih_mul_1( prodp, up, usize, v_limb ); 500 cy = _gcry_mpih_mul_1( prodp, up, usize, v_limb );
501 501
502 prodp[usize] = cy; 502 prodp[usize] = cy;
503 prodp++; 503 prodp++;
504 504
505 /* For each iteration in the outer loop, multiply one limb from 505 /* For each iteration in the outer loop, multiply one limb from
506 * U with one limb from V, and add it to PROD. */ 506 * U with one limb from V, and add it to PROD. */
507 for( i = 1; i < vsize; i++ ) { 507 for( i = 1; i < vsize; i++ ) {
508 v_limb = vp[i]; 508 v_limb = vp[i];
509 if( v_limb <= 1 ) { 509 if( v_limb <= 1 ) {
510 cy = 0; 510 cy = 0;
511 if( v_limb == 1 ) 511 if( v_limb == 1 )
512 cy = _gcry_mpih_add_n(prodp, prodp, up, usize); 512 cy = _gcry_mpih_add_n(prodp, prodp, up, usize);
513 } 513 }
514 else 514 else
515 cy = _gcry_mpih_addmul_1(prodp, up, usize, v_limb); 515 cy = _gcry_mpih_addmul_1(prodp, up, usize, v_limb);
516 516
517 prodp[usize] = cy; 517 prodp[usize] = cy;
518 prodp++; 518 prodp++;
519 } 519 }
520 520
521 return cy; 521 return cy;
522 } 522 }
523 523
524 memset( &ctx, 0, sizeof ctx ); 524 memset( &ctx, 0, sizeof ctx );
525 _gcry_mpih_mul_karatsuba_case( prodp, up, usize, vp, vsize, &ctx ); 525 _gcry_mpih_mul_karatsuba_case( prodp, up, usize, vp, vsize, &ctx );
526 _gcry_mpih_release_karatsuba_ctx( &ctx ); 526 _gcry_mpih_release_karatsuba_ctx( &ctx );
527 return *prod_endp; 527 return *prod_endp;
528} 528}
529 529
530 530
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpiutil.c b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpiutil.c
index 305b62b..b8ec233 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpiutil.c
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/mpiutil.c
@@ -1,428 +1,428 @@
1/* mpiutil.ac - Utility functions for MPI 1/* mpiutil.ac - Utility functions for MPI
2 * Copyright (C) 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 2 * Copyright (C) 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3 * 3 *
4 * This file is part of Libgcrypt. 4 * This file is part of Libgcrypt.
5 * 5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify 6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as 7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of 8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version. 9 * the License, or (at your option) any later version.
10 * 10 *
11 * Libgcrypt is distributed in the hope that it will be useful, 11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details. 14 * GNU Lesser General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Lesser General Public 16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software 17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */ 19 */
20 20
21#include <config.h> 21#include <config.h>
22#include <stdio.h> 22#include <stdio.h>
23#include <stdlib.h> 23#include <stdlib.h>
24#include <string.h> 24#include <string.h>
25#include <assert.h> 25#include <assert.h>
26 26
27#include "g10lib.h" 27#include "g10lib.h"
28#include "mpi-internal.h" 28#include "mpi-internal.h"
29#include "memory.h" 29#include "memory.h"
30 30
31/**************** 31/****************
32 * Note: It was a bad idea to use the number of limbs to allocate 32 * Note: It was a bad idea to use the number of limbs to allocate
33 * because on a alpha the limbs are large but we normally need 33 * because on a alpha the limbs are large but we normally need
34 * integers of n bits - So we should chnage this to bits (or bytes). 34 * integers of n bits - So we should chnage this to bits (or bytes).
35 * 35 *
36 * But mpi_alloc is used in a lot of places :-) 36 * But mpi_alloc is used in a lot of places :-)
37 */ 37 */
38gcry_mpi_t 38gcry_mpi_t
39_gcry_mpi_alloc( unsigned nlimbs ) 39_gcry_mpi_alloc( unsigned nlimbs )
40{ 40{
41 gcry_mpi_t a; 41 gcry_mpi_t a;
42 42
43 a = gcry_xmalloc( sizeof *a ); 43 a = gcry_xmalloc( sizeof *a );
44 a->d = nlimbs? mpi_alloc_limb_space( nlimbs, 0 ) : NULL; 44 a->d = nlimbs? mpi_alloc_limb_space( nlimbs, 0 ) : NULL;
45 a->alloced = nlimbs; 45 a->alloced = nlimbs;
46 a->nlimbs = 0; 46 a->nlimbs = 0;
47 a->sign = 0; 47 a->sign = 0;
48 a->flags = 0; 48 a->flags = 0;
49 return a; 49 return a;
50} 50}
51 51
52void 52void
53_gcry_mpi_m_check( gcry_mpi_t a ) 53_gcry_mpi_m_check( gcry_mpi_t a )
54{ 54{
55 _gcry_check_heap(a); 55 _gcry_check_heap(a);
56 _gcry_check_heap(a->d); 56 _gcry_check_heap(a->d);
57} 57}
58 58
59gcry_mpi_t 59gcry_mpi_t
60_gcry_mpi_alloc_secure( unsigned nlimbs ) 60_gcry_mpi_alloc_secure( unsigned nlimbs )
61{ 61{
62 gcry_mpi_t a; 62 gcry_mpi_t a;
63 63
64 a = gcry_xmalloc( sizeof *a ); 64 a = gcry_xmalloc( sizeof *a );
65 a->d = nlimbs? mpi_alloc_limb_space( nlimbs, 1 ) : NULL; 65 a->d = nlimbs? mpi_alloc_limb_space( nlimbs, 1 ) : NULL;
66 a->alloced = nlimbs; 66 a->alloced = nlimbs;
67 a->flags = 1; 67 a->flags = 1;
68 a->nlimbs = 0; 68 a->nlimbs = 0;
69 a->sign = 0; 69 a->sign = 0;
70 return a; 70 return a;
71} 71}
72 72
73 73
74 74
75mpi_ptr_t 75mpi_ptr_t
76_gcry_mpi_alloc_limb_space( unsigned int nlimbs, int secure ) 76_gcry_mpi_alloc_limb_space( unsigned int nlimbs, int secure )
77{ 77{
78 mpi_ptr_t p; 78 mpi_ptr_t p;
79 size_t len; 79 size_t len;
80 80
81 len = (nlimbs ? nlimbs : 1) * sizeof (mpi_limb_t); 81 len = (nlimbs ? nlimbs : 1) * sizeof (mpi_limb_t);
82 p = secure ? gcry_xmalloc_secure (len) : gcry_xmalloc (len); 82 p = secure ? gcry_xmalloc_secure (len) : gcry_xmalloc (len);
83 if (! nlimbs) 83 if (! nlimbs)
84 *p = 0; 84 *p = 0;
85 85
86 return p; 86 return p;
87} 87}
88 88
89void 89void
90_gcry_mpi_free_limb_space( mpi_ptr_t a, unsigned int nlimbs) 90_gcry_mpi_free_limb_space( mpi_ptr_t a, unsigned int nlimbs)
91{ 91{
92 if (a) 92 if (a)
93 { 93 {
94 size_t len = nlimbs * sizeof(mpi_limb_t); 94 size_t len = nlimbs * sizeof(mpi_limb_t);
95 95
96 /* If we have information on the number of allocated limbs, we 96 /* If we have information on the number of allocated limbs, we
97 better wipe that space out. This is a failsafe feature if 97 better wipe that space out. This is a failsafe feature if
98 secure memory has been disabled or was not properly 98 secure memory has been disabled or was not properly
99 implemented in user provided allocation functions. */ 99 implemented in user provided allocation functions. */
100 if (len) 100 if (len)
101 wipememory (a, len); 101 wipememory (a, len);
102 gcry_free(a); 102 gcry_free(a);
103 } 103 }
104} 104}
105 105
106 106
107void 107void
108_gcry_mpi_assign_limb_space( gcry_mpi_t a, mpi_ptr_t ap, unsigned int nlimbs ) 108_gcry_mpi_assign_limb_space( gcry_mpi_t a, mpi_ptr_t ap, unsigned int nlimbs )
109{ 109{
110 _gcry_mpi_free_limb_space (a->d, a->alloced); 110 _gcry_mpi_free_limb_space (a->d, a->alloced);
111 a->d = ap; 111 a->d = ap;
112 a->alloced = nlimbs; 112 a->alloced = nlimbs;
113} 113}
114 114
115 115
116 116
117/**************** 117/****************
118 * Resize the array of A to NLIMBS. the additional space is cleared 118 * Resize the array of A to NLIMBS. the additional space is cleared
119 * (set to 0) [done by gcry_realloc()] 119 * (set to 0) [done by gcry_realloc()]
120 */ 120 */
121void 121void
122_gcry_mpi_resize (gcry_mpi_t a, unsigned nlimbs) 122_gcry_mpi_resize (gcry_mpi_t a, unsigned nlimbs)
123{ 123{
124 if (nlimbs <= a->alloced) 124 if (nlimbs <= a->alloced)
125 return; /* no need to do it */ 125 return; /* no need to do it */
126 126
127 if (a->d) 127 if (a->d)
128 a->d = gcry_xrealloc (a->d, nlimbs * sizeof (mpi_limb_t)); 128 a->d = gcry_xrealloc (a->d, nlimbs * sizeof (mpi_limb_t));
129 else 129 else
130 { 130 {
131 if (a->flags & 1) 131 if (a->flags & 1)
132 /* Secure memory is wanted. */ 132 /* Secure memory is wanted. */
133 a->d = gcry_xcalloc_secure (nlimbs , sizeof (mpi_limb_t)); 133 a->d = gcry_xcalloc_secure (nlimbs , sizeof (mpi_limb_t));
134 else 134 else
135 /* Standard memory. */ 135 /* Standard memory. */
136 a->d = gcry_xcalloc (nlimbs , sizeof (mpi_limb_t)); 136 a->d = gcry_xcalloc (nlimbs , sizeof (mpi_limb_t));
137 } 137 }
138 a->alloced = nlimbs; 138 a->alloced = nlimbs;
139} 139}
140 140
141void 141void
142_gcry_mpi_clear( gcry_mpi_t a ) 142_gcry_mpi_clear( gcry_mpi_t a )
143{ 143{
144 a->nlimbs = 0; 144 a->nlimbs = 0;
145 a->flags = 0; 145 a->flags = 0;
146} 146}
147 147
148 148
149void 149void
150_gcry_mpi_free( gcry_mpi_t a ) 150_gcry_mpi_free( gcry_mpi_t a )
151{ 151{
152 if (!a ) 152 if (!a )
153 return; 153 return;
154 if ((a->flags & 4)) 154 if ((a->flags & 4))
155 gcry_free( a->d ); 155 gcry_free( a->d );
156 else 156 else
157 { 157 {
158 _gcry_mpi_free_limb_space(a->d, a->alloced); 158 _gcry_mpi_free_limb_space(a->d, a->alloced);
159 } 159 }
160 if ((a->flags & ~7)) 160 if ((a->flags & ~7))
161 log_bug("invalid flag value in mpi\n"); 161 log_bug("invalid flag value in mpi\n");
162 gcry_free(a); 162 gcry_free(a);
163} 163}
164 164
165static void 165static void
166mpi_set_secure( gcry_mpi_t a ) 166mpi_set_secure( gcry_mpi_t a )
167{ 167{
168 mpi_ptr_t ap, bp; 168 mpi_ptr_t ap, bp;
169 169
170 if ( (a->flags & 1) ) 170 if ( (a->flags & 1) )
171 return; 171 return;
172 a->flags |= 1; 172 a->flags |= 1;
173 ap = a->d; 173 ap = a->d;
174 if (!a->nlimbs) 174 if (!a->nlimbs)
175 { 175 {
176 assert(!ap); 176 assert(!ap);
177 return; 177 return;
178 } 178 }
179 bp = mpi_alloc_limb_space (a->nlimbs, 1); 179 bp = mpi_alloc_limb_space (a->nlimbs, 1);
180 MPN_COPY( bp, ap, a->nlimbs ); 180 MPN_COPY( bp, ap, a->nlimbs );
181 a->d = bp; 181 a->d = bp;
182 _gcry_mpi_free_limb_space (ap, a->alloced); 182 _gcry_mpi_free_limb_space (ap, a->alloced);
183} 183}
184 184
185 185
186gcry_mpi_t 186gcry_mpi_t
187gcry_mpi_set_opaque( gcry_mpi_t a, void *p, unsigned int nbits ) 187gcry_mpi_set_opaque( gcry_mpi_t a, void *p, unsigned int nbits )
188{ 188{
189 if (!a) 189 if (!a)
190 a = mpi_alloc(0); 190 a = mpi_alloc(0);
191 191
192 if( a->flags & 4 ) 192 if( a->flags & 4 )
193 gcry_free( a->d ); 193 gcry_free( a->d );
194 else 194 else
195 _gcry_mpi_free_limb_space (a->d, a->alloced); 195 _gcry_mpi_free_limb_space (a->d, a->alloced);
196 196
197 a->d = p; 197 a->d = p;
198 a->alloced = 0; 198 a->alloced = 0;
199 a->nlimbs = 0; 199 a->nlimbs = 0;
200 a->sign = nbits; 200 a->sign = nbits;
201 a->flags = 4; 201 a->flags = 4;
202 return a; 202 return a;
203} 203}
204 204
205 205
206void * 206void *
207gcry_mpi_get_opaque( gcry_mpi_t a, unsigned int *nbits ) 207gcry_mpi_get_opaque( gcry_mpi_t a, unsigned int *nbits )
208{ 208{
209 if( !(a->flags & 4) ) 209 if( !(a->flags & 4) )
210 log_bug("mpi_get_opaque on normal mpi\n"); 210 log_bug("mpi_get_opaque on normal mpi\n");
211 if( nbits ) 211 if( nbits )
212 *nbits = a->sign; 212 *nbits = a->sign;
213 return a->d; 213 return a->d;
214} 214}
215 215
216 216
217/**************** 217/****************
218 * Note: This copy function should not interpret the MPI 218 * Note: This copy function should not interpret the MPI
219 * but copy it transparently. 219 * but copy it transparently.
220 */ 220 */
221gcry_mpi_t 221gcry_mpi_t
222_gcry_mpi_copy( gcry_mpi_t a ) 222_gcry_mpi_copy( gcry_mpi_t a )
223{ 223{
224 int i; 224 int i;
225 gcry_mpi_t b; 225 gcry_mpi_t b;
226 226
227 if( a && (a->flags & 4) ) { 227 if( a && (a->flags & 4) ) {
228 void *p = gcry_is_secure(a->d)? gcry_xmalloc_secure( (a->sign+7)/8 ) 228 void *p = gcry_is_secure(a->d)? gcry_xmalloc_secure( (a->sign+7)/8 )
229 : gcry_xmalloc( (a->sign+7)/8 ); 229 : gcry_xmalloc( (a->sign+7)/8 );
230 memcpy( p, a->d, (a->sign+7)/8 ); 230 memcpy( p, a->d, (a->sign+7)/8 );
231 b = gcry_mpi_set_opaque( NULL, p, a->sign ); 231 b = gcry_mpi_set_opaque( NULL, p, a->sign );
232 } 232 }
233 else if( a ) { 233 else if( a ) {
234 b = mpi_is_secure(a)? mpi_alloc_secure( a->nlimbs ) 234 b = mpi_is_secure(a)? mpi_alloc_secure( a->nlimbs )
235 : mpi_alloc( a->nlimbs ); 235 : mpi_alloc( a->nlimbs );
236 b->nlimbs = a->nlimbs; 236 b->nlimbs = a->nlimbs;
237 b->sign = a->sign; 237 b->sign = a->sign;
238 b->flags = a->flags; 238 b->flags = a->flags;
239 for(i=0; i < b->nlimbs; i++ ) 239 for(i=0; i < b->nlimbs; i++ )
240 b->d[i] = a->d[i]; 240 b->d[i] = a->d[i];
241 } 241 }
242 else 242 else
243 b = NULL; 243 b = NULL;
244 return b; 244 return b;
245} 245}
246 246
247 247
248/**************** 248/****************
249 * This function allocates an MPI which is optimized to hold 249 * This function allocates an MPI which is optimized to hold
250 * a value as large as the one given in the argument and allocates it 250 * a value as large as the one given in the argument and allocates it
251 * with the same flags as A. 251 * with the same flags as A.
252 */ 252 */
253gcry_mpi_t 253gcry_mpi_t
254_gcry_mpi_alloc_like( gcry_mpi_t a ) 254_gcry_mpi_alloc_like( gcry_mpi_t a )
255{ 255{
256 gcry_mpi_t b; 256 gcry_mpi_t b;
257 257
258 if( a && (a->flags & 4) ) { 258 if( a && (a->flags & 4) ) {
259 int n = (a->sign+7)/8; 259 int n = (a->sign+7)/8;
260 void *p = gcry_is_secure(a->d)? gcry_malloc_secure( n ) 260 void *p = gcry_is_secure(a->d)? gcry_malloc_secure( n )
261 : gcry_malloc( n ); 261 : gcry_malloc( n );
262 memcpy( p, a->d, n ); 262 memcpy( p, a->d, n );
263 b = gcry_mpi_set_opaque( NULL, p, a->sign ); 263 b = gcry_mpi_set_opaque( NULL, p, a->sign );
264 } 264 }
265 else if( a ) { 265 else if( a ) {
266 b = mpi_is_secure(a)? mpi_alloc_secure( a->nlimbs ) 266 b = mpi_is_secure(a)? mpi_alloc_secure( a->nlimbs )
267 : mpi_alloc( a->nlimbs ); 267 : mpi_alloc( a->nlimbs );
268 b->nlimbs = 0; 268 b->nlimbs = 0;
269 b->sign = 0; 269 b->sign = 0;
270 b->flags = a->flags; 270 b->flags = a->flags;
271 } 271 }
272 else 272 else
273 b = NULL; 273 b = NULL;
274 return b; 274 return b;
275} 275}
276 276
277 277
278void 278void
279_gcry_mpi_set( gcry_mpi_t w, gcry_mpi_t u) 279_gcry_mpi_set( gcry_mpi_t w, gcry_mpi_t u)
280{ 280{
281 mpi_ptr_t wp, up; 281 mpi_ptr_t wp, up;
282 mpi_size_t usize = u->nlimbs; 282 mpi_size_t usize = u->nlimbs;
283 int usign = u->sign; 283 int usign = u->sign;
284 284
285 RESIZE_IF_NEEDED(w, usize); 285 RESIZE_IF_NEEDED(w, usize);
286 wp = w->d; 286 wp = w->d;
287 up = u->d; 287 up = u->d;
288 MPN_COPY( wp, up, usize ); 288 MPN_COPY( wp, up, usize );
289 w->nlimbs = usize; 289 w->nlimbs = usize;
290 w->flags = u->flags; 290 w->flags = u->flags;
291 w->sign = usign; 291 w->sign = usign;
292} 292}
293 293
294 294
295void 295void
296_gcry_mpi_set_ui( gcry_mpi_t w, unsigned long u) 296_gcry_mpi_set_ui( gcry_mpi_t w, unsigned long u)
297{ 297{
298 RESIZE_IF_NEEDED(w, 1); 298 RESIZE_IF_NEEDED(w, 1);
299 w->d[0] = u; 299 w->d[0] = u;
300 w->nlimbs = u? 1:0; 300 w->nlimbs = u? 1:0;
301 w->sign = 0; 301 w->sign = 0;
302 w->flags = 0; 302 w->flags = 0;
303} 303}
304 304
305 305
306gcry_mpi_t 306gcry_mpi_t
307_gcry_mpi_alloc_set_ui( unsigned long u) 307_gcry_mpi_alloc_set_ui( unsigned long u)
308{ 308{
309 gcry_mpi_t w = mpi_alloc(1); 309 gcry_mpi_t w = mpi_alloc(1);
310 w->d[0] = u; 310 w->d[0] = u;
311 w->nlimbs = u? 1:0; 311 w->nlimbs = u? 1:0;
312 w->sign = 0; 312 w->sign = 0;
313 return w; 313 return w;
314} 314}
315 315
316 316
317void 317void
318_gcry_mpi_swap( gcry_mpi_t a, gcry_mpi_t b) 318_gcry_mpi_swap( gcry_mpi_t a, gcry_mpi_t b)
319{ 319{
320 struct gcry_mpi tmp; 320 struct gcry_mpi tmp;
321 321
322 tmp = *a; *a = *b; *b = tmp; 322 tmp = *a; *a = *b; *b = tmp;
323} 323}
324 324
325void 325void
326gcry_mpi_swap( gcry_mpi_t a, gcry_mpi_t b) 326gcry_mpi_swap( gcry_mpi_t a, gcry_mpi_t b)
327{ 327{
328 _gcry_mpi_swap (a, b); 328 _gcry_mpi_swap (a, b);
329} 329}
330 330
331 331
332gcry_mpi_t 332gcry_mpi_t
333gcry_mpi_new( unsigned int nbits ) 333gcry_mpi_new( unsigned int nbits )
334{ 334{
335 return _gcry_mpi_alloc( (nbits+BITS_PER_MPI_LIMB-1) / BITS_PER_MPI_LIMB ); 335 return _gcry_mpi_alloc( (nbits+BITS_PER_MPI_LIMB-1) / BITS_PER_MPI_LIMB );
336} 336}
337 337
338 338
339gcry_mpi_t 339gcry_mpi_t
340gcry_mpi_snew( unsigned int nbits ) 340gcry_mpi_snew( unsigned int nbits )
341{ 341{
342 return _gcry_mpi_alloc_secure( (nbits+BITS_PER_MPI_LIMB-1) / BITS_PER_MPI_LIMB ); 342 return _gcry_mpi_alloc_secure( (nbits+BITS_PER_MPI_LIMB-1) / BITS_PER_MPI_LIMB );
343} 343}
344 344
345void 345void
346gcry_mpi_release( gcry_mpi_t a ) 346gcry_mpi_release( gcry_mpi_t a )
347{ 347{
348 _gcry_mpi_free( a ); 348 _gcry_mpi_free( a );
349} 349}
350 350
351gcry_mpi_t 351gcry_mpi_t
352gcry_mpi_copy( const gcry_mpi_t a ) 352gcry_mpi_copy( const gcry_mpi_t a )
353{ 353{
354 return _gcry_mpi_copy( (gcry_mpi_t)a ); 354 return _gcry_mpi_copy( (gcry_mpi_t)a );
355} 355}
356 356
357gcry_mpi_t 357gcry_mpi_t
358gcry_mpi_set( gcry_mpi_t w, const gcry_mpi_t u ) 358gcry_mpi_set( gcry_mpi_t w, const gcry_mpi_t u )
359{ 359{
360 if( !w ) 360 if( !w )
361 w = _gcry_mpi_alloc( mpi_get_nlimbs(u) ); 361 w = _gcry_mpi_alloc( mpi_get_nlimbs(u) );
362 _gcry_mpi_set( w, (gcry_mpi_t)u ); 362 _gcry_mpi_set( w, (gcry_mpi_t)u );
363 return w; 363 return w;
364} 364}
365 365
366gcry_mpi_t 366gcry_mpi_t
367gcry_mpi_set_ui( gcry_mpi_t w, unsigned long u ) 367gcry_mpi_set_ui( gcry_mpi_t w, unsigned long u )
368{ 368{
369 if( !w ) 369 if( !w )
370 w = _gcry_mpi_alloc(1); 370 w = _gcry_mpi_alloc(1);
371 _gcry_mpi_set_ui( w, u ); 371 _gcry_mpi_set_ui( w, u );
372 return w; 372 return w;
373} 373}
374 374
375 375
376void 376void
377gcry_mpi_randomize( gcry_mpi_t w, 377gcry_mpi_randomize( gcry_mpi_t w,
378 unsigned int nbits, enum gcry_random_level level ) 378 unsigned int nbits, enum gcry_random_level level )
379{ 379{
380 unsigned char *p; 380 unsigned char *p;
381 size_t nbytes = (nbits+7)/8; 381 size_t nbytes = (nbits+7)/8;
382 382
383 if (level == GCRY_WEAK_RANDOM) 383 if (level == GCRY_WEAK_RANDOM)
384 { 384 {
385 p = mpi_is_secure(w) ? gcry_xmalloc_secure (nbytes) 385 p = mpi_is_secure(w) ? gcry_xmalloc_secure (nbytes)
386 : gcry_xmalloc (nbytes); 386 : gcry_xmalloc (nbytes);
387 gcry_create_nonce (p, nbytes); 387 gcry_create_nonce (p, nbytes);
388 } 388 }
389 else 389 else
390 { 390 {
391 p = mpi_is_secure(w) ? gcry_random_bytes_secure (nbytes, level) 391 p = mpi_is_secure(w) ? gcry_random_bytes_secure (nbytes, level)
392 : gcry_random_bytes (nbytes, level); 392 : gcry_random_bytes (nbytes, level);
393 } 393 }
394 _gcry_mpi_set_buffer( w, p, nbytes, 0 ); 394 _gcry_mpi_set_buffer( w, p, nbytes, 0 );
395 gcry_free (p); 395 gcry_free (p);
396} 396}
397 397
398 398
399void 399void
400gcry_mpi_set_flag( gcry_mpi_t a, enum gcry_mpi_flag flag ) 400gcry_mpi_set_flag( gcry_mpi_t a, enum gcry_mpi_flag flag )
401{ 401{
402 switch( flag ) { 402 switch( flag ) {
403 case GCRYMPI_FLAG_SECURE: mpi_set_secure(a); break; 403 case GCRYMPI_FLAG_SECURE: mpi_set_secure(a); break;
404 case GCRYMPI_FLAG_OPAQUE: 404 case GCRYMPI_FLAG_OPAQUE:
405 default: log_bug("invalid flag value\n"); 405 default: log_bug("invalid flag value\n");
406 } 406 }
407} 407}
408 408
409void 409void
410gcry_mpi_clear_flag( gcry_mpi_t a, enum gcry_mpi_flag flag ) 410gcry_mpi_clear_flag( gcry_mpi_t a, enum gcry_mpi_flag flag )
411{ 411{
412 switch( flag ) { 412 switch( flag ) {
413 case GCRYMPI_FLAG_SECURE: 413 case GCRYMPI_FLAG_SECURE:
414 case GCRYMPI_FLAG_OPAQUE: 414 case GCRYMPI_FLAG_OPAQUE:
415 default: log_bug("invalid flag value\n"); 415 default: log_bug("invalid flag value\n");
416 } 416 }
417} 417}
418 418
419int 419int
420gcry_mpi_get_flag( gcry_mpi_t a, enum gcry_mpi_flag flag ) 420gcry_mpi_get_flag( gcry_mpi_t a, enum gcry_mpi_flag flag )
421{ 421{
422 switch( flag ) { 422 switch( flag ) {
423 case GCRYMPI_FLAG_SECURE: return (a->flags & 1); 423 case GCRYMPI_FLAG_SECURE: return (a->flags & 1);
424 case GCRYMPI_FLAG_OPAQUE: return (a->flags & 4); 424 case GCRYMPI_FLAG_OPAQUE: return (a->flags & 4);
425 default: log_bug("invalid flag value\n"); 425 default: log_bug("invalid flag value\n");
426 } 426 }
427} 427}
428 428
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/Manifest
index de9135e..f075ab0 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/Manifest
@@ -1,22 +1,22 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-lshift.S 20mpih-lshift.S
21mpih-rshift.S 21mpih-rshift.S
22$names$ iQCVAwUAP+LmVjEAnp832S/7AQKlEQQAv2+x/d+Z0t8FwwHlxKpIKOJDr9e+Y2i8y8orcIEa3dnwU5LMOH3EzFoNSD9crc31FMokgm/X5xeLjqRTdcmGHyJJQJDPJVJyuaOm6qHJaFzzfJjrfMW66nJxfNSXIiIm4DgpP20NmumaorLCkiIZ5Z81KGAc8FiRggbRVYx+wxo==Vjh9 22$names$ iQCVAwUAP+LmVjEAnp832S/7AQKlEQQAv2+x/d+Z0t8FwwHlxKpIKOJDr9e+Y2i8y8orcIEa3dnwU5LMOH3EzFoNSD9crc31FMokgm/X5xeLjqRTdcmGHyJJQJDPJVJyuaOm6qHJaFzzfJjrfMW66nJxfNSXIiIm4DgpP20NmumaorLCkiIZ5Z81KGAc8FiRggbRVYx+wxo==Vjh9
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/distfiles
index ad1fcc1..e1cde4d 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/distfiles
@@ -1,4 +1,4 @@
1Manifest 1Manifest
2mpih-lshift.S 2mpih-lshift.S
3mpih-rshift.S 3mpih-rshift.S
4 4
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-lshift.S
index 7e82163..8ade196 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-lshift.S
@@ -1,96 +1,96 @@
1/* hppa lshift 1/* hppa lshift
2 * optimized for the PA7100, where it runs at 3.25 cycles/limb 2 * optimized for the PA7100, where it runs at 3.25 cycles/limb
3 * 3 *
4 * Copyright (C) 1992, 1994, 1998, 4 * Copyright (C) 1992, 1994, 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 23
24 24
25 25
26/******************* 26/*******************
27 * mpi_limb_t 27 * mpi_limb_t
28 * _gcry_mpih_lshift( mpi_ptr_t wp, (gr26) 28 * _gcry_mpih_lshift( mpi_ptr_t wp, (gr26)
29 * mpi_ptr_t up, (gr25) 29 * mpi_ptr_t up, (gr25)
30 * mpi_size_t usize, (gr24) 30 * mpi_size_t usize, (gr24)
31 * unsigned cnt) (gr23) 31 * unsigned cnt) (gr23)
32 */ 32 */
33 33
34 .code 34 .code
35 .export _gcry_mpih_lshift 35 .export _gcry_mpih_lshift
36 .label _gcry_mpih_lshift 36 .label _gcry_mpih_lshift
37 .proc 37 .proc
38 .callinfo frame=64,no_calls 38 .callinfo frame=64,no_calls
39 .entry 39 .entry
40 40
41 sh2add %r24,%r25,%r25 41 sh2add %r24,%r25,%r25
42 sh2add %r24,%r26,%r26 42 sh2add %r24,%r26,%r26
43 ldws,mb -4(0,%r25),%r22 43 ldws,mb -4(0,%r25),%r22
44 subi 32,%r23,%r1 44 subi 32,%r23,%r1
45 mtsar %r1 45 mtsar %r1
46 addib,= -1,%r24,L$0004 46 addib,= -1,%r24,L$0004
47 vshd %r0,%r22,%r28 ; compute carry out limb 47 vshd %r0,%r22,%r28 ; compute carry out limb
48 ldws,mb -4(0,%r25),%r29 48 ldws,mb -4(0,%r25),%r29
49 addib,<= -5,%r24,L$rest 49 addib,<= -5,%r24,L$rest
50 vshd %r22,%r29,%r20 50 vshd %r22,%r29,%r20
51 51
52 .label L$loop 52 .label L$loop
53 ldws,mb -4(0,%r25),%r22 53 ldws,mb -4(0,%r25),%r22
54 stws,mb %r20,-4(0,%r26) 54 stws,mb %r20,-4(0,%r26)
55 vshd %r29,%r22,%r20 55 vshd %r29,%r22,%r20
56 ldws,mb -4(0,%r25),%r29 56 ldws,mb -4(0,%r25),%r29
57 stws,mb %r20,-4(0,%r26) 57 stws,mb %r20,-4(0,%r26)
58 vshd %r22,%r29,%r20 58 vshd %r22,%r29,%r20
59 ldws,mb -4(0,%r25),%r22 59 ldws,mb -4(0,%r25),%r22
60 stws,mb %r20,-4(0,%r26) 60 stws,mb %r20,-4(0,%r26)
61 vshd %r29,%r22,%r20 61 vshd %r29,%r22,%r20
62 ldws,mb -4(0,%r25),%r29 62 ldws,mb -4(0,%r25),%r29
63 stws,mb %r20,-4(0,%r26) 63 stws,mb %r20,-4(0,%r26)
64 addib,> -4,%r24,L$loop 64 addib,> -4,%r24,L$loop
65 vshd %r22,%r29,%r20 65 vshd %r22,%r29,%r20
66 66
67 .label L$rest 67 .label L$rest
68 addib,= 4,%r24,L$end1 68 addib,= 4,%r24,L$end1
69 nop 69 nop
70 .label L$eloop 70 .label L$eloop
71 ldws,mb -4(0,%r25),%r22 71 ldws,mb -4(0,%r25),%r22
72 stws,mb %r20,-4(0,%r26) 72 stws,mb %r20,-4(0,%r26)
73 addib,<= -1,%r24,L$end2 73 addib,<= -1,%r24,L$end2
74 vshd %r29,%r22,%r20 74 vshd %r29,%r22,%r20
75 ldws,mb -4(0,%r25),%r29 75 ldws,mb -4(0,%r25),%r29
76 stws,mb %r20,-4(0,%r26) 76 stws,mb %r20,-4(0,%r26)
77 addib,> -1,%r24,L$eloop 77 addib,> -1,%r24,L$eloop
78 vshd %r22,%r29,%r20 78 vshd %r22,%r29,%r20
79 79
80 .label L$end1 80 .label L$end1
81 stws,mb %r20,-4(0,%r26) 81 stws,mb %r20,-4(0,%r26)
82 vshd %r29,%r0,%r20 82 vshd %r29,%r0,%r20
83 bv 0(%r2) 83 bv 0(%r2)
84 stw %r20,-4(0,%r26) 84 stw %r20,-4(0,%r26)
85 .label L$end2 85 .label L$end2
86 stws,mb %r20,-4(0,%r26) 86 stws,mb %r20,-4(0,%r26)
87 .label L$0004 87 .label L$0004
88 vshd %r22,%r0,%r20 88 vshd %r22,%r0,%r20
89 bv 0(%r2) 89 bv 0(%r2)
90 stw %r20,-4(0,%r26) 90 stw %r20,-4(0,%r26)
91 91
92 .exit 92 .exit
93 .procend 93 .procend
94 94
95 95
96 96
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-rshift.S
index 382b876..0624202 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/pa7100/mpih-rshift.S
@@ -1,92 +1,92 @@
1/* hppa rshift 1/* hppa rshift
2 * optimized for the PA7100, where it runs at 3.25 cycles/limb 2 * optimized for the PA7100, where it runs at 3.25 cycles/limb
3 * 3 *
4 * Copyright (C) 1992, 1994, 1998, 4 * Copyright (C) 1992, 1994, 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 23
24 24
25 25
26/******************* 26/*******************
27 * mpi_limb_t 27 * mpi_limb_t
28 * _gcry_mpih_rshift( mpi_ptr_t wp, (gr26) 28 * _gcry_mpih_rshift( mpi_ptr_t wp, (gr26)
29 * mpi_ptr_t up, (gr25) 29 * mpi_ptr_t up, (gr25)
30 * mpi_size_t usize, (gr24) 30 * mpi_size_t usize, (gr24)
31 * unsigned cnt) (gr23) 31 * unsigned cnt) (gr23)
32 */ 32 */
33 33
34 .code 34 .code
35 .export _gcry_mpih_rshift 35 .export _gcry_mpih_rshift
36 .label _gcry_mpih_rshift 36 .label _gcry_mpih_rshift
37 .proc 37 .proc
38 .callinfo frame=64,no_calls 38 .callinfo frame=64,no_calls
39 .entry 39 .entry
40 40
41 ldws,ma 4(0,%r25),%r22 41 ldws,ma 4(0,%r25),%r22
42 mtsar %r23 42 mtsar %r23
43 addib,= -1,%r24,L$r004 43 addib,= -1,%r24,L$r004
44 vshd %r22,%r0,%r28 ; compute carry out limb 44 vshd %r22,%r0,%r28 ; compute carry out limb
45 ldws,ma 4(0,%r25),%r29 45 ldws,ma 4(0,%r25),%r29
46 addib,<= -5,%r24,L$rrest 46 addib,<= -5,%r24,L$rrest
47 vshd %r29,%r22,%r20 47 vshd %r29,%r22,%r20
48 48
49 .label L$roop 49 .label L$roop
50 ldws,ma 4(0,%r25),%r22 50 ldws,ma 4(0,%r25),%r22
51 stws,ma %r20,4(0,%r26) 51 stws,ma %r20,4(0,%r26)
52 vshd %r22,%r29,%r20 52 vshd %r22,%r29,%r20
53 ldws,ma 4(0,%r25),%r29 53 ldws,ma 4(0,%r25),%r29
54 stws,ma %r20,4(0,%r26) 54 stws,ma %r20,4(0,%r26)
55 vshd %r29,%r22,%r20 55 vshd %r29,%r22,%r20
56 ldws,ma 4(0,%r25),%r22 56 ldws,ma 4(0,%r25),%r22
57 stws,ma %r20,4(0,%r26) 57 stws,ma %r20,4(0,%r26)
58 vshd %r22,%r29,%r20 58 vshd %r22,%r29,%r20
59 ldws,ma 4(0,%r25),%r29 59 ldws,ma 4(0,%r25),%r29
60 stws,ma %r20,4(0,%r26) 60 stws,ma %r20,4(0,%r26)
61 addib,> -4,%r24,L$roop 61 addib,> -4,%r24,L$roop
62 vshd %r29,%r22,%r20 62 vshd %r29,%r22,%r20
63 63
64 .label L$rrest 64 .label L$rrest
65 addib,= 4,%r24,L$rend1 65 addib,= 4,%r24,L$rend1
66 nop 66 nop
67 .label L$eroop 67 .label L$eroop
68 ldws,ma 4(0,%r25),%r22 68 ldws,ma 4(0,%r25),%r22
69 stws,ma %r20,4(0,%r26) 69 stws,ma %r20,4(0,%r26)
70 addib,<= -1,%r24,L$rend2 70 addib,<= -1,%r24,L$rend2
71 vshd %r22,%r29,%r20 71 vshd %r22,%r29,%r20
72 ldws,ma 4(0,%r25),%r29 72 ldws,ma 4(0,%r25),%r29
73 stws,ma %r20,4(0,%r26) 73 stws,ma %r20,4(0,%r26)
74 addib,> -1,%r24,L$eroop 74 addib,> -1,%r24,L$eroop
75 vshd %r29,%r22,%r20 75 vshd %r29,%r22,%r20
76 76
77 .label L$rend1 77 .label L$rend1
78 stws,ma %r20,4(0,%r26) 78 stws,ma %r20,4(0,%r26)
79 vshd %r0,%r29,%r20 79 vshd %r0,%r29,%r20
80 bv 0(%r2) 80 bv 0(%r2)
81 stw %r20,0(0,%r26) 81 stw %r20,0(0,%r26)
82 .label L$rend2 82 .label L$rend2
83 stws,ma %r20,4(0,%r26) 83 stws,ma %r20,4(0,%r26)
84 .label L$r004 84 .label L$r004
85 vshd %r0,%r22,%r20 85 vshd %r0,%r22,%r20
86 bv 0(%r2) 86 bv 0(%r2)
87 stw %r20,0(0,%r26) 87 stw %r20,0(0,%r26)
88 88
89 .exit 89 .exit
90 .procend 90 .procend
91 91
92 92
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest
index d901318..c60fc23 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest
@@ -1,27 +1,27 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-add1.S 20mpih-add1.S
21mpih-lshift.S 21mpih-lshift.S
22mpih-mul1.S 22mpih-mul1.S
23mpih-mul2.S 23mpih-mul2.S
24mpih-mul3.S 24mpih-mul3.S
25mpih-rshift.S 25mpih-rshift.S
26mpih-sub1.S 26mpih-sub1.S
27$names$ iQCVAwUAP+LmXTEAnp832S/7AQJ+ngP/XYr5Fvl/8WGVHcIKaehxvnKcSD2ILTWZNGubgnWp8ebIxVijjQCxYneTTy+zO0sNaB002neyscyiwaJj/JQIwZXfr06uGweIqlSpwpj9ndkoJc8E4/FZu+5NTO+E3RaBDAD+Tpo+MTfbC1s18p5i+an93VrSTgNck5PPYQrUcPA==sl3t 27$names$ iQCVAwUAP+LmXTEAnp832S/7AQJ+ngP/XYr5Fvl/8WGVHcIKaehxvnKcSD2ILTWZNGubgnWp8ebIxVijjQCxYneTTy+zO0sNaB002neyscyiwaJj/JQIwZXfr06uGweIqlSpwpj9ndkoJc8E4/FZu+5NTO+E3RaBDAD+Tpo+MTfbC1s18p5i+an93VrSTgNck5PPYQrUcPA==sl3t
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/distfiles
index 8988899..e1bc008 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/distfiles
@@ -1,8 +1,8 @@
1Manifest 1Manifest
2mpih-add1.S 2mpih-add1.S
3mpih-lshift.S 3mpih-lshift.S
4mpih-mul1.S 4mpih-mul1.S
5mpih-mul2.S 5mpih-mul2.S
6mpih-mul3.S 6mpih-mul3.S
7mpih-rshift.S 7mpih-rshift.S
8mpih-sub1.S 8mpih-sub1.S
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-add1.S
index 4214520..876b56c 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-add1.S
@@ -1,87 +1,87 @@
1/* IBM POWER add_n -- Add two limb vectors of equal, non-zero length. 1/* IBM POWER add_n -- Add two limb vectors of equal, non-zero length.
2 * 2 *
3 * Copyright (C) 1992, 1994, 1996, 1999, 3 * Copyright (C) 1992, 1994, 1996, 1999,
4 * 2002 Free Software Foundation, Inc. 4 * 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26/* 26/*
27# INPUT PARAMETERS 27# INPUT PARAMETERS
28# res_ptr r3 28# res_ptr r3
29# s1_ptr r4 29# s1_ptr r4
30# s2_ptr r5 30# s2_ptr r5
31# size r6 31# size r6
32 */ 32 */
33 33
34 .toc 34 .toc
35 .extern _gcry_mpih_add_n[DS] 35 .extern _gcry_mpih_add_n[DS]
36 .extern ._gcry_mpih_add_n 36 .extern ._gcry_mpih_add_n
37.csect [PR] 37.csect [PR]
38 .align 2 38 .align 2
39 .globl _gcry_mpih_add_n 39 .globl _gcry_mpih_add_n
40 .globl ._gcry_mpih_add_n 40 .globl ._gcry_mpih_add_n
41 .csect _gcry_mpih_add_n[DS] 41 .csect _gcry_mpih_add_n[DS]
42_gcry_mpih_add_n: 42_gcry_mpih_add_n:
43 .long ._gcry_mpih_add_n, TOC[tc0], 0 43 .long ._gcry_mpih_add_n, TOC[tc0], 0
44 .csect [PR] 44 .csect [PR]
45._gcry_mpih_add_n: 45._gcry_mpih_add_n:
46 andil. 10,6,1 # odd or even number of limbs? 46 andil. 10,6,1 # odd or even number of limbs?
47 l 8,0(4) # load least significant s1 limb 47 l 8,0(4) # load least significant s1 limb
48 l 0,0(5) # load least significant s2 limb 48 l 0,0(5) # load least significant s2 limb
49 cal 3,-4(3) # offset res_ptr, it's updated before it's used 49 cal 3,-4(3) # offset res_ptr, it's updated before it's used
50 sri 10,6,1 # count for unrolled loop 50 sri 10,6,1 # count for unrolled loop
51 a 7,0,8 # add least significant limbs, set cy 51 a 7,0,8 # add least significant limbs, set cy
52 mtctr 10 # copy count into CTR 52 mtctr 10 # copy count into CTR
53 beq 0,Leven # branch if even # of limbs (# of limbs >= 2) 53 beq 0,Leven # branch if even # of limbs (# of limbs >= 2)
54 54
55# We have an odd # of limbs. Add the first limbs separately. 55# We have an odd # of limbs. Add the first limbs separately.
56 cmpi 1,10,0 # is count for unrolled loop zero? 56 cmpi 1,10,0 # is count for unrolled loop zero?
57 bne 1,L1 # branch if not 57 bne 1,L1 # branch if not
58 st 7,4(3) 58 st 7,4(3)
59 aze 3,10 # use the fact that r10 is zero... 59 aze 3,10 # use the fact that r10 is zero...
60 br # return 60 br # return
61 61
62# We added least significant limbs. Now reload the next limbs to enter loop. 62# We added least significant limbs. Now reload the next limbs to enter loop.
63L1: lu 8,4(4) # load s1 limb and update s1_ptr 63L1: lu 8,4(4) # load s1 limb and update s1_ptr
64 lu 0,4(5) # load s2 limb and update s2_ptr 64 lu 0,4(5) # load s2 limb and update s2_ptr
65 stu 7,4(3) 65 stu 7,4(3)
66 ae 7,0,8 # add limbs, set cy 66 ae 7,0,8 # add limbs, set cy
67Leven: lu 9,4(4) # load s1 limb and update s1_ptr 67Leven: lu 9,4(4) # load s1 limb and update s1_ptr
68 lu 10,4(5) # load s2 limb and update s2_ptr 68 lu 10,4(5) # load s2 limb and update s2_ptr
69 bdz Lend # If done, skip loop 69 bdz Lend # If done, skip loop
70 70
71Loop: lu 8,4(4) # load s1 limb and update s1_ptr 71Loop: lu 8,4(4) # load s1 limb and update s1_ptr
72 lu 0,4(5) # load s2 limb and update s2_ptr 72 lu 0,4(5) # load s2 limb and update s2_ptr
73 ae 11,9,10 # add previous limbs with cy, set cy 73 ae 11,9,10 # add previous limbs with cy, set cy
74 stu 7,4(3) # 74 stu 7,4(3) #
75 lu 9,4(4) # load s1 limb and update s1_ptr 75 lu 9,4(4) # load s1 limb and update s1_ptr
76 lu 10,4(5) # load s2 limb and update s2_ptr 76 lu 10,4(5) # load s2 limb and update s2_ptr
77 ae 7,0,8 # add previous limbs with cy, set cy 77 ae 7,0,8 # add previous limbs with cy, set cy
78 stu 11,4(3) # 78 stu 11,4(3) #
79 bdn Loop # decrement CTR and loop back 79 bdn Loop # decrement CTR and loop back
80 80
81Lend: ae 11,9,10 # add limbs with cy, set cy 81Lend: ae 11,9,10 # add limbs with cy, set cy
82 st 7,4(3) # 82 st 7,4(3) #
83 st 11,8(3) # 83 st 11,8(3) #
84 lil 3,0 # load cy into ... 84 lil 3,0 # load cy into ...
85 aze 3,3 # ... return value register 85 aze 3,3 # ... return value register
86 br 86 br
87 87
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-lshift.S
index 0ce1788..d9e42da 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-lshift.S
@@ -1,64 +1,64 @@
1/* IBM POWER lshift 1/* IBM POWER lshift
2 * 2 *
3 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */ 20 */
21 21
22#include "sysdep.h" 22#include "sysdep.h"
23#include "asm-syntax.h" 23#include "asm-syntax.h"
24 24
25/* 25/*
26# INPUT PARAMETERS 26# INPUT PARAMETERS
27# res_ptr r3 27# res_ptr r3
28# s_ptr r4 28# s_ptr r4
29# size r5 29# size r5
30# cnt r6 30# cnt r6
31 */ 31 */
32 32
33 .toc 33 .toc
34 .extern _gcry_mpih_lshift[DS] 34 .extern _gcry_mpih_lshift[DS]
35 .extern ._gcry_mpih_lshift 35 .extern ._gcry_mpih_lshift
36.csect [PR] 36.csect [PR]
37 .align 2 37 .align 2
38 .globl _gcry_mpih_lshift 38 .globl _gcry_mpih_lshift
39 .globl ._gcry_mpih_lshift 39 .globl ._gcry_mpih_lshift
40 .csect _gcry_mpih_lshift[DS] 40 .csect _gcry_mpih_lshift[DS]
41_gcry_mpih_lshift: 41_gcry_mpih_lshift:
42 .long ._gcry_mpih_lshift, TOC[tc0], 0 42 .long ._gcry_mpih_lshift, TOC[tc0], 0
43 .csect [PR] 43 .csect [PR]
44._gcry_mpih_lshift: 44._gcry_mpih_lshift:
45 sli 0,5,2 45 sli 0,5,2
46 cax 9,3,0 46 cax 9,3,0
47 cax 4,4,0 47 cax 4,4,0
48 sfi 8,6,32 48 sfi 8,6,32
49 mtctr 5 # put limb count in CTR loop register 49 mtctr 5 # put limb count in CTR loop register
50 lu 0,-4(4) # read most significant limb 50 lu 0,-4(4) # read most significant limb
51 sre 3,0,8 # compute carry out limb, and init MQ register 51 sre 3,0,8 # compute carry out limb, and init MQ register
52 bdz Lend2 # if just one limb, skip loop 52 bdz Lend2 # if just one limb, skip loop
53 lu 0,-4(4) # read 2:nd most significant limb 53 lu 0,-4(4) # read 2:nd most significant limb
54 sreq 7,0,8 # compute most significant limb of result 54 sreq 7,0,8 # compute most significant limb of result
55 bdz Lend # if just two limb, skip loop 55 bdz Lend # if just two limb, skip loop
56Loop: lu 0,-4(4) # load next lower limb 56Loop: lu 0,-4(4) # load next lower limb
57 stu 7,-4(9) # store previous result during read latency 57 stu 7,-4(9) # store previous result during read latency
58 sreq 7,0,8 # compute result limb 58 sreq 7,0,8 # compute result limb
59 bdn Loop # loop back until CTR is zero 59 bdn Loop # loop back until CTR is zero
60Lend: stu 7,-4(9) # store 2:nd least significant limb 60Lend: stu 7,-4(9) # store 2:nd least significant limb
61Lend2: sle 7,0,6 # compute least significant limb 61Lend2: sle 7,0,6 # compute least significant limb
62 st 7,-4(9) # store it 62 st 7,-4(9) # store it
63 br 63 br
64 64
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul1.S
index f36e97b..35034fa 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul1.S
@@ -1,115 +1,115 @@
1/* IBM POWER mul_1 -- Multiply a limb vector with a limb and store 1/* IBM POWER mul_1 -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc. 4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26/* 26/*
27# INPUT PARAMETERS 27# INPUT PARAMETERS
28# res_ptr r3 28# res_ptr r3
29# s1_ptr r4 29# s1_ptr r4
30# size r5 30# size r5
31# s2_limb r6 31# s2_limb r6
32 32
33# The RS/6000 has no unsigned 32x32->64 bit multiplication instruction. To 33# The RS/6000 has no unsigned 32x32->64 bit multiplication instruction. To
34# obtain that operation, we have to use the 32x32->64 signed multiplication 34# obtain that operation, we have to use the 32x32->64 signed multiplication
35# instruction, and add the appropriate compensation to the high limb of the 35# instruction, and add the appropriate compensation to the high limb of the
36# result. We add the multiplicand if the multiplier has its most significant 36# result. We add the multiplicand if the multiplier has its most significant
37# bit set, and we add the multiplier if the multiplicand has its most 37# bit set, and we add the multiplier if the multiplicand has its most
38# significant bit set. We need to preserve the carry flag between each 38# significant bit set. We need to preserve the carry flag between each
39# iteration, so we have to compute the compensation carefully (the natural, 39# iteration, so we have to compute the compensation carefully (the natural,
40# srai+and doesn't work). Since the POWER architecture has a branch unit 40# srai+and doesn't work). Since the POWER architecture has a branch unit
41# we can branch in zero cycles, so that's how we perform the additions. 41# we can branch in zero cycles, so that's how we perform the additions.
42 */ 42 */
43 43
44 .toc 44 .toc
45 .csect ._gcry_mpih_mul_1[PR] 45 .csect ._gcry_mpih_mul_1[PR]
46 .align 2 46 .align 2
47 .globl _gcry_mpih_mul_1 47 .globl _gcry_mpih_mul_1
48 .globl ._gcry_mpih_mul_1 48 .globl ._gcry_mpih_mul_1
49 .csect _gcry_mpih_mul_1[DS] 49 .csect _gcry_mpih_mul_1[DS]
50_gcry_mpih_mul_1: 50_gcry_mpih_mul_1:
51 .long ._gcry_mpih_mul_1[PR], TOC[tc0], 0 51 .long ._gcry_mpih_mul_1[PR], TOC[tc0], 0
52 .csect ._gcry_mpih_mul_1[PR] 52 .csect ._gcry_mpih_mul_1[PR]
53._gcry_mpih_mul_1: 53._gcry_mpih_mul_1:
54 54
55 cal 3,-4(3) 55 cal 3,-4(3)
56 l 0,0(4) 56 l 0,0(4)
57 cmpi 0,6,0 57 cmpi 0,6,0
58 mtctr 5 58 mtctr 5
59 mul 9,0,6 59 mul 9,0,6
60 srai 7,0,31 60 srai 7,0,31
61 and 7,7,6 61 and 7,7,6
62 mfmq 8 62 mfmq 8
63 ai 0,0,0 # reset carry 63 ai 0,0,0 # reset carry
64 cax 9,9,7 64 cax 9,9,7
65 blt Lneg 65 blt Lneg
66Lpos: bdz Lend 66Lpos: bdz Lend
67Lploop: lu 0,4(4) 67Lploop: lu 0,4(4)
68 stu 8,4(3) 68 stu 8,4(3)
69 cmpi 0,0,0 69 cmpi 0,0,0
70 mul 10,0,6 70 mul 10,0,6
71 mfmq 0 71 mfmq 0
72 ae 8,0,9 72 ae 8,0,9
73 bge Lp0 73 bge Lp0
74 cax 10,10,6 # adjust high limb for negative limb from s1 74 cax 10,10,6 # adjust high limb for negative limb from s1
75Lp0: bdz Lend0 75Lp0: bdz Lend0
76 lu 0,4(4) 76 lu 0,4(4)
77 stu 8,4(3) 77 stu 8,4(3)
78 cmpi 0,0,0 78 cmpi 0,0,0
79 mul 9,0,6 79 mul 9,0,6
80 mfmq 0 80 mfmq 0
81 ae 8,0,10 81 ae 8,0,10
82 bge Lp1 82 bge Lp1
83 cax 9,9,6 # adjust high limb for negative limb from s1 83 cax 9,9,6 # adjust high limb for negative limb from s1
84Lp1: bdn Lploop 84Lp1: bdn Lploop
85 b Lend 85 b Lend
86 86
87Lneg: cax 9,9,0 87Lneg: cax 9,9,0
88 bdz Lend 88 bdz Lend
89Lnloop: lu 0,4(4) 89Lnloop: lu 0,4(4)
90 stu 8,4(3) 90 stu 8,4(3)
91 cmpi 0,0,0 91 cmpi 0,0,0
92 mul 10,0,6 92 mul 10,0,6
93 cax 10,10,0 # adjust high limb for negative s2_limb 93 cax 10,10,0 # adjust high limb for negative s2_limb
94 mfmq 0 94 mfmq 0
95 ae 8,0,9 95 ae 8,0,9
96 bge Ln0 96 bge Ln0
97 cax 10,10,6 # adjust high limb for negative limb from s1 97 cax 10,10,6 # adjust high limb for negative limb from s1
98Ln0: bdz Lend0 98Ln0: bdz Lend0
99 lu 0,4(4) 99 lu 0,4(4)
100 stu 8,4(3) 100 stu 8,4(3)
101 cmpi 0,0,0 101 cmpi 0,0,0
102 mul 9,0,6 102 mul 9,0,6
103 cax 9,9,0 # adjust high limb for negative s2_limb 103 cax 9,9,0 # adjust high limb for negative s2_limb
104 mfmq 0 104 mfmq 0
105 ae 8,0,10 105 ae 8,0,10
106 bge Ln1 106 bge Ln1
107 cax 9,9,6 # adjust high limb for negative limb from s1 107 cax 9,9,6 # adjust high limb for negative limb from s1
108Ln1: bdn Lnloop 108Ln1: bdn Lnloop
109 b Lend 109 b Lend
110 110
111Lend0: cal 9,0(10) 111Lend0: cal 9,0(10)
112Lend: st 8,4(3) 112Lend: st 8,4(3)
113 aze 3,9 113 aze 3,9
114 br 114 br
115 115
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul2.S
index 7894a95..d056e8f 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul2.S
@@ -1,130 +1,130 @@
1/* IBM POWER addmul_1 -- Multiply a limb vector with a limb and add 1/* IBM POWER addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc. 4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26 26
27 27
28/* 28/*
29# INPUT PARAMETERS 29# INPUT PARAMETERS
30# res_ptr r3 30# res_ptr r3
31# s1_ptr r4 31# s1_ptr r4
32# size r5 32# size r5
33# s2_limb r6 33# s2_limb r6
34 34
35# The RS/6000 has no unsigned 32x32->64 bit multiplication instruction. To 35# The RS/6000 has no unsigned 32x32->64 bit multiplication instruction. To
36# obtain that operation, we have to use the 32x32->64 signed multiplication 36# obtain that operation, we have to use the 32x32->64 signed multiplication
37# instruction, and add the appropriate compensation to the high limb of the 37# instruction, and add the appropriate compensation to the high limb of the
38# result. We add the multiplicand if the multiplier has its most significant 38# result. We add the multiplicand if the multiplier has its most significant
39# bit set, and we add the multiplier if the multiplicand has its most 39# bit set, and we add the multiplier if the multiplicand has its most
40# significant bit set. We need to preserve the carry flag between each 40# significant bit set. We need to preserve the carry flag between each
41# iteration, so we have to compute the compensation carefully (the natural, 41# iteration, so we have to compute the compensation carefully (the natural,
42# srai+and doesn't work). Since the POWER architecture has a branch unit 42# srai+and doesn't work). Since the POWER architecture has a branch unit
43# we can branch in zero cycles, so that's how we perform the additions. 43# we can branch in zero cycles, so that's how we perform the additions.
44 */ 44 */
45 45
46 .toc 46 .toc
47 .csect ._gcry_mpih_addmul_1[PR] 47 .csect ._gcry_mpih_addmul_1[PR]
48 .align 2 48 .align 2
49 .globl _gcry_mpih_addmul_1 49 .globl _gcry_mpih_addmul_1
50 .globl ._gcry_mpih_addmul_1 50 .globl ._gcry_mpih_addmul_1
51 .csect _gcry_mpih_addmul_1[DS] 51 .csect _gcry_mpih_addmul_1[DS]
52_gcry_mpih_addmul_1: 52_gcry_mpih_addmul_1:
53 .long ._gcry_mpih_addmul_1[PR], TOC[tc0], 0 53 .long ._gcry_mpih_addmul_1[PR], TOC[tc0], 0
54 .csect ._gcry_mpih_addmul_1[PR] 54 .csect ._gcry_mpih_addmul_1[PR]
55._gcry_mpih_addmul_1: 55._gcry_mpih_addmul_1:
56 56
57 cal 3,-4(3) 57 cal 3,-4(3)
58 l 0,0(4) 58 l 0,0(4)
59 cmpi 0,6,0 59 cmpi 0,6,0
60 mtctr 5 60 mtctr 5
61 mul 9,0,6 61 mul 9,0,6
62 srai 7,0,31 62 srai 7,0,31
63 and 7,7,6 63 and 7,7,6
64 mfmq 8 64 mfmq 8
65 cax 9,9,7 65 cax 9,9,7
66 l 7,4(3) 66 l 7,4(3)
67 a 8,8,7 # add res_limb 67 a 8,8,7 # add res_limb
68 blt Lneg 68 blt Lneg
69Lpos: bdz Lend 69Lpos: bdz Lend
70 70
71Lploop: lu 0,4(4) 71Lploop: lu 0,4(4)
72 stu 8,4(3) 72 stu 8,4(3)
73 cmpi 0,0,0 73 cmpi 0,0,0
74 mul 10,0,6 74 mul 10,0,6
75 mfmq 0 75 mfmq 0
76 ae 8,0,9 # low limb + old_cy_limb + old cy 76 ae 8,0,9 # low limb + old_cy_limb + old cy
77 l 7,4(3) 77 l 7,4(3)
78 aze 10,10 # propagate cy to new cy_limb 78 aze 10,10 # propagate cy to new cy_limb
79 a 8,8,7 # add res_limb 79 a 8,8,7 # add res_limb
80 bge Lp0 80 bge Lp0
81 cax 10,10,6 # adjust high limb for negative limb from s1 81 cax 10,10,6 # adjust high limb for negative limb from s1
82Lp0: bdz Lend0 82Lp0: bdz Lend0
83 lu 0,4(4) 83 lu 0,4(4)
84 stu 8,4(3) 84 stu 8,4(3)
85 cmpi 0,0,0 85 cmpi 0,0,0
86 mul 9,0,6 86 mul 9,0,6
87 mfmq 0 87 mfmq 0
88 ae 8,0,10 88 ae 8,0,10
89 l 7,4(3) 89 l 7,4(3)
90 aze 9,9 90 aze 9,9
91 a 8,8,7 91 a 8,8,7
92 bge Lp1 92 bge Lp1
93 cax 9,9,6 # adjust high limb for negative limb from s1 93 cax 9,9,6 # adjust high limb for negative limb from s1
94Lp1: bdn Lploop 94Lp1: bdn Lploop
95 95
96 b Lend 96 b Lend
97 97
98Lneg: cax 9,9,0 98Lneg: cax 9,9,0
99 bdz Lend 99 bdz Lend
100Lnloop: lu 0,4(4) 100Lnloop: lu 0,4(4)
101 stu 8,4(3) 101 stu 8,4(3)
102 cmpi 0,0,0 102 cmpi 0,0,0
103 mul 10,0,6 103 mul 10,0,6
104 mfmq 7 104 mfmq 7
105 ae 8,7,9 105 ae 8,7,9
106 l 7,4(3) 106 l 7,4(3)
107 ae 10,10,0 # propagate cy to new cy_limb 107 ae 10,10,0 # propagate cy to new cy_limb
108 a 8,8,7 # add res_limb 108 a 8,8,7 # add res_limb
109 bge Ln0 109 bge Ln0
110 cax 10,10,6 # adjust high limb for negative limb from s1 110 cax 10,10,6 # adjust high limb for negative limb from s1
111Ln0: bdz Lend0 111Ln0: bdz Lend0
112 lu 0,4(4) 112 lu 0,4(4)
113 stu 8,4(3) 113 stu 8,4(3)
114 cmpi 0,0,0 114 cmpi 0,0,0
115 mul 9,0,6 115 mul 9,0,6
116 mfmq 7 116 mfmq 7
117 ae 8,7,10 117 ae 8,7,10
118 l 7,4(3) 118 l 7,4(3)
119 ae 9,9,0 # propagate cy to new cy_limb 119 ae 9,9,0 # propagate cy to new cy_limb
120 a 8,8,7 # add res_limb 120 a 8,8,7 # add res_limb
121 bge Ln1 121 bge Ln1
122 cax 9,9,6 # adjust high limb for negative limb from s1 122 cax 9,9,6 # adjust high limb for negative limb from s1
123Ln1: bdn Lnloop 123Ln1: bdn Lnloop
124 b Lend 124 b Lend
125 125
126Lend0: cal 9,0(10) 126Lend0: cal 9,0(10)
127Lend: st 8,4(3) 127Lend: st 8,4(3)
128 aze 3,9 128 aze 3,9
129 br 129 br
130 130
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul3.S
index df3a2ed..8bc317b 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul3.S
@@ -1,135 +1,135 @@
1/* IBM POWER submul_1 -- Multiply a limb vector with a limb and subtract 1/* IBM POWER submul_1 -- Multiply a limb vector with a limb and subtract
2 * the result from a second limb vector. 2 * the result from a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc. 4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26 26
27/* 27/*
28 28
29# INPUT PARAMETERS 29# INPUT PARAMETERS
30# res_ptr r3 30# res_ptr r3
31# s1_ptr r4 31# s1_ptr r4
32# size r5 32# size r5
33# s2_limb r6 33# s2_limb r6
34 34
35# The RS/6000 has no unsigned 32x32->64 bit multiplication instruction. To 35# The RS/6000 has no unsigned 32x32->64 bit multiplication instruction. To
36# obtain that operation, we have to use the 32x32->64 signed multiplication 36# obtain that operation, we have to use the 32x32->64 signed multiplication
37# instruction, and add the appropriate compensation to the high limb of the 37# instruction, and add the appropriate compensation to the high limb of the
38# result. We add the multiplicand if the multiplier has its most significant 38# result. We add the multiplicand if the multiplier has its most significant
39# bit set, and we add the multiplier if the multiplicand has its most 39# bit set, and we add the multiplier if the multiplicand has its most
40# significant bit set. We need to preserve the carry flag between each 40# significant bit set. We need to preserve the carry flag between each
41# iteration, so we have to compute the compensation carefully (the natural, 41# iteration, so we have to compute the compensation carefully (the natural,
42# srai+and doesn't work). Since the POWER architecture has a branch unit 42# srai+and doesn't work). Since the POWER architecture has a branch unit
43# we can branch in zero cycles, so that's how we perform the additions. 43# we can branch in zero cycles, so that's how we perform the additions.
44 */ 44 */
45 45
46 .toc 46 .toc
47 .csect ._gcry_mpih_submul_1[PR] 47 .csect ._gcry_mpih_submul_1[PR]
48 .align 2 48 .align 2
49 .globl _gcry_mpih_submul_1 49 .globl _gcry_mpih_submul_1
50 .globl ._gcry_mpih_submul_1 50 .globl ._gcry_mpih_submul_1
51 .csect _gcry_mpih_submul_1[DS] 51 .csect _gcry_mpih_submul_1[DS]
52_gcry_mpih_submul_1: 52_gcry_mpih_submul_1:
53 .long ._gcry_mpih_submul_1[PR], TOC[tc0], 0 53 .long ._gcry_mpih_submul_1[PR], TOC[tc0], 0
54 .csect ._gcry_mpih_submul_1[PR] 54 .csect ._gcry_mpih_submul_1[PR]
55._gcry_mpih_submul_1: 55._gcry_mpih_submul_1:
56 56
57 cal 3,-4(3) 57 cal 3,-4(3)
58 l 0,0(4) 58 l 0,0(4)
59 cmpi 0,6,0 59 cmpi 0,6,0
60 mtctr 5 60 mtctr 5
61 mul 9,0,6 61 mul 9,0,6
62 srai 7,0,31 62 srai 7,0,31
63 and 7,7,6 63 and 7,7,6
64 mfmq 11 64 mfmq 11
65 cax 9,9,7 65 cax 9,9,7
66 l 7,4(3) 66 l 7,4(3)
67 sf 8,11,7 # add res_limb 67 sf 8,11,7 # add res_limb
68 a 11,8,11 # invert cy (r11 is junk) 68 a 11,8,11 # invert cy (r11 is junk)
69 blt Lneg 69 blt Lneg
70Lpos: bdz Lend 70Lpos: bdz Lend
71 71
72Lploop: lu 0,4(4) 72Lploop: lu 0,4(4)
73 stu 8,4(3) 73 stu 8,4(3)
74 cmpi 0,0,0 74 cmpi 0,0,0
75 mul 10,0,6 75 mul 10,0,6
76 mfmq 0 76 mfmq 0
77 ae 11,0,9 # low limb + old_cy_limb + old cy 77 ae 11,0,9 # low limb + old_cy_limb + old cy
78 l 7,4(3) 78 l 7,4(3)
79 aze 10,10 # propagate cy to new cy_limb 79 aze 10,10 # propagate cy to new cy_limb
80 sf 8,11,7 # add res_limb 80 sf 8,11,7 # add res_limb
81 a 11,8,11 # invert cy (r11 is junk) 81 a 11,8,11 # invert cy (r11 is junk)
82 bge Lp0 82 bge Lp0
83 cax 10,10,6 # adjust high limb for negative limb from s1 83 cax 10,10,6 # adjust high limb for negative limb from s1
84Lp0: bdz Lend0 84Lp0: bdz Lend0
85 lu 0,4(4) 85 lu 0,4(4)
86 stu 8,4(3) 86 stu 8,4(3)
87 cmpi 0,0,0 87 cmpi 0,0,0
88 mul 9,0,6 88 mul 9,0,6
89 mfmq 0 89 mfmq 0
90 ae 11,0,10 90 ae 11,0,10
91 l 7,4(3) 91 l 7,4(3)
92 aze 9,9 92 aze 9,9
93 sf 8,11,7 93 sf 8,11,7
94 a 11,8,11 # invert cy (r11 is junk) 94 a 11,8,11 # invert cy (r11 is junk)
95 bge Lp1 95 bge Lp1
96 cax 9,9,6 # adjust high limb for negative limb from s1 96 cax 9,9,6 # adjust high limb for negative limb from s1
97Lp1: bdn Lploop 97Lp1: bdn Lploop
98 98
99 b Lend 99 b Lend
100 100
101Lneg: cax 9,9,0 101Lneg: cax 9,9,0
102 bdz Lend 102 bdz Lend
103Lnloop: lu 0,4(4) 103Lnloop: lu 0,4(4)
104 stu 8,4(3) 104 stu 8,4(3)
105 cmpi 0,0,0 105 cmpi 0,0,0
106 mul 10,0,6 106 mul 10,0,6
107 mfmq 7 107 mfmq 7
108 ae 11,7,9 108 ae 11,7,9
109 l 7,4(3) 109 l 7,4(3)
110 ae 10,10,0 # propagate cy to new cy_limb 110 ae 10,10,0 # propagate cy to new cy_limb
111 sf 8,11,7 # add res_limb 111 sf 8,11,7 # add res_limb
112 a 11,8,11 # invert cy (r11 is junk) 112 a 11,8,11 # invert cy (r11 is junk)
113 bge Ln0 113 bge Ln0
114 cax 10,10,6 # adjust high limb for negative limb from s1 114 cax 10,10,6 # adjust high limb for negative limb from s1
115Ln0: bdz Lend0 115Ln0: bdz Lend0
116 lu 0,4(4) 116 lu 0,4(4)
117 stu 8,4(3) 117 stu 8,4(3)
118 cmpi 0,0,0 118 cmpi 0,0,0
119 mul 9,0,6 119 mul 9,0,6
120 mfmq 7 120 mfmq 7
121 ae 11,7,10 121 ae 11,7,10
122 l 7,4(3) 122 l 7,4(3)
123 ae 9,9,0 # propagate cy to new cy_limb 123 ae 9,9,0 # propagate cy to new cy_limb
124 sf 8,11,7 # add res_limb 124 sf 8,11,7 # add res_limb
125 a 11,8,11 # invert cy (r11 is junk) 125 a 11,8,11 # invert cy (r11 is junk)
126 bge Ln1 126 bge Ln1
127 cax 9,9,6 # adjust high limb for negative limb from s1 127 cax 9,9,6 # adjust high limb for negative limb from s1
128Ln1: bdn Lnloop 128Ln1: bdn Lnloop
129 b Lend 129 b Lend
130 130
131Lend0: cal 9,0(10) 131Lend0: cal 9,0(10)
132Lend: st 8,4(3) 132Lend: st 8,4(3)
133 aze 3,9 133 aze 3,9
134 br 134 br
135 135
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-rshift.S
index 0e85ae3..f131a86 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-rshift.S
@@ -1,64 +1,64 @@
1/* IBM POWER rshift 1/* IBM POWER rshift
2 * 2 *
3 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */ 20 */
21 21
22#include "sysdep.h" 22#include "sysdep.h"
23#include "asm-syntax.h" 23#include "asm-syntax.h"
24 24
25 25
26/* 26/*
27# INPUT PARAMETERS 27# INPUT PARAMETERS
28# res_ptr r3 28# res_ptr r3
29# s_ptr r4 29# s_ptr r4
30# size r5 30# size r5
31# cnt r6 31# cnt r6
32*/ 32*/
33 33
34 .toc 34 .toc
35 .extern _gcry_mpih_rshift[DS] 35 .extern _gcry_mpih_rshift[DS]
36 .extern ._gcry_mpih_rshift 36 .extern ._gcry_mpih_rshift
37.csect [PR] 37.csect [PR]
38 .align 2 38 .align 2
39 .globl _gcry_mpih_rshift 39 .globl _gcry_mpih_rshift
40 .globl ._gcry_mpih_rshift 40 .globl ._gcry_mpih_rshift
41 .csect _gcry_mpih_rshift[DS] 41 .csect _gcry_mpih_rshift[DS]
42_gcry_mpih_rshift: 42_gcry_mpih_rshift:
43 .long ._gcry_mpih_rshift, TOC[tc0], 0 43 .long ._gcry_mpih_rshift, TOC[tc0], 0
44 .csect [PR] 44 .csect [PR]
45._gcry_mpih_rshift: 45._gcry_mpih_rshift:
46 sfi 8,6,32 46 sfi 8,6,32
47 mtctr 5 # put limb count in CTR loop register 47 mtctr 5 # put limb count in CTR loop register
48 l 0,0(4) # read least significant limb 48 l 0,0(4) # read least significant limb
49 ai 9,3,-4 # adjust res_ptr since it's offset in the stu:s 49 ai 9,3,-4 # adjust res_ptr since it's offset in the stu:s
50 sle 3,0,8 # compute carry limb, and init MQ register 50 sle 3,0,8 # compute carry limb, and init MQ register
51 bdz Lend2 # if just one limb, skip loop 51 bdz Lend2 # if just one limb, skip loop
52 lu 0,4(4) # read 2:nd least significant limb 52 lu 0,4(4) # read 2:nd least significant limb
53 sleq 7,0,8 # compute least significant limb of result 53 sleq 7,0,8 # compute least significant limb of result
54 bdz Lend # if just two limb, skip loop 54 bdz Lend # if just two limb, skip loop
55Loop: lu 0,4(4) # load next higher limb 55Loop: lu 0,4(4) # load next higher limb
56 stu 7,4(9) # store previous result during read latency 56 stu 7,4(9) # store previous result during read latency
57 sleq 7,0,8 # compute result limb 57 sleq 7,0,8 # compute result limb
58 bdn Loop # loop back until CTR is zero 58 bdn Loop # loop back until CTR is zero
59Lend: stu 7,4(9) # store 2:nd most significant limb 59Lend: stu 7,4(9) # store 2:nd most significant limb
60Lend2: sre 7,0,6 # compute most significant limb 60Lend2: sre 7,0,6 # compute most significant limb
61 st 7,4(9) # store it 61 st 7,4(9) # store it
62 br 62 br
63 63
64 64
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-sub1.S
index 5e08ac3..02748fc 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-sub1.S
@@ -1,88 +1,88 @@
1/* IBM POWER sub_n -- Subtract two limb vectors of equal, non-zero length. 1/* IBM POWER sub_n -- Subtract two limb vectors of equal, non-zero length.
2 * 2 *
3 * Copyright (C) 1992, 1994, 1995, 1996, 1999, 3 * Copyright (C) 1992, 1994, 1995, 1996, 1999,
4 * 2002 Free Software Foundation, Inc. 4 * 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26/* 26/*
27# INPUT PARAMETERS 27# INPUT PARAMETERS
28# res_ptr r3 28# res_ptr r3
29# s1_ptr r4 29# s1_ptr r4
30# s2_ptr r5 30# s2_ptr r5
31# size r6 31# size r6
32 */ 32 */
33 33
34 .toc 34 .toc
35 .extern _gcry_mpih_sub_n[DS] 35 .extern _gcry_mpih_sub_n[DS]
36 .extern ._gcry_mpih_sub_n 36 .extern ._gcry_mpih_sub_n
37.csect [PR] 37.csect [PR]
38 .align 2 38 .align 2
39 .globl _gcry_mpih_sub_n 39 .globl _gcry_mpih_sub_n
40 .globl ._gcry_mpih_sub_n 40 .globl ._gcry_mpih_sub_n
41 .csect _gcry_mpih_sub_n[DS] 41 .csect _gcry_mpih_sub_n[DS]
42_gcry_mpih_sub_n: 42_gcry_mpih_sub_n:
43 .long ._gcry_mpih_sub_n, TOC[tc0], 0 43 .long ._gcry_mpih_sub_n, TOC[tc0], 0
44 .csect [PR] 44 .csect [PR]
45._gcry_mpih_sub_n: 45._gcry_mpih_sub_n:
46 andil. 10,6,1 # odd or even number of limbs? 46 andil. 10,6,1 # odd or even number of limbs?
47 l 8,0(4) # load least significant s1 limb 47 l 8,0(4) # load least significant s1 limb
48 l 0,0(5) # load least significant s2 limb 48 l 0,0(5) # load least significant s2 limb
49 cal 3,-4(3) # offset res_ptr, it's updated before it's used 49 cal 3,-4(3) # offset res_ptr, it's updated before it's used
50 sri 10,6,1 # count for unrolled loop 50 sri 10,6,1 # count for unrolled loop
51 sf 7,0,8 # subtract least significant limbs, set cy 51 sf 7,0,8 # subtract least significant limbs, set cy
52 mtctr 10 # copy count into CTR 52 mtctr 10 # copy count into CTR
53 beq 0,Leven # branch if even # of limbs (# of limbs >= 2) 53 beq 0,Leven # branch if even # of limbs (# of limbs >= 2)
54 54
55# We have an odd # of limbs. Add the first limbs separately. 55# We have an odd # of limbs. Add the first limbs separately.
56 cmpi 1,10,0 # is count for unrolled loop zero? 56 cmpi 1,10,0 # is count for unrolled loop zero?
57 bne 1,L1 # branch if not 57 bne 1,L1 # branch if not
58 st 7,4(3) 58 st 7,4(3)
59 sfe 3,0,0 # load !cy into ... 59 sfe 3,0,0 # load !cy into ...
60 sfi 3,3,0 # ... return value register 60 sfi 3,3,0 # ... return value register
61 br # return 61 br # return
62 62
63# We added least significant limbs. Now reload the next limbs to enter loop. 63# We added least significant limbs. Now reload the next limbs to enter loop.
64L1: lu 8,4(4) # load s1 limb and update s1_ptr 64L1: lu 8,4(4) # load s1 limb and update s1_ptr
65 lu 0,4(5) # load s2 limb and update s2_ptr 65 lu 0,4(5) # load s2 limb and update s2_ptr
66 stu 7,4(3) 66 stu 7,4(3)
67 sfe 7,0,8 # subtract limbs, set cy 67 sfe 7,0,8 # subtract limbs, set cy
68Leven: lu 9,4(4) # load s1 limb and update s1_ptr 68Leven: lu 9,4(4) # load s1 limb and update s1_ptr
69 lu 10,4(5) # load s2 limb and update s2_ptr 69 lu 10,4(5) # load s2 limb and update s2_ptr
70 bdz Lend # If done, skip loop 70 bdz Lend # If done, skip loop
71 71
72Loop: lu 8,4(4) # load s1 limb and update s1_ptr 72Loop: lu 8,4(4) # load s1 limb and update s1_ptr
73 lu 0,4(5) # load s2 limb and update s2_ptr 73 lu 0,4(5) # load s2 limb and update s2_ptr
74 sfe 11,10,9 # subtract previous limbs with cy, set cy 74 sfe 11,10,9 # subtract previous limbs with cy, set cy
75 stu 7,4(3) # 75 stu 7,4(3) #
76 lu 9,4(4) # load s1 limb and update s1_ptr 76 lu 9,4(4) # load s1 limb and update s1_ptr
77 lu 10,4(5) # load s2 limb and update s2_ptr 77 lu 10,4(5) # load s2 limb and update s2_ptr
78 sfe 7,0,8 # subtract previous limbs with cy, set cy 78 sfe 7,0,8 # subtract previous limbs with cy, set cy
79 stu 11,4(3) # 79 stu 11,4(3) #
80 bdn Loop # decrement CTR and loop back 80 bdn Loop # decrement CTR and loop back
81 81
82Lend: sfe 11,10,9 # subtract limbs with cy, set cy 82Lend: sfe 11,10,9 # subtract limbs with cy, set cy
83 st 7,4(3) # 83 st 7,4(3) #
84 st 11,8(3) # 84 st 11,8(3) #
85 sfe 3,0,0 # load !cy into ... 85 sfe 3,0,0 # load !cy into ...
86 sfi 3,3,0 # ... return value register 86 sfi 3,3,0 # ... return value register
87 br 87 br
88 88
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/Manifest
index 239449b..26ab6ea 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/Manifest
@@ -1,28 +1,28 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-add1.S 20mpih-add1.S
21mpih-sub1.S 21mpih-sub1.S
22mpih-mul1.S 22mpih-mul1.S
23mpih-mul2.S 23mpih-mul2.S
24mpih-mul3.S 24mpih-mul3.S
25mpih-lshift.S 25mpih-lshift.S
26mpih-rshift.S 26mpih-rshift.S
27syntax.h 27syntax.h
28$names$ iQCVAwUAP+LmYzEAnp832S/7AQI/cQP+Mcg9rF/c/bJTY48PE1/ARt7vCMtpIlv9alZSSSrU3WHzCtv9nVczFmwHU3DdKFawigY2DljQcK92dZ5ZlOfpFNMz4PKlVMWaKDk+jKlqm2dxvlHuqEvXPpjFAE2gHrhq5qLXS5ZHeMLJIEK84GYC6fjfLUMdZU3altXTUBvoXhA==Yax+ 28$names$ iQCVAwUAP+LmYzEAnp832S/7AQI/cQP+Mcg9rF/c/bJTY48PE1/ARt7vCMtpIlv9alZSSSrU3WHzCtv9nVczFmwHU3DdKFawigY2DljQcK92dZ5ZlOfpFNMz4PKlVMWaKDk+jKlqm2dxvlHuqEvXPpjFAE2gHrhq5qLXS5ZHeMLJIEK84GYC6fjfLUMdZU3altXTUBvoXhA==Yax+
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/distfiles
index 923b110..a086614 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/distfiles
@@ -1,10 +1,10 @@
1Manifest 1Manifest
2mpih-add1.S 2mpih-add1.S
3mpih-sub1.S 3mpih-sub1.S
4mpih-mul1.S 4mpih-mul1.S
5mpih-mul2.S 5mpih-mul2.S
6mpih-mul3.S 6mpih-mul3.S
7mpih-lshift.S 7mpih-lshift.S
8mpih-rshift.S 8mpih-rshift.S
9syntax.h 9syntax.h
10 10
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-add1.S
index bfc2c01..1661f5e 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-add1.S
@@ -1,136 +1,136 @@
1/* PowerPC-32 add_n -- Add two limb vectors of equal, non-zero length. 1/* PowerPC-32 add_n -- Add two limb vectors of equal, non-zero length.
2 * 2 *
3 * Copyright (C) 1992, 1994, 1995, 1998, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1992, 1994, 1995, 1998, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */ 20 */
21 21
22#include "sysdep.h" 22#include "sysdep.h"
23#include "asm-syntax.h" 23#include "asm-syntax.h"
24 24
25 25
26#ifndef USE_PPC_PATCHES 26#ifndef USE_PPC_PATCHES
27 27
28/******************* 28/*******************
29 * mpi_limb_t 29 * mpi_limb_t
30 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (r3) 30 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, (r3)
31 * mpi_ptr_t s1_ptr, (r4) 31 * mpi_ptr_t s1_ptr, (r4)
32 * mpi_ptr_t s2_ptr, (r5) 32 * mpi_ptr_t s2_ptr, (r5)
33 * mpi_size_t size) (r6) 33 * mpi_size_t size) (r6)
34 */ 34 */
35 35
36 .toc 36 .toc
37 .extern _gcry_mpih_add_n[DS] 37 .extern _gcry_mpih_add_n[DS]
38 .extern ._gcry_mpih_add_n 38 .extern ._gcry_mpih_add_n
39.csect [PR] 39.csect [PR]
40 .align 2 40 .align 2
41 .globl _gcry_mpih_add_n 41 .globl _gcry_mpih_add_n
42 .globl ._gcry_mpih_add_n 42 .globl ._gcry_mpih_add_n
43 .csect _gcry_mpih_add_n[DS] 43 .csect _gcry_mpih_add_n[DS]
44_gcry_mpih_add_n: 44_gcry_mpih_add_n:
45 .long ._gcry_mpih_add_n, TOC[tc0], 0 45 .long ._gcry_mpih_add_n, TOC[tc0], 0
46 .csect [PR] 46 .csect [PR]
47._gcry_mpih_add_n: 47._gcry_mpih_add_n:
48 mtctr 6 # copy size into CTR 48 mtctr 6 # copy size into CTR
49 lwz 8,0(4) # load least significant s1 limb 49 lwz 8,0(4) # load least significant s1 limb
50 lwz 0,0(5) # load least significant s2 limb 50 lwz 0,0(5) # load least significant s2 limb
51 addi 3,3,-4 # offset res_ptr, it is updated before used 51 addi 3,3,-4 # offset res_ptr, it is updated before used
52 addc 7,0,8 # add least significant limbs, set cy 52 addc 7,0,8 # add least significant limbs, set cy
53 bdz Lend # If done, skip loop 53 bdz Lend # If done, skip loop
54Loop: lwzu 8,4(4) # load s1 limb and update s1_ptr 54Loop: lwzu 8,4(4) # load s1 limb and update s1_ptr
55 lwzu 0,4(5) # load s2 limb and update s2_ptr 55 lwzu 0,4(5) # load s2 limb and update s2_ptr
56 stwu 7,4(3) # store previous limb in load latency slot 56 stwu 7,4(3) # store previous limb in load latency slot
57 adde 7,0,8 # add new limbs with cy, set cy 57 adde 7,0,8 # add new limbs with cy, set cy
58 bdnz Loop # decrement CTR and loop back 58 bdnz Loop # decrement CTR and loop back
59Lend: stw 7,4(3) # store ultimate result limb 59Lend: stw 7,4(3) # store ultimate result limb
60 li 3,0 # load cy into ... 60 li 3,0 # load cy into ...
61 addze 3,3 # ... return value register 61 addze 3,3 # ... return value register
62 blr 62 blr
63 63
64#else 64#else
65/* Add two limb vectors of equal, non-zero length for PowerPC. 65/* Add two limb vectors of equal, non-zero length for PowerPC.
66 Copyright (C) 1997 Free Software Foundation, Inc. 66 Copyright (C) 1997 Free Software Foundation, Inc.
67 This file is part of the GNU C Library. 67 This file is part of the GNU C Library.
68 68
69 The GNU C Library is free software; you can redistribute it and/or 69 The GNU C Library is free software; you can redistribute it and/or
70 modify it under the terms of the GNU Library General Public License as 70 modify it under the terms of the GNU Library General Public License as
71 published by the Free Software Foundation; either version 2 of the 71 published by the Free Software Foundation; either version 2 of the
72 License, or (at your option) any later version. 72 License, or (at your option) any later version.
73 73
74 The GNU C Library is distributed in the hope that it will be useful, 74 The GNU C Library is distributed in the hope that it will be useful,
75 but WITHOUT ANY WARRANTY; without even the implied warranty of 75 but WITHOUT ANY WARRANTY; without even the implied warranty of
76 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 76 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
77 Library General Public License for more details. 77 Library General Public License for more details.
78 78
79 You should have received a copy of the GNU Library General Public 79 You should have received a copy of the GNU Library General Public
80 License along with the GNU C Library; see the file COPYING.LIB. If not, 80 License along with the GNU C Library; see the file COPYING.LIB. If not,
81 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 81 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
82 Boston, MA 02111-1307, USA. */ 82 Boston, MA 02111-1307, USA. */
83 83
84#include "sysdep.h" 84#include "sysdep.h"
85#include "asm-syntax.h" 85#include "asm-syntax.h"
86 86
87 87
88/* mp_limb_t mpn_add_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr, 88/* mp_limb_t mpn_add_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr,
89 mp_size_t size) 89 mp_size_t size)
90 Calculate s1+s2 and put result in res_ptr; return carry, 0 or 1. */ 90 Calculate s1+s2 and put result in res_ptr; return carry, 0 or 1. */
91 91
92/* Note on optimisation: This code is optimal for the 601. Almost every other 92/* Note on optimisation: This code is optimal for the 601. Almost every other
93 possible 2-unrolled inner loop will not be. Also, watch out for the 93 possible 2-unrolled inner loop will not be. Also, watch out for the
94 alignment... */ 94 alignment... */
95 95
96EALIGN(_gcry_mpih_add_n,3,0) 96EALIGN(_gcry_mpih_add_n,3,0)
97/* Set up for loop below. */ 97/* Set up for loop below. */
98 mtcrf 0x01,%r6 98 mtcrf 0x01,%r6
99 srwi. %r7,%r6,1 99 srwi. %r7,%r6,1
100 li %r10,0 100 li %r10,0
101 mtctr %r7 101 mtctr %r7
102 bt 31,2f 102 bt 31,2f
103 103
104/* Clear the carry. */ 104/* Clear the carry. */
105 addic %r0,%r0,0 105 addic %r0,%r0,0
106/* Adjust pointers for loop. */ 106/* Adjust pointers for loop. */
107 addi %r3,%r3,-4 107 addi %r3,%r3,-4
108 addi %r4,%r4,-4 108 addi %r4,%r4,-4
109 addi %r5,%r5,-4 109 addi %r5,%r5,-4
110 b 0f 110 b 0f
111 111
1122: lwz %r7,0(%r5) 1122: lwz %r7,0(%r5)
113 lwz %r6,0(%r4) 113 lwz %r6,0(%r4)
114 addc %r6,%r6,%r7 114 addc %r6,%r6,%r7
115 stw %r6,0(%r3) 115 stw %r6,0(%r3)
116 beq 1f 116 beq 1f
117 117
118/* The loop. */ 118/* The loop. */
119 119
120/* Align start of loop to an odd word boundary to guarantee that the 120/* Align start of loop to an odd word boundary to guarantee that the
121 last two words can be fetched in one access (for 601). */ 121 last two words can be fetched in one access (for 601). */
1220: lwz %r9,4(%r4) 1220: lwz %r9,4(%r4)
123 lwz %r8,4(%r5) 123 lwz %r8,4(%r5)
124 lwzu %r6,8(%r4) 124 lwzu %r6,8(%r4)
125 lwzu %r7,8(%r5) 125 lwzu %r7,8(%r5)
126 adde %r8,%r9,%r8 126 adde %r8,%r9,%r8
127 stw %r8,4(%r3) 127 stw %r8,4(%r3)
128 adde %r6,%r6,%r7 128 adde %r6,%r6,%r7
129 stwu %r6,8(%r3) 129 stwu %r6,8(%r3)
130 bdnz 0b 130 bdnz 0b
131/* Return the carry. */ 131/* Return the carry. */
1321: addze %r3,%r10 1321: addze %r3,%r10
133 blr 133 blr
134END(_gcry_mpih_add_n) 134END(_gcry_mpih_add_n)
135#endif 135#endif
136 136
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-lshift.S
index 013a350..6231095 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-lshift.S
@@ -1,198 +1,198 @@
1/* PowerPC-32 lshift 1/* PowerPC-32 lshift
2 * 2 *
3 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */ 20 */
21 21
22#include "sysdep.h" 22#include "sysdep.h"
23#include "asm-syntax.h" 23#include "asm-syntax.h"
24 24
25 25
26#ifndef USE_PPC_PATCHES 26#ifndef USE_PPC_PATCHES
27 27
28/******************* 28/*******************
29 * mpi_limb_t 29 * mpi_limb_t
30 * _gcry_mpih_lshift( mpi_ptr_t wp, (r3) 30 * _gcry_mpih_lshift( mpi_ptr_t wp, (r3)
31 * mpi_ptr_t up, (r4) 31 * mpi_ptr_t up, (r4)
32 * mpi_size_t usize, (r5) 32 * mpi_size_t usize, (r5)
33 * unsigned cnt) (r6) 33 * unsigned cnt) (r6)
34 */ 34 */
35 35
36 .toc 36 .toc
37.csect .text[PR] 37.csect .text[PR]
38 .align 2 38 .align 2
39 .globl _gcry_mpih_lshift 39 .globl _gcry_mpih_lshift
40 .globl ._gcry_mpih_lshift 40 .globl ._gcry_mpih_lshift
41 .csect _gcry_mpih_lshift[DS] 41 .csect _gcry_mpih_lshift[DS]
42_gcry_mpih_lshift: 42_gcry_mpih_lshift:
43 .long ._gcry_mpih_lshift, TOC[tc0], 0 43 .long ._gcry_mpih_lshift, TOC[tc0], 0
44 .csect .text[PR] 44 .csect .text[PR]
45._gcry_mpih_lshift: 45._gcry_mpih_lshift:
46 mtctr 5 # copy size into CTR 46 mtctr 5 # copy size into CTR
47 slwi 0,5,2 47 slwi 0,5,2
48 add 7,3,0 # make r7 point at end of res 48 add 7,3,0 # make r7 point at end of res
49 add 4,4,0 # make r4 point at end of s1 49 add 4,4,0 # make r4 point at end of s1
50 subfic 8,6,32 50 subfic 8,6,32
51 lwzu 11,-4(4) # load first s1 limb 51 lwzu 11,-4(4) # load first s1 limb
52 srw 3,11,8 # compute function return value 52 srw 3,11,8 # compute function return value
53 bdz Lend1 53 bdz Lend1
54 54
55Loop: lwzu 10,-4(4) 55Loop: lwzu 10,-4(4)
56 slw 9,11,6 56 slw 9,11,6
57 srw 12,10,8 57 srw 12,10,8
58 or 9,9,12 58 or 9,9,12
59 stwu 9,-4(7) 59 stwu 9,-4(7)
60 bdz Lend2 60 bdz Lend2
61 lwzu 11,-4(4) 61 lwzu 11,-4(4)
62 slw 9,10,6 62 slw 9,10,6
63 srw 12,11,8 63 srw 12,11,8
64 or 9,9,12 64 or 9,9,12
65 stwu 9,-4(7) 65 stwu 9,-4(7)
66 bdnz Loop 66 bdnz Loop
67 67
68Lend1: slw 0,11,6 68Lend1: slw 0,11,6
69 stw 0,-4(7) 69 stw 0,-4(7)
70 blr 70 blr
71 71
72Lend2: slw 0,10,6 72Lend2: slw 0,10,6
73 stw 0,-4(7) 73 stw 0,-4(7)
74 blr 74 blr
75 75
76#else 76#else
77/* Shift a limb left, low level routine. 77/* Shift a limb left, low level routine.
78 Copyright (C) 1996, 1997 Free Software Foundation, Inc. 78 Copyright (C) 1996, 1997 Free Software Foundation, Inc.
79 This file is part of the GNU C Library. 79 This file is part of the GNU C Library.
80 80
81 The GNU C Library is free software; you can redistribute it and/or 81 The GNU C Library is free software; you can redistribute it and/or
82 modify it under the terms of the GNU Library General Public License as 82 modify it under the terms of the GNU Library General Public License as
83 published by the Free Software Foundation; either version 2 of the 83 published by the Free Software Foundation; either version 2 of the
84 License, or (at your option) any later version. 84 License, or (at your option) any later version.
85 85
86 The GNU C Library is distributed in the hope that it will be useful, 86 The GNU C Library is distributed in the hope that it will be useful,
87 but WITHOUT ANY WARRANTY; without even the implied warranty of 87 but WITHOUT ANY WARRANTY; without even the implied warranty of
88 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 88 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
89 Library General Public License for more details. 89 Library General Public License for more details.
90 90
91 You should have received a copy of the GNU Library General Public 91 You should have received a copy of the GNU Library General Public
92 License along with the GNU C Library; see the file COPYING.LIB. If not, 92 License along with the GNU C Library; see the file COPYING.LIB. If not,
93 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 93 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
94 Boston, MA 02111-1307, USA. */ 94 Boston, MA 02111-1307, USA. */
95 95
96/* mp_limb_t mpn_lshift (mp_ptr wp, mp_srcptr up, mp_size_t usize, 96/* mp_limb_t mpn_lshift (mp_ptr wp, mp_srcptr up, mp_size_t usize,
97 unsigned int cnt) */ 97 unsigned int cnt) */
98 98
99EALIGN(_gcry_mpih_lshift,3,0) 99EALIGN(_gcry_mpih_lshift,3,0)
100 mtctr %r5 # copy size into CTR 100 mtctr %r5 # copy size into CTR
101 cmplwi %cr0,%r5,16 # is size < 16 101 cmplwi %cr0,%r5,16 # is size < 16
102 slwi %r0,%r5,2 102 slwi %r0,%r5,2
103 add %r7,%r3,%r0 # make r7 point at end of res 103 add %r7,%r3,%r0 # make r7 point at end of res
104 add %r4,%r4,%r0 # make r4 point at end of s1 104 add %r4,%r4,%r0 # make r4 point at end of s1
105 lwzu %r11,-4(%r4) # load first s1 limb 105 lwzu %r11,-4(%r4) # load first s1 limb
106 subfic %r8,%r6,32 106 subfic %r8,%r6,32
107 srw %r3,%r11,%r8 # compute function return value 107 srw %r3,%r11,%r8 # compute function return value
108 bge %cr0,L(big) # branch if size >= 16 108 bge %cr0,L(big) # branch if size >= 16
109 109
110 bdz L(end1) 110 bdz L(end1)
111 111
1120: lwzu %r10,-4(%r4) 1120: lwzu %r10,-4(%r4)
113 slw %r9,%r11,%r6 113 slw %r9,%r11,%r6
114 srw %r12,%r10,%r8 114 srw %r12,%r10,%r8
115 or %r9,%r9,%r12 115 or %r9,%r9,%r12
116 stwu %r9,-4(%r7) 116 stwu %r9,-4(%r7)
117 bdz L(end2) 117 bdz L(end2)
118 lwzu %r11,-4(%r4) 118 lwzu %r11,-4(%r4)
119 slw %r9,%r10,%r6 119 slw %r9,%r10,%r6
120 srw %r12,%r11,%r8 120 srw %r12,%r11,%r8
121 or %r9,%r9,%r12 121 or %r9,%r9,%r12
122 stwu %r9,-4(%r7) 122 stwu %r9,-4(%r7)
123 bdnz 0b 123 bdnz 0b
124 124
125L(end1):slw %r0,%r11,%r6 125L(end1):slw %r0,%r11,%r6
126 stw %r0,-4(%r7) 126 stw %r0,-4(%r7)
127 blr 127 blr
128 128
129 129
130/* Guaranteed not to succeed. */ 130/* Guaranteed not to succeed. */
131L(boom): tweq %r0,%r0 131L(boom): tweq %r0,%r0
132 132
133/* We imitate a case statement, by using (yuk!) fixed-length code chunks, 133/* We imitate a case statement, by using (yuk!) fixed-length code chunks,
134 of size 4*12 bytes. We have to do this (or something) to make this PIC. */ 134 of size 4*12 bytes. We have to do this (or something) to make this PIC. */
135L(big): mflr %r9 135L(big): mflr %r9
136 bltl- %cr0,L(boom) # Never taken, only used to set LR. 136 bltl- %cr0,L(boom) # Never taken, only used to set LR.
137 slwi %r10,%r6,4 137 slwi %r10,%r6,4
138 mflr %r12 138 mflr %r12
139 add %r10,%r12,%r10 139 add %r10,%r12,%r10
140 slwi %r8,%r6,5 140 slwi %r8,%r6,5
141 add %r10,%r8,%r10 141 add %r10,%r8,%r10
142 mtctr %r10 142 mtctr %r10
143 addi %r5,%r5,-1 143 addi %r5,%r5,-1
144 mtlr %r9 144 mtlr %r9
145 bctr 145 bctr
146 146
147L(end2):slw %r0,%r10,%r6 147L(end2):slw %r0,%r10,%r6
148 stw %r0,-4(%r7) 148 stw %r0,-4(%r7)
149 blr 149 blr
150 150
151#define DO_LSHIFT(n) \ 151#define DO_LSHIFT(n) \
152 mtctr %r5; \ 152 mtctr %r5; \
1530: lwzu %r10,-4(%r4); \ 1530: lwzu %r10,-4(%r4); \
154 slwi %r9,%r11,n; \ 154 slwi %r9,%r11,n; \
155 inslwi %r9,%r10,n,32-n; \ 155 inslwi %r9,%r10,n,32-n; \
156 stwu %r9,-4(%r7); \ 156 stwu %r9,-4(%r7); \
157 bdz- L(end2); \ 157 bdz- L(end2); \
158 lwzu %r11,-4(%r4); \ 158 lwzu %r11,-4(%r4); \
159 slwi %r9,%r10,n; \ 159 slwi %r9,%r10,n; \
160 inslwi %r9,%r11,n,32-n; \ 160 inslwi %r9,%r11,n,32-n; \
161 stwu %r9,-4(%r7); \ 161 stwu %r9,-4(%r7); \
162 bdnz 0b; \ 162 bdnz 0b; \
163 b L(end1) 163 b L(end1)
164 164
165 DO_LSHIFT(1) 165 DO_LSHIFT(1)
166 DO_LSHIFT(2) 166 DO_LSHIFT(2)
167 DO_LSHIFT(3) 167 DO_LSHIFT(3)
168 DO_LSHIFT(4) 168 DO_LSHIFT(4)
169 DO_LSHIFT(5) 169 DO_LSHIFT(5)
170 DO_LSHIFT(6) 170 DO_LSHIFT(6)
171 DO_LSHIFT(7) 171 DO_LSHIFT(7)
172 DO_LSHIFT(8) 172 DO_LSHIFT(8)
173 DO_LSHIFT(9) 173 DO_LSHIFT(9)
174 DO_LSHIFT(10) 174 DO_LSHIFT(10)
175 DO_LSHIFT(11) 175 DO_LSHIFT(11)
176 DO_LSHIFT(12) 176 DO_LSHIFT(12)
177 DO_LSHIFT(13) 177 DO_LSHIFT(13)
178 DO_LSHIFT(14) 178 DO_LSHIFT(14)
179 DO_LSHIFT(15) 179 DO_LSHIFT(15)
180 DO_LSHIFT(16) 180 DO_LSHIFT(16)
181 DO_LSHIFT(17) 181 DO_LSHIFT(17)
182 DO_LSHIFT(18) 182 DO_LSHIFT(18)
183 DO_LSHIFT(19) 183 DO_LSHIFT(19)
184 DO_LSHIFT(20) 184 DO_LSHIFT(20)
185 DO_LSHIFT(21) 185 DO_LSHIFT(21)
186 DO_LSHIFT(22) 186 DO_LSHIFT(22)
187 DO_LSHIFT(23) 187 DO_LSHIFT(23)
188 DO_LSHIFT(24) 188 DO_LSHIFT(24)
189 DO_LSHIFT(25) 189 DO_LSHIFT(25)
190 DO_LSHIFT(26) 190 DO_LSHIFT(26)
191 DO_LSHIFT(27) 191 DO_LSHIFT(27)
192 DO_LSHIFT(28) 192 DO_LSHIFT(28)
193 DO_LSHIFT(29) 193 DO_LSHIFT(29)
194 DO_LSHIFT(30) 194 DO_LSHIFT(30)
195 DO_LSHIFT(31) 195 DO_LSHIFT(31)
196 196
197END(_gcry_mpih_lshift) 197END(_gcry_mpih_lshift)
198#endif 198#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul1.S
index e34f521..bd418f7 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul1.S
@@ -1,120 +1,120 @@
1/* PowerPC-32 mul_1 -- Multiply a limb vector with a limb and store 1/* PowerPC-32 mul_1 -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector. 2 * the result in a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1993, 1994, 1995, 4 * Copyright (C) 1992, 1993, 1994, 1995,
5 * 1998, 2002 Free Software Foundation, Inc. 5 * 1998, 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 23
24#include "sysdep.h" 24#include "sysdep.h"
25#include "asm-syntax.h" 25#include "asm-syntax.h"
26 26
27 27
28#ifndef USE_PPC_PATCHES 28#ifndef USE_PPC_PATCHES
29 29
30/******************* 30/*******************
31 * mpi_limb_t 31 * mpi_limb_t
32 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r3) 32 * _gcry_mpih_mul_1( mpi_ptr_t res_ptr, (r3)
33 * mpi_ptr_t s1_ptr, (r4) 33 * mpi_ptr_t s1_ptr, (r4)
34 * mpi_size_t s1_size, (r5) 34 * mpi_size_t s1_size, (r5)
35 * mpi_limb_t s2_limb) (r6) 35 * mpi_limb_t s2_limb) (r6)
36 * 36 *
37 * This is a fairly straightforward implementation. The timing of the PC601 37 * This is a fairly straightforward implementation. The timing of the PC601
38 * is hard to understand, so I will wait to optimize this until I have some 38 * is hard to understand, so I will wait to optimize this until I have some
39 * hardware to play with. 39 * hardware to play with.
40 * 40 *
41 * The code trivially generalizes to 64 bit limbs for the PC620. 41 * The code trivially generalizes to 64 bit limbs for the PC620.
42 */ 42 */
43 43
44 .toc 44 .toc
45 .csect ._gcry_mpih_mul_1[PR] 45 .csect ._gcry_mpih_mul_1[PR]
46 .align 2 46 .align 2
47 .globl _gcry_mpih_mul_1 47 .globl _gcry_mpih_mul_1
48 .globl ._gcry_mpih_mul_1 48 .globl ._gcry_mpih_mul_1
49 .csect _gcry_mpih_mul_1[DS] 49 .csect _gcry_mpih_mul_1[DS]
50_gcry_mpih_mul_1: 50_gcry_mpih_mul_1:
51 .long ._gcry_mpih_mul_1[PR], TOC[tc0], 0 51 .long ._gcry_mpih_mul_1[PR], TOC[tc0], 0
52 .csect ._gcry_mpih_mul_1[PR] 52 .csect ._gcry_mpih_mul_1[PR]
53._gcry_mpih_mul_1: 53._gcry_mpih_mul_1:
54 mtctr 5 54 mtctr 5
55 55
56 lwz 0,0(4) 56 lwz 0,0(4)
57 mullw 7,0,6 57 mullw 7,0,6
58 mulhwu 10,0,6 58 mulhwu 10,0,6
59 addi 3,3,-4 # adjust res_ptr 59 addi 3,3,-4 # adjust res_ptr
60 addic 5,5,0 # clear cy with dummy insn 60 addic 5,5,0 # clear cy with dummy insn
61 bdz Lend 61 bdz Lend
62 62
63Loop: lwzu 0,4(4) 63Loop: lwzu 0,4(4)
64 stwu 7,4(3) 64 stwu 7,4(3)
65 mullw 8,0,6 65 mullw 8,0,6
66 adde 7,8,10 66 adde 7,8,10
67 mulhwu 10,0,6 67 mulhwu 10,0,6
68 bdnz Loop 68 bdnz Loop
69 69
70Lend: stw 7,4(3) 70Lend: stw 7,4(3)
71 addze 3,10 71 addze 3,10
72 blr 72 blr
73 73
74#else 74#else
75/* Multiply a limb vector by a limb, for PowerPC. 75/* Multiply a limb vector by a limb, for PowerPC.
76 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc. 76 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
77 This file is part of the GNU C Library. 77 This file is part of the GNU C Library.
78 78
79 The GNU C Library is free software; you can redistribute it and/or 79 The GNU C Library is free software; you can redistribute it and/or
80 modify it under the terms of the GNU Library General Public License as 80 modify it under the terms of the GNU Library General Public License as
81 published by the Free Software Foundation; either version 2 of the 81 published by the Free Software Foundation; either version 2 of the
82 License, or (at your option) any later version. 82 License, or (at your option) any later version.
83 83
84 The GNU C Library is distributed in the hope that it will be useful, 84 The GNU C Library is distributed in the hope that it will be useful,
85 but WITHOUT ANY WARRANTY; without even the implied warranty of 85 but WITHOUT ANY WARRANTY; without even the implied warranty of
86 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 86 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
87 Library General Public License for more details. 87 Library General Public License for more details.
88 88
89 You should have received a copy of the GNU Library General Public 89 You should have received a copy of the GNU Library General Public
90 License along with the GNU C Library; see the file COPYING.LIB. If not, 90 License along with the GNU C Library; see the file COPYING.LIB. If not,
91 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 91 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
92 Boston, MA 02111-1307, USA. */ 92 Boston, MA 02111-1307, USA. */
93 93
94 94
95/* mp_limb_t mpn_mul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr, 95/* mp_limb_t mpn_mul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
96 mp_size_t s1_size, mp_limb_t s2_limb) 96 mp_size_t s1_size, mp_limb_t s2_limb)
97 Calculate s1*s2 and put result in res_ptr; return carry. */ 97 Calculate s1*s2 and put result in res_ptr; return carry. */
98 98
99ENTRY(_gcry_mpih_mul_1) 99ENTRY(_gcry_mpih_mul_1)
100 mtctr %r5 100 mtctr %r5
101 101
102 lwz %r0,0(%r4) 102 lwz %r0,0(%r4)
103 mullw %r7,%r0,%r6 103 mullw %r7,%r0,%r6
104 mulhwu %r10,%r0,%r6 104 mulhwu %r10,%r0,%r6
105 addi %r3,%r3,-4 # adjust res_ptr 105 addi %r3,%r3,-4 # adjust res_ptr
106 addic %r5,%r5,0 # clear cy with dummy insn 106 addic %r5,%r5,0 # clear cy with dummy insn
107 bdz 1f 107 bdz 1f
108 108
1090: lwzu %r0,4(%r4) 1090: lwzu %r0,4(%r4)
110 stwu %r7,4(%r3) 110 stwu %r7,4(%r3)
111 mullw %r8,%r0,%r6 111 mullw %r8,%r0,%r6
112 adde %r7,%r8,%r10 112 adde %r7,%r8,%r10
113 mulhwu %r10,%r0,%r6 113 mulhwu %r10,%r0,%r6
114 bdnz 0b 114 bdnz 0b
115 115
1161: stw %r7,4(%r3) 1161: stw %r7,4(%r3)
117 addze %r3,%r10 117 addze %r3,%r10
118 blr 118 blr
119END(_gcry_mpih_mul_1) 119END(_gcry_mpih_mul_1)
120#endif 120#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul2.S
index 1e1919b..1d97b81 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul2.S
@@ -1,127 +1,127 @@
1/* PowerPC-32 addmul_1 -- Multiply a limb vector with a limb and add 1/* PowerPC-32 addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector. 2 * the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc. 4 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26 26
27#ifndef USE_PPC_PATCHES 27#ifndef USE_PPC_PATCHES
28 28
29/******************* 29/*******************
30 * mpi_limb_t 30 * mpi_limb_t
31 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r3) 31 * _gcry_mpih_addmul_1( mpi_ptr_t res_ptr, (r3)
32 * mpi_ptr_t s1_ptr, (r4) 32 * mpi_ptr_t s1_ptr, (r4)
33 * mpi_size_t s1_size, (r5) 33 * mpi_size_t s1_size, (r5)
34 * mpi_limb_t s2_limb) (r6) 34 * mpi_limb_t s2_limb) (r6)
35 * 35 *
36 * This is a fairly straightforward implementation. The timing of the PC601 36 * This is a fairly straightforward implementation. The timing of the PC601
37 * is hard to understand, so I will wait to optimize this until I have some 37 * is hard to understand, so I will wait to optimize this until I have some
38 * hardware to play with. 38 * hardware to play with.
39 * 39 *
40 * The code trivially generalizes to 64 bit limbs for the PC620. 40 * The code trivially generalizes to 64 bit limbs for the PC620.
41 */ 41 */
42 42
43 43
44 .toc 44 .toc
45 .csect ._gcry_mpih_addmul_1[PR] 45 .csect ._gcry_mpih_addmul_1[PR]
46 .align 2 46 .align 2
47 .globl _gcry_mpih_addmul_1 47 .globl _gcry_mpih_addmul_1
48 .globl ._gcry_mpih_addmul_1 48 .globl ._gcry_mpih_addmul_1
49 .csect _gcry_mpih_addmul_1[DS] 49 .csect _gcry_mpih_addmul_1[DS]
50_gcry_mpih_addmul_1: 50_gcry_mpih_addmul_1:
51 .long ._gcry_mpih_addmul_1[PR], TOC[tc0], 0 51 .long ._gcry_mpih_addmul_1[PR], TOC[tc0], 0
52 .csect ._gcry_mpih_addmul_1[PR] 52 .csect ._gcry_mpih_addmul_1[PR]
53._gcry_mpih_addmul_1: 53._gcry_mpih_addmul_1:
54 mtctr 5 54 mtctr 5
55 55
56 lwz 0,0(4) 56 lwz 0,0(4)
57 mullw 7,0,6 57 mullw 7,0,6
58 mulhwu 10,0,6 58 mulhwu 10,0,6
59 lwz 9,0(3) 59 lwz 9,0(3)
60 addc 8,7,9 60 addc 8,7,9
61 addi 3,3,-4 61 addi 3,3,-4
62 bdz Lend 62 bdz Lend
63 63
64Loop: lwzu 0,4(4) 64Loop: lwzu 0,4(4)
65 stwu 8,4(3) 65 stwu 8,4(3)
66 mullw 8,0,6 66 mullw 8,0,6
67 adde 7,8,10 67 adde 7,8,10
68 mulhwu 10,0,6 68 mulhwu 10,0,6
69 lwz 9,4(3) 69 lwz 9,4(3)
70 addze 10,10 70 addze 10,10
71 addc 8,7,9 71 addc 8,7,9
72 bdnz Loop 72 bdnz Loop
73 73
74Lend: stw 8,4(3) 74Lend: stw 8,4(3)
75 addze 3,10 75 addze 3,10
76 blr 76 blr
77 77
78#else 78#else
79/* Multiply a limb vector by a single limb, for PowerPC. 79/* Multiply a limb vector by a single limb, for PowerPC.
80 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc. 80 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
81 This file is part of the GNU C Library. 81 This file is part of the GNU C Library.
82 82
83 The GNU C Library is free software; you can redistribute it and/or 83 The GNU C Library is free software; you can redistribute it and/or
84 modify it under the terms of the GNU Library General Public License as 84 modify it under the terms of the GNU Library General Public License as
85 published by the Free Software Foundation; either version 2 of the 85 published by the Free Software Foundation; either version 2 of the
86 License, or (at your option) any later version. 86 License, or (at your option) any later version.
87 87
88 The GNU C Library is distributed in the hope that it will be useful, 88 The GNU C Library is distributed in the hope that it will be useful,
89 but WITHOUT ANY WARRANTY; without even the implied warranty of 89 but WITHOUT ANY WARRANTY; without even the implied warranty of
90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 90 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
91 Library General Public License for more details. 91 Library General Public License for more details.
92 92
93 You should have received a copy of the GNU Library General Public 93 You should have received a copy of the GNU Library General Public
94 License along with the GNU C Library; see the file COPYING.LIB. If not, 94 License along with the GNU C Library; see the file COPYING.LIB. If not,
95 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 95 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
96 Boston, MA 02111-1307, USA. */ 96 Boston, MA 02111-1307, USA. */
97 97
98 98
99/* mp_limb_t mpn_addmul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr, 99/* mp_limb_t mpn_addmul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
100 mp_size_t s1_size, mp_limb_t s2_limb) 100 mp_size_t s1_size, mp_limb_t s2_limb)
101 Calculate res+s1*s2 and put result back in res; return carry. */ 101 Calculate res+s1*s2 and put result back in res; return carry. */
102ENTRY(_gcry_mpih_addmul_1) 102ENTRY(_gcry_mpih_addmul_1)
103 mtctr %r5 103 mtctr %r5
104 104
105 lwz %r0,0(%r4) 105 lwz %r0,0(%r4)
106 mullw %r7,%r0,%r6 106 mullw %r7,%r0,%r6
107 mulhwu %r10,%r0,%r6 107 mulhwu %r10,%r0,%r6
108 lwz %r9,0(%r3) 108 lwz %r9,0(%r3)
109 addc %r8,%r7,%r9 109 addc %r8,%r7,%r9
110 addi %r3,%r3,-4 /* adjust res_ptr */ 110 addi %r3,%r3,-4 /* adjust res_ptr */
111 bdz 1f 111 bdz 1f
112 112
1130: lwzu %r0,4(%r4) 1130: lwzu %r0,4(%r4)
114 stwu %r8,4(%r3) 114 stwu %r8,4(%r3)
115 mullw %r8,%r0,%r6 115 mullw %r8,%r0,%r6
116 adde %r7,%r8,%r10 116 adde %r7,%r8,%r10
117 mulhwu %r10,%r0,%r6 117 mulhwu %r10,%r0,%r6
118 lwz %r9,4(%r3) 118 lwz %r9,4(%r3)
119 addze %r10,%r10 119 addze %r10,%r10
120 addc %r8,%r7,%r9 120 addc %r8,%r7,%r9
121 bdnz 0b 121 bdnz 0b
122 122
1231: stw %r8,4(%r3) 1231: stw %r8,4(%r3)
124 addze %r3,%r10 124 addze %r3,%r10
125 blr 125 blr
126END(_gcry_mpih_addmul_1) 126END(_gcry_mpih_addmul_1)
127#endif 127#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul3.S
index 3db9d7b..c410dbb 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-mul3.S
@@ -1,130 +1,130 @@
1/* PowerPC-32 submul_1 -- Multiply a limb vector with a limb and subtract 1/* PowerPC-32 submul_1 -- Multiply a limb vector with a limb and subtract
2 * the result from a second limb vector. 2 * the result from a second limb vector.
3 * 3 *
4 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc. 4 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26 26
27#ifndef USE_PPC_PATCHES 27#ifndef USE_PPC_PATCHES
28 28
29/******************* 29/*******************
30 * mpi_limb_t 30 * mpi_limb_t
31 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r3) 31 * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r3)
32 * mpi_ptr_t s1_ptr, (r4) 32 * mpi_ptr_t s1_ptr, (r4)
33 * mpi_size_t s1_size, (r5) 33 * mpi_size_t s1_size, (r5)
34 * mpi_limb_t s2_limb) (r6) 34 * mpi_limb_t s2_limb) (r6)
35 * 35 *
36 * This is a fairly straightforward implementation. The timing of the PC601 36 * This is a fairly straightforward implementation. The timing of the PC601
37 * is hard to understand, so I will wait to optimize this until I have some 37 * is hard to understand, so I will wait to optimize this until I have some
38 * hardware to play with. 38 * hardware to play with.
39 * 39 *
40 * The code trivially generalizes to 64 bit limbs for the PC620. 40 * The code trivially generalizes to 64 bit limbs for the PC620.
41 */ 41 */
42 42
43 .toc 43 .toc
44 .csect ._gcry_mpih_submul_1[PR] 44 .csect ._gcry_mpih_submul_1[PR]
45 .align 2 45 .align 2
46 .globl _gcry_mpih_submul_1 46 .globl _gcry_mpih_submul_1
47 .globl ._gcry_mpih_submul_1 47 .globl ._gcry_mpih_submul_1
48 .csect _gcry_mpih_submul_1[DS] 48 .csect _gcry_mpih_submul_1[DS]
49_gcry_mpih_submul_1: 49_gcry_mpih_submul_1:
50 .long ._gcry_mpih_submul_1[PR], TOC[tc0], 0 50 .long ._gcry_mpih_submul_1[PR], TOC[tc0], 0
51 .csect ._gcry_mpih_submul_1[PR] 51 .csect ._gcry_mpih_submul_1[PR]
52._gcry_mpih_submul_1: 52._gcry_mpih_submul_1:
53 mtctr 5 53 mtctr 5
54 54
55 lwz 0,0(4) 55 lwz 0,0(4)
56 mullw 7,0,6 56 mullw 7,0,6
57 mulhwu 10,0,6 57 mulhwu 10,0,6
58 lwz 9,0(3) 58 lwz 9,0(3)
59 subfc 8,7,9 59 subfc 8,7,9
60 addc 7,7,8 # invert cy (r7 is junk) 60 addc 7,7,8 # invert cy (r7 is junk)
61 addi 3,3,-4 61 addi 3,3,-4
62 bdz Lend 62 bdz Lend
63 63
64Loop: lwzu 0,4(4) 64Loop: lwzu 0,4(4)
65 stwu 8,4(3) 65 stwu 8,4(3)
66 mullw 8,0,6 66 mullw 8,0,6
67 adde 7,8,10 67 adde 7,8,10
68 mulhwu 10,0,6 68 mulhwu 10,0,6
69 lwz 9,4(3) 69 lwz 9,4(3)
70 addze 10,10 70 addze 10,10
71 subfc 8,7,9 71 subfc 8,7,9
72 addc 7,7,8 # invert cy (r7 is junk) 72 addc 7,7,8 # invert cy (r7 is junk)
73 bdnz Loop 73 bdnz Loop
74 74
75Lend: stw 8,4(3) 75Lend: stw 8,4(3)
76 addze 3,10 76 addze 3,10
77 blr 77 blr
78 78
79#else 79#else
80/* Multiply a limb vector by a single limb, for PowerPC. 80/* Multiply a limb vector by a single limb, for PowerPC.
81 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc. 81 Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
82 This file is part of the GNU C Library. 82 This file is part of the GNU C Library.
83 83
84 The GNU C Library is free software; you can redistribute it and/or 84 The GNU C Library is free software; you can redistribute it and/or
85 modify it under the terms of the GNU Library General Public License as 85 modify it under the terms of the GNU Library General Public License as
86 published by the Free Software Foundation; either version 2 of the 86 published by the Free Software Foundation; either version 2 of the
87 License, or (at your option) any later version. 87 License, or (at your option) any later version.
88 88
89 The GNU C Library is distributed in the hope that it will be useful, 89 The GNU C Library is distributed in the hope that it will be useful,
90 but WITHOUT ANY WARRANTY; without even the implied warranty of 90 but WITHOUT ANY WARRANTY; without even the implied warranty of
91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
92 Library General Public License for more details. 92 Library General Public License for more details.
93 93
94 You should have received a copy of the GNU Library General Public 94 You should have received a copy of the GNU Library General Public
95 License along with the GNU C Library; see the file COPYING.LIB. If not, 95 License along with the GNU C Library; see the file COPYING.LIB. If not,
96 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 96 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
97 Boston, MA 02111-1307, USA. */ 97 Boston, MA 02111-1307, USA. */
98 98
99/* mp_limb_t mpn_submul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr, 99/* mp_limb_t mpn_submul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
100 mp_size_t s1_size, mp_limb_t s2_limb) 100 mp_size_t s1_size, mp_limb_t s2_limb)
101 Calculate res-s1*s2 and put result back in res; return carry. */ 101 Calculate res-s1*s2 and put result back in res; return carry. */
102 102
103ENTRY(_gcry_mpih_submul_1) 103ENTRY(_gcry_mpih_submul_1)
104 mtctr %r5 104 mtctr %r5
105 105
106 lwz %r0,0(%r4) 106 lwz %r0,0(%r4)
107 mullw %r7,%r0,%r6 107 mullw %r7,%r0,%r6
108 mulhwu %r10,%r0,%r6 108 mulhwu %r10,%r0,%r6
109 lwz %r9,0(%r3) 109 lwz %r9,0(%r3)
110 subf %r8,%r7,%r9 110 subf %r8,%r7,%r9
111 addc %r7,%r7,%r8 # invert cy (r7 is junk) 111 addc %r7,%r7,%r8 # invert cy (r7 is junk)
112 addi %r3,%r3,-4 # adjust res_ptr 112 addi %r3,%r3,-4 # adjust res_ptr
113 bdz 1f 113 bdz 1f
114 114
1150: lwzu %r0,4(%r4) 1150: lwzu %r0,4(%r4)
116 stwu %r8,4(%r3) 116 stwu %r8,4(%r3)
117 mullw %r8,%r0,%r6 117 mullw %r8,%r0,%r6
118 adde %r7,%r8,%r10 118 adde %r7,%r8,%r10
119 mulhwu %r10,%r0,%r6 119 mulhwu %r10,%r0,%r6
120 lwz %r9,4(%r3) 120 lwz %r9,4(%r3)
121 addze %r10,%r10 121 addze %r10,%r10
122 subf %r8,%r7,%r9 122 subf %r8,%r7,%r9
123 addc %r7,%r7,%r8 # invert cy (r7 is junk) 123 addc %r7,%r7,%r8 # invert cy (r7 is junk)
124 bdnz 0b 124 bdnz 0b
125 125
1261: stw %r8,4(%r3) 1261: stw %r8,4(%r3)
127 addze %r3,%r10 127 addze %r3,%r10
128 blr 128 blr
129END(_gcry_mpih_submul_1) 129END(_gcry_mpih_submul_1)
130#endif 130#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-rshift.S
index 090d0b1..98349ed 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-rshift.S
@@ -1,131 +1,131 @@
1/* PowerPC-32 rshift 1/* PowerPC-32 rshift
2 * 2 *
3 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc. 3 * Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc.
4 * 4 *
5 * This file is part of Libgcrypt. 5 * This file is part of Libgcrypt.
6 * 6 *
7 * Libgcrypt is free software; you can redistribute it and/or modify 7 * Libgcrypt is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as 8 * it under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version. 10 * the License, or (at your option) any later version.
11 * 11 *
12 * Libgcrypt is distributed in the hope that it will be useful, 12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details. 15 * GNU Lesser General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this program; if not, write to the Free Software 18 * License along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */ 20 */
21 21
22 22
23#include "sysdep.h" 23#include "sysdep.h"
24#include "asm-syntax.h" 24#include "asm-syntax.h"
25 25
26 26
27#ifndef USE_PPC_PATCHES 27#ifndef USE_PPC_PATCHES
28 28
29/******************* 29/*******************
30 * mpi_limb_t 30 * mpi_limb_t
31 * _gcry_mpih_rshift( mpi_ptr_t wp, (r3) 31 * _gcry_mpih_rshift( mpi_ptr_t wp, (r3)
32 * mpi_ptr_t up, (r4) 32 * mpi_ptr_t up, (r4)
33 * mpi_size_t usize, (r5) 33 * mpi_size_t usize, (r5)
34 * unsigned cnt) (r6) 34 * unsigned cnt) (r6)
35 */ 35 */
36 36
37 .toc 37 .toc
38.csect .text[PR] 38.csect .text[PR]
39 .align 2 39 .align 2
40 .globl _gcry_mpih_rshift 40 .globl _gcry_mpih_rshift
41 .globl ._gcry_mpih_rshift 41 .globl ._gcry_mpih_rshift
42 .csect _gcry_mpih_rshift[DS] 42 .csect _gcry_mpih_rshift[DS]
43_gcry_mpih_rshift: 43_gcry_mpih_rshift:
44 .long ._gcry_mpih_rshift, TOC[tc0], 0 44 .long ._gcry_mpih_rshift, TOC[tc0], 0
45 .csect .text[PR] 45 .csect .text[PR]
46._gcry_mpih_rshift: 46._gcry_mpih_rshift:
47 mtctr 5 # copy size into CTR 47 mtctr 5 # copy size into CTR
48 addi 7,3,-4 # move adjusted res_ptr to free return reg 48 addi 7,3,-4 # move adjusted res_ptr to free return reg
49 subfic 8,6,32 49 subfic 8,6,32
50 lwz 11,0(4) # load first s1 limb 50 lwz 11,0(4) # load first s1 limb
51 slw 3,11,8 # compute function return value 51 slw 3,11,8 # compute function return value
52 bdz Lend1 52 bdz Lend1
53 53
54Loop: lwzu 10,4(4) 54Loop: lwzu 10,4(4)
55 srw 9,11,6 55 srw 9,11,6
56 slw 12,10,8 56 slw 12,10,8
57 or 9,9,12 57 or 9,9,12
58 stwu 9,4(7) 58 stwu 9,4(7)
59 bdz Lend2 59 bdz Lend2
60 lwzu 11,4(4) 60 lwzu 11,4(4)
61 srw 9,10,6 61 srw 9,10,6
62 slw 12,11,8 62 slw 12,11,8
63 or 9,9,12 63 or 9,9,12
64 stwu 9,4(7) 64 stwu 9,4(7)
65 bdnz Loop 65 bdnz Loop
66 66
67Lend1: srw 0,11,6 67Lend1: srw 0,11,6
68 stw 0,4(7) 68 stw 0,4(7)
69 blr 69 blr
70 70
71Lend2: srw 0,10,6 71Lend2: srw 0,10,6
72 stw 0,4(7) 72 stw 0,4(7)
73 blr 73 blr
74 74
75#else 75#else
76/* Shift a limb right, low level routine. 76/* Shift a limb right, low level routine.
77 Copyright (C) 1995, 1997 Free Software Foundation, Inc. 77 Copyright (C) 1995, 1997 Free Software Foundation, Inc.
78 This file is part of the GNU C Library. 78 This file is part of the GNU C Library.
79 79
80 The GNU C Library is free software; you can redistribute it and/or 80 The GNU C Library is free software; you can redistribute it and/or
81 modify it under the terms of the GNU Library General Public License as 81 modify it under the terms of the GNU Library General Public License as
82 published by the Free Software Foundation; either version 2 of the 82 published by the Free Software Foundation; either version 2 of the
83 License, or (at your option) any later version. 83 License, or (at your option) any later version.
84 84
85 The GNU C Library is distributed in the hope that it will be useful, 85 The GNU C Library is distributed in the hope that it will be useful,
86 but WITHOUT ANY WARRANTY; without even the implied warranty of 86 but WITHOUT ANY WARRANTY; without even the implied warranty of
87 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 87 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
88 Library General Public License for more details. 88 Library General Public License for more details.
89 89
90 You should have received a copy of the GNU Library General Public 90 You should have received a copy of the GNU Library General Public
91 License along with the GNU C Library; see the file COPYING.LIB. If not, 91 License along with the GNU C Library; see the file COPYING.LIB. If not,
92 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 92 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
93 Boston, MA 02111-1307, USA. */ 93 Boston, MA 02111-1307, USA. */
94 94
95 95
96/* INPUT PARAMETERS 96/* INPUT PARAMETERS
97 res_ptr r3 97 res_ptr r3
98 s1_ptr r4 98 s1_ptr r4
99 size r5 99 size r5
100 cnt r6 */ 100 cnt r6 */
101 101
102ENTRY(_gcry_mpih_rshift) 102ENTRY(_gcry_mpih_rshift)
103 mtctr 5 # copy size into CTR 103 mtctr 5 # copy size into CTR
104 addi 7,3,-4 # move adjusted res_ptr to free return reg 104 addi 7,3,-4 # move adjusted res_ptr to free return reg
105 subfic 8,6,32 105 subfic 8,6,32
106 lwz 11,0(4) # load first s1 limb 106 lwz 11,0(4) # load first s1 limb
107 slw 3,11,8 # compute function return value 107 slw 3,11,8 # compute function return value
108 bdz 1f 108 bdz 1f
109 109
1100: lwzu 10,4(4) 1100: lwzu 10,4(4)
111 srw 9,11,6 111 srw 9,11,6
112 slw 12,10,8 112 slw 12,10,8
113 or 9,9,12 113 or 9,9,12
114 stwu 9,4(7) 114 stwu 9,4(7)
115 bdz 2f 115 bdz 2f
116 lwzu 11,4(4) 116 lwzu 11,4(4)
117 srw 9,10,6 117 srw 9,10,6
118 slw 12,11,8 118 slw 12,11,8
119 or 9,9,12 119 or 9,9,12
120 stwu 9,4(7) 120 stwu 9,4(7)
121 bdnz 0b 121 bdnz 0b
122 122
1231: srw 0,11,6 1231: srw 0,11,6
124 stw 0,4(7) 124 stw 0,4(7)
125 blr 125 blr
126 126
1272: srw 0,10,6 1272: srw 0,10,6
128 stw 0,4(7) 128 stw 0,4(7)
129 blr 129 blr
130END(_gcry_mpih_rshift) 130END(_gcry_mpih_rshift)
131#endif 131#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S
index 0bee869..d612ea8 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S
@@ -1,133 +1,133 @@
1/* PowerPC-32 sub_n -- Subtract two limb vectors of the same length > 0 1/* PowerPC-32 sub_n -- Subtract two limb vectors of the same length > 0
2 * and store difference in a third limb vector. 2 * and store difference in a third limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1994, 1995, 1998, 4 * Copyright (C) 1992, 1994, 1995, 1998,
5 * 2002 Free Software Foundation, Inc. 5 * 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 23
24#include "sysdep.h" 24#include "sysdep.h"
25#include "asm-syntax.h" 25#include "asm-syntax.h"
26 26
27 27
28#ifndef USE_PPC_PATCHES 28#ifndef USE_PPC_PATCHES
29 29
30/******************* 30/*******************
31 * mpi_limb_t 31 * mpi_limb_t
32 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (r3) 32 * _gcry_mpih_sub_n( mpi_ptr_t res_ptr, (r3)
33 * mpi_ptr_t s1_ptr, (r4) 33 * mpi_ptr_t s1_ptr, (r4)
34 * mpi_ptr_t s2_ptr, (r5) 34 * mpi_ptr_t s2_ptr, (r5)
35 * mpi_size_t size) (r6) 35 * mpi_size_t size) (r6)
36 */ 36 */
37 37
38 .toc 38 .toc
39 .extern _gcry_mpih_sub_n[DS] 39 .extern _gcry_mpih_sub_n[DS]
40 .extern ._gcry_mpih_sub_n 40 .extern ._gcry_mpih_sub_n
41.csect [PR] 41.csect [PR]
42 .align 2 42 .align 2
43 .globl _gcry_mpih_sub_n 43 .globl _gcry_mpih_sub_n
44 .globl ._gcry_mpih_sub_n 44 .globl ._gcry_mpih_sub_n
45 .csect _gcry_mpih_sub_n[DS] 45 .csect _gcry_mpih_sub_n[DS]
46_gcry_mpih_sub_n: 46_gcry_mpih_sub_n:
47 .long ._gcry_mpih_sub_n, TOC[tc0], 0 47 .long ._gcry_mpih_sub_n, TOC[tc0], 0
48 .csect [PR] 48 .csect [PR]
49._gcry_mpih_sub_n: 49._gcry_mpih_sub_n:
50 mtctr 6 # copy size into CTR 50 mtctr 6 # copy size into CTR
51 lwz 8,0(4) # load least significant s1 limb 51 lwz 8,0(4) # load least significant s1 limb
52 lwz 0,0(5) # load least significant s2 limb 52 lwz 0,0(5) # load least significant s2 limb
53 addi 3,3,-4 # offset res_ptr, it is updated before used 53 addi 3,3,-4 # offset res_ptr, it is updated before used
54 subfc 7,0,8 # add least significant limbs, set cy 54 subfc 7,0,8 # add least significant limbs, set cy
55 bdz Lend # If done, skip loop 55 bdz Lend # If done, skip loop
56Loop: lwzu 8,4(4) # load s1 limb and update s1_ptr 56Loop: lwzu 8,4(4) # load s1 limb and update s1_ptr
57 lwzu 0,4(5) # load s2 limb and update s2_ptr 57 lwzu 0,4(5) # load s2 limb and update s2_ptr
58 stwu 7,4(3) # store previous limb in load latency slot 58 stwu 7,4(3) # store previous limb in load latency slot
59 subfe 7,0,8 # add new limbs with cy, set cy 59 subfe 7,0,8 # add new limbs with cy, set cy
60 bdnz Loop # decrement CTR and loop back 60 bdnz Loop # decrement CTR and loop back
61Lend: stw 7,4(3) # store ultimate result limb 61Lend: stw 7,4(3) # store ultimate result limb
62 subfe 3,0,0 # load !cy into ... 62 subfe 3,0,0 # load !cy into ...
63 subfic 3,3,0 # ... return value register 63 subfic 3,3,0 # ... return value register
64 blr 64 blr
65 65
66#else 66#else
67/* Subtract two limb vectors of equal, non-zero length for PowerPC. 67/* Subtract two limb vectors of equal, non-zero length for PowerPC.
68 Copyright (C) 1997 Free Software Foundation, Inc. 68 Copyright (C) 1997 Free Software Foundation, Inc.
69 This file is part of the GNU C Library. 69 This file is part of the GNU C Library.
70 70
71 The GNU C Library is free software; you can redistribute it and/or 71 The GNU C Library is free software; you can redistribute it and/or
72 modify it under the terms of the GNU Library General Public License as 72 modify it under the terms of the GNU Library General Public License as
73 published by the Free Software Foundation; either version 2 of the 73 published by the Free Software Foundation; either version 2 of the
74 License, or (at your option) any later version. 74 License, or (at your option) any later version.
75 75
76 The GNU C Library is distributed in the hope that it will be useful, 76 The GNU C Library is distributed in the hope that it will be useful,
77 but WITHOUT ANY WARRANTY; without even the implied warranty of 77 but WITHOUT ANY WARRANTY; without even the implied warranty of
78 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 78 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
79 Library General Public License for more details. 79 Library General Public License for more details.
80 80
81 You should have received a copy of the GNU Library General Public 81 You should have received a copy of the GNU Library General Public
82 License along with the GNU C Library; see the file COPYING.LIB. If not, 82 License along with the GNU C Library; see the file COPYING.LIB. If not,
83 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 83 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
84 Boston, MA 02111-1307, USA. */ 84 Boston, MA 02111-1307, USA. */
85 85
86/* mp_limb_t mpn_sub_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr, 86/* mp_limb_t mpn_sub_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr,
87 mp_size_t size) 87 mp_size_t size)
88 Calculate s1-s2 and put result in res_ptr; return borrow, 0 or 1. */ 88 Calculate s1-s2 and put result in res_ptr; return borrow, 0 or 1. */
89 89
90/* Note on optimisation: This code is optimal for the 601. Almost every other 90/* Note on optimisation: This code is optimal for the 601. Almost every other
91 possible 2-unrolled inner loop will not be. Also, watch out for the 91 possible 2-unrolled inner loop will not be. Also, watch out for the
92 alignment... */ 92 alignment... */
93 93
94EALIGN(_gcry_mpih_sub_n,3,1) 94EALIGN(_gcry_mpih_sub_n,3,1)
95/* Set up for loop below. */ 95/* Set up for loop below. */
96 mtcrf 0x01,%r6 96 mtcrf 0x01,%r6
97 srwi. %r7,%r6,1 97 srwi. %r7,%r6,1
98 mtctr %r7 98 mtctr %r7
99 bt 31,2f 99 bt 31,2f
100 100
101/* Set the carry (clear the borrow). */ 101/* Set the carry (clear the borrow). */
102 subfc %r0,%r0,%r0 102 subfc %r0,%r0,%r0
103/* Adjust pointers for loop. */ 103/* Adjust pointers for loop. */
104 addi %r3,%r3,-4 104 addi %r3,%r3,-4
105 addi %r4,%r4,-4 105 addi %r4,%r4,-4
106 addi %r5,%r5,-4 106 addi %r5,%r5,-4
107 b 0f 107 b 0f
108 108
1092: lwz %r7,0(%r5) 1092: lwz %r7,0(%r5)
110 lwz %r6,0(%r4) 110 lwz %r6,0(%r4)
111 subfc %r6,%r7,%r6 111 subfc %r6,%r7,%r6
112 stw %r6,0(%r3) 112 stw %r6,0(%r3)
113 beq 1f 113 beq 1f
114 114
115/* Align start of loop to an odd word boundary to guarantee that the 115/* Align start of loop to an odd word boundary to guarantee that the
116 last two words can be fetched in one access (for 601). This turns 116 last two words can be fetched in one access (for 601). This turns
117 out to be important. */ 117 out to be important. */
1180: 1180:
119 lwz %r9,4(%r4) 119 lwz %r9,4(%r4)
120 lwz %r8,4(%r5) 120 lwz %r8,4(%r5)
121 lwzu %r6,8(%r4) 121 lwzu %r6,8(%r4)
122 lwzu %r7,8(%r5) 122 lwzu %r7,8(%r5)
123 subfe %r8,%r8,%r9 123 subfe %r8,%r8,%r9
124 stw %r8,4(%r3) 124 stw %r8,4(%r3)
125 subfe %r6,%r7,%r6 125 subfe %r6,%r7,%r6
126 stwu %r6,8(%r3) 126 stwu %r6,8(%r3)
127 bdnz 0b 127 bdnz 0b
128/* Return the borrow. */ 128/* Return the borrow. */
1291: subfe %r3,%r3,%r3 1291: subfe %r3,%r3,%r3
130 neg %r3,%r3 130 neg %r3,%r3
131 blr 131 blr
132END(_gcry_mpih_sub_n) 132END(_gcry_mpih_sub_n)
133#endif 133#endif
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/syntax.h b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/syntax.h
index 515190f..5d4af9f 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/syntax.h
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/syntax.h
@@ -1,75 +1,75 @@
1/* gmp2-2.0.2-ppc/mpn/powerpc-linux/syntax.h Tue Oct 6 19:27:01 1998 */ 1/* gmp2-2.0.2-ppc/mpn/powerpc-linux/syntax.h Tue Oct 6 19:27:01 1998 */
2/* From glibc's sysdeps/unix/sysv/linux/powerpc/sysdep.h */ 2/* From glibc's sysdeps/unix/sysv/linux/powerpc/sysdep.h */
3 3
4/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc. 4/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
5 This file is part of the GNU C Library. 5 This file is part of the GNU C Library.
6 6
7 The GNU C Library is free software; you can redistribute it and/or 7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as 8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the 9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version. 10 License, or (at your option) any later version.
11 11
12 The GNU C Library is distributed in the hope that it will be useful, 12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public 17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If not, 18 License along with the GNU C Library; see the file COPYING.LIB. If not,
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */ 20 Boston, MA 02111-1307, USA. */
21 21
22 22
23#define USE_PPC_PATCHES 1 23#define USE_PPC_PATCHES 1
24 24
25/* This seems to always be the case on PPC. */ 25/* This seems to always be the case on PPC. */
26#define ALIGNARG(log2) log2 26#define ALIGNARG(log2) log2
27/* For ELF we need the `.type' directive to make shared libs work right. */ 27/* For ELF we need the `.type' directive to make shared libs work right. */
28#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; 28#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
29#define ASM_SIZE_DIRECTIVE(name) .size name,.-name 29#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
30#define ASM_GLOBAL_DIRECTIVE .globl 30#define ASM_GLOBAL_DIRECTIVE .globl
31 31
32#ifdef __STDC__ 32#ifdef __STDC__
33#define C_LABEL(name) C_SYMBOL_NAME(name)##: 33#define C_LABEL(name) C_SYMBOL_NAME(name)##:
34#else 34#else
35#define C_LABEL(name) C_SYMBOL_NAME(name)/**/: 35#define C_LABEL(name) C_SYMBOL_NAME(name)/**/:
36#endif 36#endif
37 37
38#ifdef __STDC__ 38#ifdef __STDC__
39#define L(body) .L##body 39#define L(body) .L##body
40#else 40#else
41#define L(body) .L/**/body 41#define L(body) .L/**/body
42#endif 42#endif
43 43
44/* No profiling of gmp's assembly for now... */ 44/* No profiling of gmp's assembly for now... */
45#define CALL_MCOUNT /* no profiling */ 45#define CALL_MCOUNT /* no profiling */
46 46
47#define ENTRY(name) \ 47#define ENTRY(name) \
48 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ 48 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
49 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ 49 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
50 .align ALIGNARG(2); \ 50 .align ALIGNARG(2); \
51 C_LABEL(name) \ 51 C_LABEL(name) \
52 CALL_MCOUNT 52 CALL_MCOUNT
53 53
54#define EALIGN_W_0 /* No words to insert. */ 54#define EALIGN_W_0 /* No words to insert. */
55#define EALIGN_W_1 nop 55#define EALIGN_W_1 nop
56#define EALIGN_W_2 nop;nop 56#define EALIGN_W_2 nop;nop
57#define EALIGN_W_3 nop;nop;nop 57#define EALIGN_W_3 nop;nop;nop
58#define EALIGN_W_4 EALIGN_W_3;nop 58#define EALIGN_W_4 EALIGN_W_3;nop
59#define EALIGN_W_5 EALIGN_W_4;nop 59#define EALIGN_W_5 EALIGN_W_4;nop
60#define EALIGN_W_6 EALIGN_W_5;nop 60#define EALIGN_W_6 EALIGN_W_5;nop
61#define EALIGN_W_7 EALIGN_W_6;nop 61#define EALIGN_W_7 EALIGN_W_6;nop
62 62
63/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes 63/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
64 past a 2^align boundary. */ 64 past a 2^align boundary. */
65#define EALIGN(name, alignt, words) \ 65#define EALIGN(name, alignt, words) \
66 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ 66 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
67 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \ 67 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
68 .align ALIGNARG(alignt); \ 68 .align ALIGNARG(alignt); \
69 EALIGN_W_##words; \ 69 EALIGN_W_##words; \
70 C_LABEL(name) 70 C_LABEL(name)
71 71
72#undef END 72#undef END
73#define END(name) \ 73#define END(name) \
74 ASM_SIZE_DIRECTIVE(name) 74 ASM_SIZE_DIRECTIVE(name)
75 75
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc64/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc64/distfiles
index e69de29..e69de29 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc64/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc64/distfiles
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/Manifest
index b352a3d..d279229 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/Manifest
@@ -1,24 +1,24 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-lshift.S 20mpih-lshift.S
21mpih-rshift.S 21mpih-rshift.S
22mpih-add1.S 22mpih-add1.S
23udiv.S 23udiv.S
24$names$ iQCVAwUAP+LmaDEAnp832S/7AQISHgP/Z5orU+CPKBeRFCogSQDm4p7J2VpDovU6mtfMTdjhqWuZG0U6y8WqH0aj3USfziOhtc8YjQHQ+97g3+EnIWZgLjKacWC6pScY/QbATEpF1D0Wrcea5rk3qR1t7isdBVVOrxedZ5vuj5Op2zx/0OlPI+wt6fTtW88BdG/a6w/ZU/8==Py6h 24$names$ iQCVAwUAP+LmaDEAnp832S/7AQISHgP/Z5orU+CPKBeRFCogSQDm4p7J2VpDovU6mtfMTdjhqWuZG0U6y8WqH0aj3USfziOhtc8YjQHQ+97g3+EnIWZgLjKacWC6pScY/QbATEpF1D0Wrcea5rk3qR1t7isdBVVOrxedZ5vuj5Op2zx/0OlPI+wt6fTtW88BdG/a6w/ZU/8==Py6h
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/distfiles
index 5aa83eb..a20f18e 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/distfiles
@@ -1,6 +1,6 @@
1Manifest 1Manifest
2mpih-lshift.S 2mpih-lshift.S
3mpih-rshift.S 3mpih-rshift.S
4mpih-add1.S 4mpih-add1.S
5udiv.S 5udiv.S
6 6
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-add1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-add1.S
index dbf20c5..61a80ca 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-add1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-add1.S
@@ -1,239 +1,239 @@
1/* SPARC _add_n -- Add two limb vectors of the same length > 0 and store 1/* SPARC _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) 1995, 1996, 1998, 4 * Copyright (C) 1995, 1996, 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 23
24 24
25 25
26/******************* 26/*******************
27 * mpi_limb_t 27 * mpi_limb_t
28 * _gcry_mpih_add_n( mpi_ptr_t res_ptr, 28 * _gcry_mpih_add_n( mpi_ptr_t res_ptr,
29 * mpi_ptr_t s1_ptr, 29 * mpi_ptr_t s1_ptr,
30 * mpi_ptr_t s2_ptr, 30 * mpi_ptr_t s2_ptr,
31 * mpi_size_t size) 31 * mpi_size_t size)
32 */ 32 */
33 33
34! INPUT PARAMETERS 34! INPUT PARAMETERS
35#define res_ptr %o0 35#define res_ptr %o0
36#define s1_ptr %o1 36#define s1_ptr %o1
37#define s2_ptr %o2 37#define s2_ptr %o2
38#define size %o3 38#define size %o3
39 39
40#include "sysdep.h" 40#include "sysdep.h"
41 41
42 .text 42 .text
43 .align 4 43 .align 4
44 .global C_SYMBOL_NAME(_gcry_mpih_add_n) 44 .global C_SYMBOL_NAME(_gcry_mpih_add_n)
45C_SYMBOL_NAME(_gcry_mpih_add_n): 45C_SYMBOL_NAME(_gcry_mpih_add_n):
46 xor s2_ptr,res_ptr,%g1 46 xor s2_ptr,res_ptr,%g1
47 andcc %g1,4,%g0 47 andcc %g1,4,%g0
48 bne L1 ! branch if alignment differs 48 bne L1 ! branch if alignment differs
49 nop 49 nop
50! ** V1a ** 50! ** V1a **
51L0: andcc res_ptr,4,%g0 ! res_ptr unaligned? Side effect: cy=0 51L0: andcc res_ptr,4,%g0 ! res_ptr unaligned? Side effect: cy=0
52 be L_v1 ! if no, branch 52 be L_v1 ! if no, branch
53 nop 53 nop
54/* Add least significant limb separately to align res_ptr and s2_ptr */ 54/* Add least significant limb separately to align res_ptr and s2_ptr */
55 ld [s1_ptr],%g4 55 ld [s1_ptr],%g4
56 add s1_ptr,4,s1_ptr 56 add s1_ptr,4,s1_ptr
57 ld [s2_ptr],%g2 57 ld [s2_ptr],%g2
58 add s2_ptr,4,s2_ptr 58 add s2_ptr,4,s2_ptr
59 add size,-1,size 59 add size,-1,size
60 addcc %g4,%g2,%o4 60 addcc %g4,%g2,%o4
61 st %o4,[res_ptr] 61 st %o4,[res_ptr]
62 add res_ptr,4,res_ptr 62 add res_ptr,4,res_ptr
63L_v1: addx %g0,%g0,%o4 ! save cy in register 63L_v1: addx %g0,%g0,%o4 ! save cy in register
64 cmp size,2 ! if size < 2 ... 64 cmp size,2 ! if size < 2 ...
65 bl Lend2 ! ... branch to tail code 65 bl Lend2 ! ... branch to tail code
66 subcc %g0,%o4,%g0 ! restore cy 66 subcc %g0,%o4,%g0 ! restore cy
67 67
68 ld [s1_ptr+0],%g4 68 ld [s1_ptr+0],%g4
69 addcc size,-10,size 69 addcc size,-10,size
70 ld [s1_ptr+4],%g1 70 ld [s1_ptr+4],%g1
71 ldd [s2_ptr+0],%g2 71 ldd [s2_ptr+0],%g2
72 blt Lfin1 72 blt Lfin1
73 subcc %g0,%o4,%g0 ! restore cy 73 subcc %g0,%o4,%g0 ! restore cy
74/* Add blocks of 8 limbs until less than 8 limbs remain */ 74/* Add blocks of 8 limbs until less than 8 limbs remain */
75Loop1: addxcc %g4,%g2,%o4 75Loop1: addxcc %g4,%g2,%o4
76 ld [s1_ptr+8],%g4 76 ld [s1_ptr+8],%g4
77 addxcc %g1,%g3,%o5 77 addxcc %g1,%g3,%o5
78 ld [s1_ptr+12],%g1 78 ld [s1_ptr+12],%g1
79 ldd [s2_ptr+8],%g2 79 ldd [s2_ptr+8],%g2
80 std %o4,[res_ptr+0] 80 std %o4,[res_ptr+0]
81 addxcc %g4,%g2,%o4 81 addxcc %g4,%g2,%o4
82 ld [s1_ptr+16],%g4 82 ld [s1_ptr+16],%g4
83 addxcc %g1,%g3,%o5 83 addxcc %g1,%g3,%o5
84 ld [s1_ptr+20],%g1 84 ld [s1_ptr+20],%g1
85 ldd [s2_ptr+16],%g2 85 ldd [s2_ptr+16],%g2
86 std %o4,[res_ptr+8] 86 std %o4,[res_ptr+8]
87 addxcc %g4,%g2,%o4 87 addxcc %g4,%g2,%o4
88 ld [s1_ptr+24],%g4 88 ld [s1_ptr+24],%g4
89 addxcc %g1,%g3,%o5 89 addxcc %g1,%g3,%o5
90 ld [s1_ptr+28],%g1 90 ld [s1_ptr+28],%g1
91 ldd [s2_ptr+24],%g2 91 ldd [s2_ptr+24],%g2
92 std %o4,[res_ptr+16] 92 std %o4,[res_ptr+16]
93 addxcc %g4,%g2,%o4 93 addxcc %g4,%g2,%o4
94 ld [s1_ptr+32],%g4 94 ld [s1_ptr+32],%g4
95 addxcc %g1,%g3,%o5 95 addxcc %g1,%g3,%o5
96 ld [s1_ptr+36],%g1 96 ld [s1_ptr+36],%g1
97 ldd [s2_ptr+32],%g2 97 ldd [s2_ptr+32],%g2
98 std %o4,[res_ptr+24] 98 std %o4,[res_ptr+24]
99 addx %g0,%g0,%o4 ! save cy in register 99 addx %g0,%g0,%o4 ! save cy in register
100 addcc size,-8,size 100 addcc size,-8,size
101 add s1_ptr,32,s1_ptr 101 add s1_ptr,32,s1_ptr
102 add s2_ptr,32,s2_ptr 102 add s2_ptr,32,s2_ptr
103 add res_ptr,32,res_ptr 103 add res_ptr,32,res_ptr
104 bge Loop1 104 bge Loop1
105 subcc %g0,%o4,%g0 ! restore cy 105 subcc %g0,%o4,%g0 ! restore cy
106 106
107Lfin1: addcc size,8-2,size 107Lfin1: addcc size,8-2,size
108 blt Lend1 108 blt Lend1
109 subcc %g0,%o4,%g0 ! restore cy 109 subcc %g0,%o4,%g0 ! restore cy
110/* Add blocks of 2 limbs until less than 2 limbs remain */ 110/* Add blocks of 2 limbs until less than 2 limbs remain */
111Loope1: addxcc %g4,%g2,%o4 111Loope1: addxcc %g4,%g2,%o4
112 ld [s1_ptr+8],%g4 112 ld [s1_ptr+8],%g4
113 addxcc %g1,%g3,%o5 113 addxcc %g1,%g3,%o5
114 ld [s1_ptr+12],%g1 114 ld [s1_ptr+12],%g1
115 ldd [s2_ptr+8],%g2 115 ldd [s2_ptr+8],%g2
116 std %o4,[res_ptr+0] 116 std %o4,[res_ptr+0]
117 addx %g0,%g0,%o4 ! save cy in register 117 addx %g0,%g0,%o4 ! save cy in register
118 addcc size,-2,size 118 addcc size,-2,size
119 add s1_ptr,8,s1_ptr 119 add s1_ptr,8,s1_ptr
120 add s2_ptr,8,s2_ptr 120 add s2_ptr,8,s2_ptr
121 add res_ptr,8,res_ptr 121 add res_ptr,8,res_ptr
122 bge Loope1 122 bge Loope1
123 subcc %g0,%o4,%g0 ! restore cy 123 subcc %g0,%o4,%g0 ! restore cy
124Lend1: addxcc %g4,%g2,%o4 124Lend1: addxcc %g4,%g2,%o4
125 addxcc %g1,%g3,%o5 125 addxcc %g1,%g3,%o5
126 std %o4,[res_ptr+0] 126 std %o4,[res_ptr+0]
127 addx %g0,%g0,%o4 ! save cy in register 127 addx %g0,%g0,%o4 ! save cy in register
128 128
129 andcc size,1,%g0 129 andcc size,1,%g0
130 be Lret1 130 be Lret1
131 subcc %g0,%o4,%g0 ! restore cy 131 subcc %g0,%o4,%g0 ! restore cy
132/* Add last limb */ 132/* Add last limb */
133 ld [s1_ptr+8],%g4 133 ld [s1_ptr+8],%g4
134 ld [s2_ptr+8],%g2 134 ld [s2_ptr+8],%g2
135 addxcc %g4,%g2,%o4 135 addxcc %g4,%g2,%o4
136 st %o4,[res_ptr+8] 136 st %o4,[res_ptr+8]
137 137
138Lret1: retl 138Lret1: retl
139 addx %g0,%g0,%o0 ! return carry-out from most sign. limb 139 addx %g0,%g0,%o0 ! return carry-out from most sign. limb
140 140
141L1: xor s1_ptr,res_ptr,%g1 141L1: xor s1_ptr,res_ptr,%g1
142 andcc %g1,4,%g0 142 andcc %g1,4,%g0
143 bne L2 143 bne L2
144 nop 144 nop
145! ** V1b ** 145! ** V1b **
146 mov s2_ptr,%g1 146 mov s2_ptr,%g1
147 mov s1_ptr,s2_ptr 147 mov s1_ptr,s2_ptr
148 b L0 148 b L0
149 mov %g1,s1_ptr 149 mov %g1,s1_ptr
150 150
151! ** V2 ** 151! ** V2 **
152/* If we come here, the alignment of s1_ptr and res_ptr as well as the 152/* If we come here, the alignment of s1_ptr and res_ptr as well as the
153 alignment of s2_ptr and res_ptr differ. Since there are only two ways 153 alignment of s2_ptr and res_ptr differ. Since there are only two ways
154 things can be aligned (that we care about) we now know that the alignment 154 things can be aligned (that we care about) we now know that the alignment
155 of s1_ptr and s2_ptr are the same. */ 155 of s1_ptr and s2_ptr are the same. */
156 156
157L2: cmp size,1 157L2: cmp size,1
158 be Ljone 158 be Ljone
159 nop 159 nop
160 andcc s1_ptr,4,%g0 ! s1_ptr unaligned? Side effect: cy=0 160 andcc s1_ptr,4,%g0 ! s1_ptr unaligned? Side effect: cy=0
161 be L_v2 ! if no, branch 161 be L_v2 ! if no, branch
162 nop 162 nop
163/* Add least significant limb separately to align s1_ptr and s2_ptr */ 163/* Add least significant limb separately to align s1_ptr and s2_ptr */
164 ld [s1_ptr],%g4 164 ld [s1_ptr],%g4
165 add s1_ptr,4,s1_ptr 165 add s1_ptr,4,s1_ptr
166 ld [s2_ptr],%g2 166 ld [s2_ptr],%g2
167 add s2_ptr,4,s2_ptr 167 add s2_ptr,4,s2_ptr
168 add size,-1,size 168 add size,-1,size
169 addcc %g4,%g2,%o4 169 addcc %g4,%g2,%o4
170 st %o4,[res_ptr] 170 st %o4,[res_ptr]
171 add res_ptr,4,res_ptr 171 add res_ptr,4,res_ptr
172 172
173L_v2: addx %g0,%g0,%o4 ! save cy in register 173L_v2: addx %g0,%g0,%o4 ! save cy in register
174 addcc size,-8,size 174 addcc size,-8,size
175 blt Lfin2 175 blt Lfin2
176 subcc %g0,%o4,%g0 ! restore cy 176 subcc %g0,%o4,%g0 ! restore cy
177/* Add blocks of 8 limbs until less than 8 limbs remain */ 177/* Add blocks of 8 limbs until less than 8 limbs remain */
178Loop2: ldd [s1_ptr+0],%g2 178Loop2: ldd [s1_ptr+0],%g2
179 ldd [s2_ptr+0],%o4 179 ldd [s2_ptr+0],%o4
180 addxcc %g2,%o4,%g2 180 addxcc %g2,%o4,%g2
181 st %g2,[res_ptr+0] 181 st %g2,[res_ptr+0]
182 addxcc %g3,%o5,%g3 182 addxcc %g3,%o5,%g3
183 st %g3,[res_ptr+4] 183 st %g3,[res_ptr+4]
184 ldd [s1_ptr+8],%g2 184 ldd [s1_ptr+8],%g2
185 ldd [s2_ptr+8],%o4 185 ldd [s2_ptr+8],%o4
186 addxcc %g2,%o4,%g2 186 addxcc %g2,%o4,%g2
187 st %g2,[res_ptr+8] 187 st %g2,[res_ptr+8]
188 addxcc %g3,%o5,%g3 188 addxcc %g3,%o5,%g3
189 st %g3,[res_ptr+12] 189 st %g3,[res_ptr+12]
190 ldd [s1_ptr+16],%g2 190 ldd [s1_ptr+16],%g2
191 ldd [s2_ptr+16],%o4 191 ldd [s2_ptr+16],%o4
192 addxcc %g2,%o4,%g2 192 addxcc %g2,%o4,%g2
193 st %g2,[res_ptr+16] 193 st %g2,[res_ptr+16]
194 addxcc %g3,%o5,%g3 194 addxcc %g3,%o5,%g3
195 st %g3,[res_ptr+20] 195 st %g3,[res_ptr+20]
196 ldd [s1_ptr+24],%g2 196 ldd [s1_ptr+24],%g2
197 ldd [s2_ptr+24],%o4 197 ldd [s2_ptr+24],%o4
198 addxcc %g2,%o4,%g2 198 addxcc %g2,%o4,%g2
199 st %g2,[res_ptr+24] 199 st %g2,[res_ptr+24]
200 addxcc %g3,%o5,%g3 200 addxcc %g3,%o5,%g3
201 st %g3,[res_ptr+28] 201 st %g3,[res_ptr+28]
202 addx %g0,%g0,%o4 ! save cy in register 202 addx %g0,%g0,%o4 ! save cy in register
203 addcc size,-8,size 203 addcc size,-8,size
204 add s1_ptr,32,s1_ptr 204 add s1_ptr,32,s1_ptr
205 add s2_ptr,32,s2_ptr 205 add s2_ptr,32,s2_ptr
206 add res_ptr,32,res_ptr 206 add res_ptr,32,res_ptr
207 bge Loop2 207 bge Loop2
208 subcc %g0,%o4,%g0 ! restore cy 208 subcc %g0,%o4,%g0 ! restore cy
209 209
210Lfin2: addcc size,8-2,size 210Lfin2: addcc size,8-2,size
211 blt Lend2 211 blt Lend2
212 subcc %g0,%o4,%g0 ! restore cy 212 subcc %g0,%o4,%g0 ! restore cy
213Loope2: ldd [s1_ptr+0],%g2 213Loope2: ldd [s1_ptr+0],%g2
214 ldd [s2_ptr+0],%o4 214 ldd [s2_ptr+0],%o4
215 addxcc %g2,%o4,%g2 215 addxcc %g2,%o4,%g2
216 st %g2,[res_ptr+0] 216 st %g2,[res_ptr+0]
217 addxcc %g3,%o5,%g3 217 addxcc %g3,%o5,%g3
218 st %g3,[res_ptr+4] 218 st %g3,[res_ptr+4]
219 addx %g0,%g0,%o4 ! save cy in register 219 addx %g0,%g0,%o4 ! save cy in register
220 addcc size,-2,size 220 addcc size,-2,size
221 add s1_ptr,8,s1_ptr 221 add s1_ptr,8,s1_ptr
222 add s2_ptr,8,s2_ptr 222 add s2_ptr,8,s2_ptr
223 add res_ptr,8,res_ptr 223 add res_ptr,8,res_ptr
224 bge Loope2 224 bge Loope2
225 subcc %g0,%o4,%g0 ! restore cy 225 subcc %g0,%o4,%g0 ! restore cy
226Lend2: andcc size,1,%g0 226Lend2: andcc size,1,%g0
227 be Lret2 227 be Lret2
228 subcc %g0,%o4,%g0 ! restore cy 228 subcc %g0,%o4,%g0 ! restore cy
229/* Add last limb */ 229/* Add last limb */
230Ljone: ld [s1_ptr],%g4 230Ljone: ld [s1_ptr],%g4
231 ld [s2_ptr],%g2 231 ld [s2_ptr],%g2
232 addxcc %g4,%g2,%o4 232 addxcc %g4,%g2,%o4
233 st %o4,[res_ptr] 233 st %o4,[res_ptr]
234 234
235Lret2: retl 235Lret2: retl
236 addx %g0,%g0,%o0 ! return carry-out from most sign. limb 236 addx %g0,%g0,%o0 ! return carry-out from most sign. limb
237 237
238 238
239 239
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-lshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-lshift.S
index 15460ca..3422ab0 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-lshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-lshift.S
@@ -1,97 +1,97 @@
1/* sparc lshift 1/* sparc lshift
2 * 2 *
3 * Copyright (C) 1995, 1996, 1998, 3 * Copyright (C) 1995, 1996, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23 23
24! INPUT PARAMETERS 24! INPUT PARAMETERS
25! res_ptr %o0 25! res_ptr %o0
26! src_ptr %o1 26! src_ptr %o1
27! size %o2 27! size %o2
28! cnt %o3 28! cnt %o3
29 29
30#include "sysdep.h" 30#include "sysdep.h"
31 31
32 .text 32 .text
33 .align 4 33 .align 4
34 .global C_SYMBOL_NAME(_gcry_mpih_lshift) 34 .global C_SYMBOL_NAME(_gcry_mpih_lshift)
35C_SYMBOL_NAME(_gcry_mpih_lshift): 35C_SYMBOL_NAME(_gcry_mpih_lshift):
36 sll %o2,2,%g1 36 sll %o2,2,%g1
37 add %o1,%g1,%o1 ! make %o1 point at end of src 37 add %o1,%g1,%o1 ! make %o1 point at end of src
38 ld [%o1-4],%g2 ! load first limb 38 ld [%o1-4],%g2 ! load first limb
39 sub %g0,%o3,%o5 ! negate shift count 39 sub %g0,%o3,%o5 ! negate shift count
40 add %o0,%g1,%o0 ! make %o0 point at end of res 40 add %o0,%g1,%o0 ! make %o0 point at end of res
41 add %o2,-1,%o2 41 add %o2,-1,%o2
42 andcc %o2,4-1,%g4 ! number of limbs in first loop 42 andcc %o2,4-1,%g4 ! number of limbs in first loop
43 srl %g2,%o5,%g1 ! compute function result 43 srl %g2,%o5,%g1 ! compute function result
44 be L0 ! if multiple of 4 limbs, skip first loop 44 be L0 ! if multiple of 4 limbs, skip first loop
45 st %g1,[%sp+80] 45 st %g1,[%sp+80]
46 46
47 sub %o2,%g4,%o2 ! adjust count for main loop 47 sub %o2,%g4,%o2 ! adjust count for main loop
48 48
49Loop0: ld [%o1-8],%g3 49Loop0: ld [%o1-8],%g3
50 add %o0,-4,%o0 50 add %o0,-4,%o0
51 add %o1,-4,%o1 51 add %o1,-4,%o1
52 addcc %g4,-1,%g4 52 addcc %g4,-1,%g4
53 sll %g2,%o3,%o4 53 sll %g2,%o3,%o4
54 srl %g3,%o5,%g1 54 srl %g3,%o5,%g1
55 mov %g3,%g2 55 mov %g3,%g2
56 or %o4,%g1,%o4 56 or %o4,%g1,%o4
57 bne Loop0 57 bne Loop0
58 st %o4,[%o0+0] 58 st %o4,[%o0+0]
59 59
60L0: tst %o2 60L0: tst %o2
61 be Lend 61 be Lend
62 nop 62 nop
63 63
64Loop: ld [%o1-8],%g3 64Loop: ld [%o1-8],%g3
65 add %o0,-16,%o0 65 add %o0,-16,%o0
66 addcc %o2,-4,%o2 66 addcc %o2,-4,%o2
67 sll %g2,%o3,%o4 67 sll %g2,%o3,%o4
68 srl %g3,%o5,%g1 68 srl %g3,%o5,%g1
69 69
70 ld [%o1-12],%g2 70 ld [%o1-12],%g2
71 sll %g3,%o3,%g4 71 sll %g3,%o3,%g4
72 or %o4,%g1,%o4 72 or %o4,%g1,%o4
73 st %o4,[%o0+12] 73 st %o4,[%o0+12]
74 srl %g2,%o5,%g1 74 srl %g2,%o5,%g1
75 75
76 ld [%o1-16],%g3 76 ld [%o1-16],%g3
77 sll %g2,%o3,%o4 77 sll %g2,%o3,%o4
78 or %g4,%g1,%g4 78 or %g4,%g1,%g4
79 st %g4,[%o0+8] 79 st %g4,[%o0+8]
80 srl %g3,%o5,%g1 80 srl %g3,%o5,%g1
81 81
82 ld [%o1-20],%g2 82 ld [%o1-20],%g2
83 sll %g3,%o3,%g4 83 sll %g3,%o3,%g4
84 or %o4,%g1,%o4 84 or %o4,%g1,%o4
85 st %o4,[%o0+4] 85 st %o4,[%o0+4]
86 srl %g2,%o5,%g1 86 srl %g2,%o5,%g1
87 87
88 add %o1,-16,%o1 88 add %o1,-16,%o1
89 or %g4,%g1,%g4 89 or %g4,%g1,%g4
90 bne Loop 90 bne Loop
91 st %g4,[%o0+0] 91 st %g4,[%o0+0]
92 92
93Lend: sll %g2,%o3,%g2 93Lend: sll %g2,%o3,%g2
94 st %g2,[%o0-4] 94 st %g2,[%o0-4]
95 retl 95 retl
96 ld [%sp+80],%o0 96 ld [%sp+80],%o0
97 97
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-rshift.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-rshift.S
index 12237a8..cd3db41 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-rshift.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/mpih-rshift.S
@@ -1,93 +1,93 @@
1/* sparc rshift 1/* sparc rshift
2 * 2 *
3 * Copyright (C) 1995, 1996, 1998, 3 * Copyright (C) 1995, 1996, 1998,
4 * 2001, 2002 Free Software Foundation, Inc. 4 * 2001, 2002 Free Software Foundation, Inc.
5 * 5 *
6 * This file is part of Libgcrypt. 6 * This file is part of Libgcrypt.
7 * 7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify 8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as 9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of 10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version. 11 * the License, or (at your option) any later version.
12 * 12 *
13 * Libgcrypt is distributed in the hope that it will be useful, 13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details. 16 * GNU Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software 19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */ 21 */
22 22
23! INPUT PARAMETERS 23! INPUT PARAMETERS
24! res_ptr %o0 24! res_ptr %o0
25! src_ptr %o1 25! src_ptr %o1
26! size %o2 26! size %o2
27! cnt %o3 27! cnt %o3
28 28
29#include "sysdep.h" 29#include "sysdep.h"
30 30
31 .text 31 .text
32 .align 4 32 .align 4
33 .global C_SYMBOL_NAME(_gcry_mpih_rshift) 33 .global C_SYMBOL_NAME(_gcry_mpih_rshift)
34C_SYMBOL_NAME(_gcry_mpih_rshift): 34C_SYMBOL_NAME(_gcry_mpih_rshift):
35 ld [%o1],%g2 ! load first limb 35 ld [%o1],%g2 ! load first limb
36 sub %g0,%o3,%o5 ! negate shift count 36 sub %g0,%o3,%o5 ! negate shift count
37 add %o2,-1,%o2 37 add %o2,-1,%o2
38 andcc %o2,4-1,%g4 ! number of limbs in first loop 38 andcc %o2,4-1,%g4 ! number of limbs in first loop
39 sll %g2,%o5,%g1 ! compute function result 39 sll %g2,%o5,%g1 ! compute function result
40 be L0 ! if multiple of 4 limbs, skip first loop 40 be L0 ! if multiple of 4 limbs, skip first loop
41 st %g1,[%sp+80] 41 st %g1,[%sp+80]
42 42
43 sub %o2,%g4,%o2 ! adjust count for main loop 43 sub %o2,%g4,%o2 ! adjust count for main loop
44 44
45Loop0: ld [%o1+4],%g3 45Loop0: ld [%o1+4],%g3
46 add %o0,4,%o0 46 add %o0,4,%o0
47 add %o1,4,%o1 47 add %o1,4,%o1
48 addcc %g4,-1,%g4 48 addcc %g4,-1,%g4
49 srl %g2,%o3,%o4 49 srl %g2,%o3,%o4
50 sll %g3,%o5,%g1 50 sll %g3,%o5,%g1
51 mov %g3,%g2 51 mov %g3,%g2
52 or %o4,%g1,%o4 52 or %o4,%g1,%o4
53 bne Loop0 53 bne Loop0
54 st %o4,[%o0-4] 54 st %o4,[%o0-4]
55 55
56L0: tst %o2 56L0: tst %o2
57 be Lend 57 be Lend
58 nop 58 nop
59 59
60Loop: ld [%o1+4],%g3 60Loop: ld [%o1+4],%g3
61 add %o0,16,%o0 61 add %o0,16,%o0
62 addcc %o2,-4,%o2 62 addcc %o2,-4,%o2
63 srl %g2,%o3,%o4 63 srl %g2,%o3,%o4
64 sll %g3,%o5,%g1 64 sll %g3,%o5,%g1
65 65
66 ld [%o1+8],%g2 66 ld [%o1+8],%g2
67 srl %g3,%o3,%g4 67 srl %g3,%o3,%g4
68 or %o4,%g1,%o4 68 or %o4,%g1,%o4
69 st %o4,[%o0-16] 69 st %o4,[%o0-16]
70 sll %g2,%o5,%g1 70 sll %g2,%o5,%g1
71 71
72 ld [%o1+12],%g3 72 ld [%o1+12],%g3
73 srl %g2,%o3,%o4 73 srl %g2,%o3,%o4
74 or %g4,%g1,%g4 74 or %g4,%g1,%g4
75 st %g4,[%o0-12] 75 st %g4,[%o0-12]
76 sll %g3,%o5,%g1 76 sll %g3,%o5,%g1
77 77
78 ld [%o1+16],%g2 78 ld [%o1+16],%g2
79 srl %g3,%o3,%g4 79 srl %g3,%o3,%g4
80 or %o4,%g1,%o4 80 or %o4,%g1,%o4
81 st %o4,[%o0-8] 81 st %o4,[%o0-8]
82 sll %g2,%o5,%g1 82 sll %g2,%o5,%g1
83 83
84 add %o1,16,%o1 84 add %o1,16,%o1
85 or %g4,%g1,%g4 85 or %g4,%g1,%g4
86 bne Loop 86 bne Loop
87 st %g4,[%o0-4] 87 st %g4,[%o0-4]
88 88
89Lend: srl %g2,%o3,%g2 89Lend: srl %g2,%o3,%g2
90 st %g2,[%o0-0] 90 st %g2,[%o0-0]
91 retl 91 retl
92 ld [%sp+80],%o0 92 ld [%sp+80],%o0
93 93
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S
index c4cd053..006b5c1 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S
@@ -1,195 +1,195 @@
1/* SPARC v7 __udiv_qrnnd division support, used from longlong.h. 1/* SPARC v7 __udiv_qrnnd division support, used from longlong.h.
2 * This is for v7 CPUs without a floating-point unit. 2 * This is for v7 CPUs without a floating-point unit.
3 * 3 *
4 * Copyright (C) 1993, 1994, 1996, 1998, 4 * Copyright (C) 1993, 1994, 1996, 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! INPUT PARAMETERS 31! INPUT PARAMETERS
32! rem_ptr o0 32! rem_ptr o0
33! n1 o1 33! n1 o1
34! n0 o2 34! n0 o2
35! d o3 35! d o3
36 36
37#include "sysdep.h" 37#include "sysdep.h"
38 38
39 .text 39 .text
40 .align 4 40 .align 4
41 .global C_SYMBOL_NAME(__udiv_qrnnd) 41 .global C_SYMBOL_NAME(__udiv_qrnnd)
42C_SYMBOL_NAME(__udiv_qrnnd): 42C_SYMBOL_NAME(__udiv_qrnnd):
43 tst %o3 43 tst %o3
44 bneg Largedivisor 44 bneg Largedivisor
45 mov 8,%g1 45 mov 8,%g1
46 46
47 b Lp1 47 b Lp1
48 addxcc %o2,%o2,%o2 48 addxcc %o2,%o2,%o2
49 49
50Lplop: bcc Ln1 50Lplop: bcc Ln1
51 addxcc %o2,%o2,%o2 51 addxcc %o2,%o2,%o2
52Lp1: addx %o1,%o1,%o1 52Lp1: addx %o1,%o1,%o1
53 subcc %o1,%o3,%o4 53 subcc %o1,%o3,%o4
54 bcc Ln2 54 bcc Ln2
55 addxcc %o2,%o2,%o2 55 addxcc %o2,%o2,%o2
56Lp2: addx %o1,%o1,%o1 56Lp2: addx %o1,%o1,%o1
57 subcc %o1,%o3,%o4 57 subcc %o1,%o3,%o4
58 bcc Ln3 58 bcc Ln3
59 addxcc %o2,%o2,%o2 59 addxcc %o2,%o2,%o2
60Lp3: addx %o1,%o1,%o1 60Lp3: addx %o1,%o1,%o1
61 subcc %o1,%o3,%o4 61 subcc %o1,%o3,%o4
62 bcc Ln4 62 bcc Ln4
63 addxcc %o2,%o2,%o2 63 addxcc %o2,%o2,%o2
64Lp4: addx %o1,%o1,%o1 64Lp4: addx %o1,%o1,%o1
65 addcc %g1,-1,%g1 65 addcc %g1,-1,%g1
66 bne Lplop 66 bne Lplop
67 subcc %o1,%o3,%o4 67 subcc %o1,%o3,%o4
68 bcc Ln5 68 bcc Ln5
69 addxcc %o2,%o2,%o2 69 addxcc %o2,%o2,%o2
70Lp5: st %o1,[%o0] 70Lp5: st %o1,[%o0]
71 retl 71 retl
72 xnor %g0,%o2,%o0 72 xnor %g0,%o2,%o0
73 73
74Lnlop: bcc Lp1 74Lnlop: bcc Lp1
75 addxcc %o2,%o2,%o2 75 addxcc %o2,%o2,%o2
76Ln1: addx %o4,%o4,%o4 76Ln1: addx %o4,%o4,%o4
77 subcc %o4,%o3,%o1 77 subcc %o4,%o3,%o1
78 bcc Lp2 78 bcc Lp2
79 addxcc %o2,%o2,%o2 79 addxcc %o2,%o2,%o2
80Ln2: addx %o4,%o4,%o4 80Ln2: addx %o4,%o4,%o4
81 subcc %o4,%o3,%o1 81 subcc %o4,%o3,%o1
82 bcc Lp3 82 bcc Lp3
83 addxcc %o2,%o2,%o2 83 addxcc %o2,%o2,%o2
84Ln3: addx %o4,%o4,%o4 84Ln3: addx %o4,%o4,%o4
85 subcc %o4,%o3,%o1 85 subcc %o4,%o3,%o1
86 bcc Lp4 86 bcc Lp4
87 addxcc %o2,%o2,%o2 87 addxcc %o2,%o2,%o2
88Ln4: addx %o4,%o4,%o4 88Ln4: addx %o4,%o4,%o4
89 addcc %g1,-1,%g1 89 addcc %g1,-1,%g1
90 bne Lnlop 90 bne Lnlop
91 subcc %o4,%o3,%o1 91 subcc %o4,%o3,%o1
92 bcc Lp5 92 bcc Lp5
93 addxcc %o2,%o2,%o2 93 addxcc %o2,%o2,%o2
94Ln5: st %o4,[%o0] 94Ln5: st %o4,[%o0]
95 retl 95 retl
96 xnor %g0,%o2,%o0 96 xnor %g0,%o2,%o0
97 97
98Largedivisor: 98Largedivisor:
99 and %o2,1,%o5 ! %o5 = n0 & 1 99 and %o2,1,%o5 ! %o5 = n0 & 1
100 100
101 srl %o2,1,%o2 101 srl %o2,1,%o2
102 sll %o1,31,%g2 102 sll %o1,31,%g2
103 or %g2,%o2,%o2 ! %o2 = lo(n1n0 >> 1) 103 or %g2,%o2,%o2 ! %o2 = lo(n1n0 >> 1)
104 srl %o1,1,%o1 ! %o1 = hi(n1n0 >> 1) 104 srl %o1,1,%o1 ! %o1 = hi(n1n0 >> 1)
105 105
106 and %o3,1,%g2 106 and %o3,1,%g2
107 srl %o3,1,%g3 ! %g3 = floor(d / 2) 107 srl %o3,1,%g3 ! %g3 = floor(d / 2)
108 add %g3,%g2,%g3 ! %g3 = ceil(d / 2) 108 add %g3,%g2,%g3 ! %g3 = ceil(d / 2)
109 109
110 b LLp1 110 b LLp1
111 addxcc %o2,%o2,%o2 111 addxcc %o2,%o2,%o2
112 112
113LLplop: bcc LLn1 113LLplop: bcc LLn1
114 addxcc %o2,%o2,%o2 114 addxcc %o2,%o2,%o2
115LLp1: addx %o1,%o1,%o1 115LLp1: addx %o1,%o1,%o1
116 subcc %o1,%g3,%o4 116 subcc %o1,%g3,%o4
117 bcc LLn2 117 bcc LLn2
118 addxcc %o2,%o2,%o2 118 addxcc %o2,%o2,%o2
119LLp2: addx %o1,%o1,%o1 119LLp2: addx %o1,%o1,%o1
120 subcc %o1,%g3,%o4 120 subcc %o1,%g3,%o4
121 bcc LLn3 121 bcc LLn3
122 addxcc %o2,%o2,%o2 122 addxcc %o2,%o2,%o2
123LLp3: addx %o1,%o1,%o1 123LLp3: addx %o1,%o1,%o1
124 subcc %o1,%g3,%o4 124 subcc %o1,%g3,%o4
125 bcc LLn4 125 bcc LLn4
126 addxcc %o2,%o2,%o2 126 addxcc %o2,%o2,%o2
127LLp4: addx %o1,%o1,%o1 127LLp4: addx %o1,%o1,%o1
128 addcc %g1,-1,%g1 128 addcc %g1,-1,%g1
129 bne LLplop 129 bne LLplop
130 subcc %o1,%g3,%o4 130 subcc %o1,%g3,%o4
131 bcc LLn5 131 bcc LLn5
132 addxcc %o2,%o2,%o2 132 addxcc %o2,%o2,%o2
133LLp5: add %o1,%o1,%o1 ! << 1 133LLp5: add %o1,%o1,%o1 ! << 1
134 tst %g2 134 tst %g2
135 bne Oddp 135 bne Oddp
136 add %o5,%o1,%o1 136 add %o5,%o1,%o1
137 st %o1,[%o0] 137 st %o1,[%o0]
138 retl 138 retl
139 xnor %g0,%o2,%o0 139 xnor %g0,%o2,%o0
140 140
141LLnlop: bcc LLp1 141LLnlop: bcc LLp1
142 addxcc %o2,%o2,%o2 142 addxcc %o2,%o2,%o2
143LLn1: addx %o4,%o4,%o4 143LLn1: addx %o4,%o4,%o4
144 subcc %o4,%g3,%o1 144 subcc %o4,%g3,%o1
145 bcc LLp2 145 bcc LLp2
146 addxcc %o2,%o2,%o2 146 addxcc %o2,%o2,%o2
147LLn2: addx %o4,%o4,%o4 147LLn2: addx %o4,%o4,%o4
148 subcc %o4,%g3,%o1 148 subcc %o4,%g3,%o1
149 bcc LLp3 149 bcc LLp3
150 addxcc %o2,%o2,%o2 150 addxcc %o2,%o2,%o2
151LLn3: addx %o4,%o4,%o4 151LLn3: addx %o4,%o4,%o4
152 subcc %o4,%g3,%o1 152 subcc %o4,%g3,%o1
153 bcc LLp4 153 bcc LLp4
154 addxcc %o2,%o2,%o2 154 addxcc %o2,%o2,%o2
155LLn4: addx %o4,%o4,%o4 155LLn4: addx %o4,%o4,%o4
156 addcc %g1,-1,%g1 156 addcc %g1,-1,%g1
157 bne LLnlop 157 bne LLnlop
158 subcc %o4,%g3,%o1 158 subcc %o4,%g3,%o1
159 bcc LLp5 159 bcc LLp5
160 addxcc %o2,%o2,%o2 160 addxcc %o2,%o2,%o2
161LLn5: add %o4,%o4,%o4 ! << 1 161LLn5: add %o4,%o4,%o4 ! << 1
162 tst %g2 162 tst %g2
163 bne Oddn 163 bne Oddn
164 add %o5,%o4,%o4 164 add %o5,%o4,%o4
165 st %o4,[%o0] 165 st %o4,[%o0]
166 retl 166 retl
167 xnor %g0,%o2,%o0 167 xnor %g0,%o2,%o0
168 168
169Oddp: xnor %g0,%o2,%o2 169Oddp: xnor %g0,%o2,%o2
170 ! q' in %o2. r' in %o1 170 ! q' in %o2. r' in %o1
171 addcc %o1,%o2,%o1 171 addcc %o1,%o2,%o1
172 bcc LLp6 172 bcc LLp6
173 addx %o2,0,%o2 173 addx %o2,0,%o2
174 sub %o1,%o3,%o1 174 sub %o1,%o3,%o1
175LLp6: subcc %o1,%o3,%g0 175LLp6: subcc %o1,%o3,%g0
176 bcs LLp7 176 bcs LLp7
177 subx %o2,-1,%o2 177 subx %o2,-1,%o2
178 sub %o1,%o3,%o1 178 sub %o1,%o3,%o1
179LLp7: st %o1,[%o0] 179LLp7: st %o1,[%o0]
180 retl 180 retl
181 mov %o2,%o0 181 mov %o2,%o0
182 182
183Oddn: xnor %g0,%o2,%o2 183Oddn: xnor %g0,%o2,%o2
184 ! q' in %o2. r' in %o4 184 ! q' in %o2. r' in %o4
185 addcc %o4,%o2,%o4 185 addcc %o4,%o2,%o4
186 bcc LLn6 186 bcc LLn6
187 addx %o2,0,%o2 187 addx %o2,0,%o2
188 sub %o4,%o3,%o4 188 sub %o4,%o3,%o4
189LLn6: subcc %o4,%o3,%g0 189LLn6: subcc %o4,%o3,%g0
190 bcs LLn7 190 bcs LLn7
191 subx %o2,-1,%o2 191 subx %o2,-1,%o2
192 sub %o4,%o3,%o4 192 sub %o4,%o3,%o4
193LLn7: st %o4,[%o0] 193LLn7: st %o4,[%o0]
194 retl 194 retl
195 mov %o2,%o0 195 mov %o2,%o0
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/Manifest
index ea062c9..dc1ce6a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/Manifest
@@ -1,23 +1,23 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20mpih-mul1.S 20mpih-mul1.S
21mpih-mul2.S 21mpih-mul2.S
22mpih-mul3.S 22mpih-mul3.S
23$names$ iQCVAwUAP+LmbjEAnp832S/7AQKQ2gQAotpCpY9rOJUCdZHbDLXXB9i1UUMraRKbVWimtKq493Y2d2wcqXCK2WaGs1AePK3K6Qk6msxZ0PL5Ho7KgHMkzsZ+wG0EUziiuX0yZRTWNm0r3TYerP6SdWH5GOVdSXn7ckkppk2sVOokfQTy+Tmrnah3+dlYJoujan+fmXWN6Us==DolM 23$names$ iQCVAwUAP+LmbjEAnp832S/7AQKQ2gQAotpCpY9rOJUCdZHbDLXXB9i1UUMraRKbVWimtKq493Y2d2wcqXCK2WaGs1AePK3K6Qk6msxZ0PL5Ho7KgHMkzsZ+wG0EUziiuX0yZRTWNm0r3TYerP6SdWH5GOVdSXn7ckkppk2sVOokfQTy+Tmrnah3+dlYJoujan+fmXWN6Us==DolM
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/distfiles
index 913356b..6e9a530 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/distfiles
@@ -1,5 +1,5 @@
1Manifest 1Manifest
2mpih-mul1.S 2mpih-mul1.S
3mpih-mul2.S 3mpih-mul2.S
4mpih-mul3.S 4mpih-mul3.S
5 5
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul1.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul1.S
index 8751c05..03fcdda 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul1.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul1.S
@@ -1,109 +1,109 @@
1/* SPARC v8 __mpn_mul_1 -- Multiply a limb vector with a single limb and 1/* SPARC v8 __mpn_mul_1 -- Multiply a limb vector with a single limb and
2 * store the product in a second limb vector. 2 * store the product in a second 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 31
32! INPUT PARAMETERS 32! INPUT PARAMETERS
33! res_ptr o0 33! res_ptr o0
34! s1_ptr o1 34! s1_ptr o1
35! size o2 35! size o2
36! s2_limb o3 36! s2_limb o3
37 37
38#include "sysdep.h" 38#include "sysdep.h"
39 39
40.text 40.text
41 .align 8 41 .align 8
42 .global C_SYMBOL_NAME(_gcry_mpih_mul_1) 42 .global C_SYMBOL_NAME(_gcry_mpih_mul_1)
43C_SYMBOL_NAME(_gcry_mpih_mul_1): 43C_SYMBOL_NAME(_gcry_mpih_mul_1):
44 sll %o2,4,%g1 44 sll %o2,4,%g1
45 and %g1,(4-1)<<4,%g1 45 and %g1,(4-1)<<4,%g1
46#if PIC 46#if PIC
47 mov %o7,%g4 ! Save return address register 47 mov %o7,%g4 ! Save return address register
48 call 1f 48 call 1f
49 add %o7,LL-1f,%g3 49 add %o7,LL-1f,%g3
501: mov %g4,%o7 ! Restore return address register 501: mov %g4,%o7 ! Restore return address register
51#else 51#else
52 sethi %hi(LL),%g3 52 sethi %hi(LL),%g3
53 or %g3,%lo(LL),%g3 53 or %g3,%lo(LL),%g3
54#endif 54#endif
55 jmp %g3+%g1 55 jmp %g3+%g1
56 ld [%o1+0],%o4 ! 1 56 ld [%o1+0],%o4 ! 1
57LL: 57LL:
58LL00: add %o0,-4,%o0 58LL00: add %o0,-4,%o0
59 add %o1,-4,%o1 59 add %o1,-4,%o1
60 b Loop00 /* 4, 8, 12, ... */ 60 b Loop00 /* 4, 8, 12, ... */
61 orcc %g0,%g0,%g2 61 orcc %g0,%g0,%g2
62LL01: b Loop01 /* 1, 5, 9, ... */ 62LL01: b Loop01 /* 1, 5, 9, ... */
63 orcc %g0,%g0,%g2 63 orcc %g0,%g0,%g2
64 nop 64 nop
65 nop 65 nop
66LL10: add %o0,-12,%o0 /* 2, 6, 10, ... */ 66LL10: add %o0,-12,%o0 /* 2, 6, 10, ... */
67 add %o1,4,%o1 67 add %o1,4,%o1
68 b Loop10 68 b Loop10
69 orcc %g0,%g0,%g2 69 orcc %g0,%g0,%g2
70 nop 70 nop
71LL11: add %o0,-8,%o0 /* 3, 7, 11, ... */ 71LL11: add %o0,-8,%o0 /* 3, 7, 11, ... */
72 add %o1,-8,%o1 72 add %o1,-8,%o1
73 b Loop11 73 b Loop11
74 orcc %g0,%g0,%g2 74 orcc %g0,%g0,%g2
75 75
76Loop: addcc %g3,%g2,%g3 ! 1 76Loop: addcc %g3,%g2,%g3 ! 1
77 ld [%o1+4],%o4 ! 2 77 ld [%o1+4],%o4 ! 2
78 st %g3,[%o0+0] ! 1 78 st %g3,[%o0+0] ! 1
79 rd %y,%g2 ! 1 79 rd %y,%g2 ! 1
80Loop00: umul %o4,%o3,%g3 ! 2 80Loop00: umul %o4,%o3,%g3 ! 2
81 addxcc %g3,%g2,%g3 ! 2 81 addxcc %g3,%g2,%g3 ! 2
82 ld [%o1+8],%o4 ! 3 82 ld [%o1+8],%o4 ! 3
83 st %g3,[%o0+4] ! 2 83 st %g3,[%o0+4] ! 2
84 rd %y,%g2 ! 2 84 rd %y,%g2 ! 2
85Loop11: umul %o4,%o3,%g3 ! 3 85Loop11: umul %o4,%o3,%g3 ! 3
86 addxcc %g3,%g2,%g3 ! 3 86 addxcc %g3,%g2,%g3 ! 3
87 ld [%o1+12],%o4 ! 4 87 ld [%o1+12],%o4 ! 4
88 add %o1,16,%o1 88 add %o1,16,%o1
89 st %g3,[%o0+8] ! 3 89 st %g3,[%o0+8] ! 3
90 rd %y,%g2 ! 3 90 rd %y,%g2 ! 3
91Loop10: umul %o4,%o3,%g3 ! 4 91Loop10: umul %o4,%o3,%g3 ! 4
92 addxcc %g3,%g2,%g3 ! 4 92 addxcc %g3,%g2,%g3 ! 4
93 ld [%o1+0],%o4 ! 1 93 ld [%o1+0],%o4 ! 1
94 st %g3,[%o0+12] ! 4 94 st %g3,[%o0+12] ! 4
95 add %o0,16,%o0 95 add %o0,16,%o0
96 rd %y,%g2 ! 4 96 rd %y,%g2 ! 4
97 addx %g0,%g2,%g2 97 addx %g0,%g2,%g2
98Loop01: addcc %o2,-4,%o2 98Loop01: addcc %o2,-4,%o2
99 bg Loop 99 bg Loop
100 umul %o4,%o3,%g3 ! 1 100 umul %o4,%o3,%g3 ! 1
101 101
102 addcc %g3,%g2,%g3 ! 4 102 addcc %g3,%g2,%g3 ! 4
103 st %g3,[%o0+0] ! 4 103 st %g3,[%o0+0] ! 4
104 rd %y,%g2 ! 4 104 rd %y,%g2 ! 4
105 105
106 retl 106 retl
107 addx %g0,%g2,%o0 107 addx %g0,%g2,%o0
108 108
109 109
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul2.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul2.S
index 4e58c93..6f5cc43 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul2.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul2.S
@@ -1,132 +1,132 @@
1/* SPARC v8 __mpn_addmul_1 -- Multiply a limb vector with a limb and 1/* SPARC v8 __mpn_addmul_1 -- Multiply a limb vector with a limb and
2 * add the result to a second limb vector. 2 * add the result to a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1993, 1994, 1995, 1998, 4 * Copyright (C) 1992, 1993, 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 31
32! INPUT PARAMETERS 32! INPUT PARAMETERS
33! res_ptr o0 33! res_ptr o0
34! s1_ptr o1 34! s1_ptr o1
35! size o2 35! size o2
36! s2_limb o3 36! s2_limb o3
37 37
38#include "sysdep.h" 38#include "sysdep.h"
39 39
40.text 40.text
41 .align 4 41 .align 4
42 .global C_SYMBOL_NAME(_gcry_mpih_addmul_1) 42 .global C_SYMBOL_NAME(_gcry_mpih_addmul_1)
43C_SYMBOL_NAME(_gcry_mpih_addmul_1): 43C_SYMBOL_NAME(_gcry_mpih_addmul_1):
44 orcc %g0,%g0,%g2 44 orcc %g0,%g0,%g2
45 ld [%o1+0],%o4 ! 1 45 ld [%o1+0],%o4 ! 1
46 46
47 sll %o2,4,%g1 47 sll %o2,4,%g1
48 and %g1,(4-1)<<4,%g1 48 and %g1,(4-1)<<4,%g1
49#if PIC 49#if PIC
50 mov %o7,%g4 ! Save return address register 50 mov %o7,%g4 ! Save return address register
51 call 1f 51 call 1f
52 add %o7,LL-1f,%g3 52 add %o7,LL-1f,%g3
531: mov %g4,%o7 ! Restore return address register 531: mov %g4,%o7 ! Restore return address register
54#else 54#else
55 sethi %hi(LL),%g3 55 sethi %hi(LL),%g3
56 or %g3,%lo(LL),%g3 56 or %g3,%lo(LL),%g3
57#endif 57#endif
58 jmp %g3+%g1 58 jmp %g3+%g1
59 nop 59 nop
60LL: 60LL:
61LL00: add %o0,-4,%o0 61LL00: add %o0,-4,%o0
62 b Loop00 /* 4, 8, 12, ... */ 62 b Loop00 /* 4, 8, 12, ... */
63 add %o1,-4,%o1 63 add %o1,-4,%o1
64 nop 64 nop
65LL01: b Loop01 /* 1, 5, 9, ... */ 65LL01: b Loop01 /* 1, 5, 9, ... */
66 nop 66 nop
67 nop 67 nop
68 nop 68 nop
69LL10: add %o0,-12,%o0 /* 2, 6, 10, ... */ 69LL10: add %o0,-12,%o0 /* 2, 6, 10, ... */
70 b Loop10 70 b Loop10
71 add %o1,4,%o1 71 add %o1,4,%o1
72 nop 72 nop
73LL11: add %o0,-8,%o0 /* 3, 7, 11, ... */ 73LL11: add %o0,-8,%o0 /* 3, 7, 11, ... */
74 b Loop11 74 b Loop11
75 add %o1,-8,%o1 75 add %o1,-8,%o1
76 nop 76 nop
77 77
781: addcc %g3,%g2,%g3 ! 1 781: addcc %g3,%g2,%g3 ! 1
79 ld [%o1+4],%o4 ! 2 79 ld [%o1+4],%o4 ! 2
80 rd %y,%g2 ! 1 80 rd %y,%g2 ! 1
81 addx %g0,%g2,%g2 81 addx %g0,%g2,%g2
82 ld [%o0+0],%g1 ! 2 82 ld [%o0+0],%g1 ! 2
83 addcc %g1,%g3,%g3 83 addcc %g1,%g3,%g3
84 st %g3,[%o0+0] ! 1 84 st %g3,[%o0+0] ! 1
85Loop00: umul %o4,%o3,%g3 ! 2 85Loop00: umul %o4,%o3,%g3 ! 2
86 ld [%o0+4],%g1 ! 2 86 ld [%o0+4],%g1 ! 2
87 addxcc %g3,%g2,%g3 ! 2 87 addxcc %g3,%g2,%g3 ! 2
88 ld [%o1+8],%o4 ! 3 88 ld [%o1+8],%o4 ! 3
89 rd %y,%g2 ! 2 89 rd %y,%g2 ! 2
90 addx %g0,%g2,%g2 90 addx %g0,%g2,%g2
91 nop 91 nop
92 addcc %g1,%g3,%g3 92 addcc %g1,%g3,%g3
93 st %g3,[%o0+4] ! 2 93 st %g3,[%o0+4] ! 2
94Loop11: umul %o4,%o3,%g3 ! 3 94Loop11: umul %o4,%o3,%g3 ! 3
95 addxcc %g3,%g2,%g3 ! 3 95 addxcc %g3,%g2,%g3 ! 3
96 ld [%o1+12],%o4 ! 4 96 ld [%o1+12],%o4 ! 4
97 rd %y,%g2 ! 3 97 rd %y,%g2 ! 3
98 add %o1,16,%o1 98 add %o1,16,%o1
99 addx %g0,%g2,%g2 99 addx %g0,%g2,%g2
100 ld [%o0+8],%g1 ! 2 100 ld [%o0+8],%g1 ! 2
101 addcc %g1,%g3,%g3 101 addcc %g1,%g3,%g3
102 st %g3,[%o0+8] ! 3 102 st %g3,[%o0+8] ! 3
103Loop10: umul %o4,%o3,%g3 ! 4 103Loop10: umul %o4,%o3,%g3 ! 4
104 addxcc %g3,%g2,%g3 ! 4 104 addxcc %g3,%g2,%g3 ! 4
105 ld [%o1+0],%o4 ! 1 105 ld [%o1+0],%o4 ! 1
106 rd %y,%g2 ! 4 106 rd %y,%g2 ! 4
107 addx %g0,%g2,%g2 107 addx %g0,%g2,%g2
108 ld [%o0+12],%g1 ! 2 108 ld [%o0+12],%g1 ! 2
109 addcc %g1,%g3,%g3 109 addcc %g1,%g3,%g3
110 st %g3,[%o0+12] ! 4 110 st %g3,[%o0+12] ! 4
111 add %o0,16,%o0 111 add %o0,16,%o0
112 addx %g0,%g2,%g2 112 addx %g0,%g2,%g2
113Loop01: addcc %o2,-4,%o2 113Loop01: addcc %o2,-4,%o2
114 bg 1b 114 bg 1b
115 umul %o4,%o3,%g3 ! 1 115 umul %o4,%o3,%g3 ! 1
116 116
117 addcc %g3,%g2,%g3 ! 4 117 addcc %g3,%g2,%g3 ! 4
118 rd %y,%g2 ! 4 118 rd %y,%g2 ! 4
119 addx %g0,%g2,%g2 119 addx %g0,%g2,%g2
120 ld [%o0+0],%g1 ! 2 120 ld [%o0+0],%g1 ! 2
121 addcc %g1,%g3,%g3 121 addcc %g1,%g3,%g3
122 st %g3,[%o0+0] ! 4 122 st %g3,[%o0+0] ! 4
123 addx %g0,%g2,%o0 123 addx %g0,%g2,%o0
124 124
125 retl 125 retl
126 nop 126 nop
127 127
128 128
129! umul, ld, addxcc, rd, st 129! umul, ld, addxcc, rd, st
130 130
131! umul, ld, addxcc, rd, ld, addcc, st, addx 131! umul, ld, addxcc, rd, ld, addcc, st, addx
132 132
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul3.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul3.S
index fc7953a..93bb194 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul3.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32v8/mpih-mul3.S
@@ -1,67 +1,67 @@
1/* SPARC v8 __mpn_submul_1 -- Multiply a limb vector with a limb and 1/* SPARC v8 __mpn_submul_1 -- Multiply a limb vector with a limb and
2 * subtract the result from a second limb vector. 2 * subtract the result from a second limb vector.
3 * 3 *
4 * Copyright (C) 1992, 1993, 1994, 1998, 4 * Copyright (C) 1992, 1993, 1994, 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! INPUT PARAMETERS 31! INPUT PARAMETERS
32! res_ptr o0 32! res_ptr o0
33! s1_ptr o1 33! s1_ptr o1
34! size o2 34! size o2
35! s2_limb o3 35! s2_limb o3
36 36
37#include "sysdep.h" 37#include "sysdep.h"
38 38
39.text 39.text
40 .align 4 40 .align 4
41 .global C_SYMBOL_NAME(_gcry_mpih_submul_1) 41 .global C_SYMBOL_NAME(_gcry_mpih_submul_1)
42C_SYMBOL_NAME(_gcry_mpih_submul_1): 42C_SYMBOL_NAME(_gcry_mpih_submul_1):
43 sub %g0,%o2,%o2 ! negate ... 43 sub %g0,%o2,%o2 ! negate ...
44 sll %o2,2,%o2 ! ... and scale size 44 sll %o2,2,%o2 ! ... and scale size
45 sub %o1,%o2,%o1 ! o1 is offset s1_ptr 45 sub %o1,%o2,%o1 ! o1 is offset s1_ptr
46 sub %o0,%o2,%g1 ! g1 is offset res_ptr 46 sub %o0,%o2,%g1 ! g1 is offset res_ptr
47 47
48 mov 0,%o0 ! clear cy_limb 48 mov 0,%o0 ! clear cy_limb
49 49
50Loop: ld [%o1+%o2],%o4 50Loop: ld [%o1+%o2],%o4
51 ld [%g1+%o2],%g2 51 ld [%g1+%o2],%g2
52 umul %o4,%o3,%o5 52 umul %o4,%o3,%o5
53 rd %y,%g3 53 rd %y,%g3
54 addcc %o5,%o0,%o5 54 addcc %o5,%o0,%o5
55 addx %g3,0,%o0 55 addx %g3,0,%o0
56 subcc %g2,%o5,%g2 56 subcc %g2,%o5,%g2
57 addx %o0,0,%o0 57 addx %o0,0,%o0
58 st %g2,[%g1+%o2] 58 st %g2,[%g1+%o2]
59 59
60 addcc %o2,4,%o2 60 addcc %o2,4,%o2
61 bne Loop 61 bne Loop
62 nop 62 nop
63 63
64 retl 64 retl
65 nop 65 nop
66 66
67 67
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/Manifest
index 7a5d61a..869b97b 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/Manifest
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/Manifest
@@ -1,21 +1,21 @@
1# Manifest - checksums 1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc. 2# Copyright 2003 Free Software Foundation, Inc.
3# 3#
4# This file is part of Libgcrypt. 4# This file is part of Libgcrypt.
5# 5#
6# Libgcrypt is free software; you can redistribute it and/or modify 6# Libgcrypt is free software; you can redistribute it and/or modify
7# it under the terms of the GNU Lesser General Public License as 7# it under the terms of the GNU Lesser General Public License as
8# published by the Free Software Foundation; either version 2.1 of 8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version. 9# the License, or (at your option) any later version.
10# 10#
11# Libgcrypt is distributed in the hope that it will be useful, 11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of 12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details. 14# GNU Lesser General Public License for more details.
15# 15#
16# You should have received a copy of the GNU Lesser General Public 16# You should have received a copy of the GNU Lesser General Public
17# License along with this program; if not, write to the Free Software 17# License along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 19
20udiv.S 20udiv.S
21$names$ iQCVAwUAP+LmdjEAnp832S/7AQIrUgQA3YmurZhK7r20DqRvg0gwNe9jMDcFfUY4ZPhW5HkGzMbmrxXtj5Dx50RIPteum72bXE+IhcngljQb/cskiN5Hi9oc2a2CPhyTqVFEeGyF+kJ170GI1pVfFOfzbVG0F4nEwm5lGHgv/nvFsvrjmmAXVW1v/yk5N35wbiLviOFrLOQ==byFc 21$names$ iQCVAwUAP+LmdjEAnp832S/7AQIrUgQA3YmurZhK7r20DqRvg0gwNe9jMDcFfUY4ZPhW5HkGzMbmrxXtj5Dx50RIPteum72bXE+IhcngljQb/cskiN5Hi9oc2a2CPhyTqVFEeGyF+kJ170GI1pVfFOfzbVG0F4nEwm5lGHgv/nvFsvrjmmAXVW1v/yk5N35wbiLviOFrLOQ==byFc
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/distfiles b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/distfiles
index abd6e1e..ef7c0a5 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/distfiles
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/distfiles
@@ -1,3 +1,3 @@
1Manifest 1Manifest
2udiv.S 2udiv.S
3 3
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/udiv.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/udiv.S
index 2f65886..79e506a 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/udiv.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/supersparc/udiv.S
@@ -1,118 +1,118 @@
1/* SuperSPARC __udiv_qrnnd division support, used from longlong.h. 1/* SuperSPARC __udiv_qrnnd division support, used from longlong.h.
2 * This is for SuperSPARC only, to compensate for its 2 * This is for SuperSPARC only, to compensate for its
3 * semi-functional udiv instruction. 3 * semi-functional udiv instruction.
4 * 4 *
5 * Copyright (C) 1993, 1994, 1996, 1998, 5 * Copyright (C) 1993, 1994, 1996, 1998,
6 * 2001, 2002 Free Software Foundation, Inc. 6 * 2001, 2002 Free Software Foundation, Inc.
7 * 7 *
8 * This file is part of Libgcrypt. 8 * This file is part of Libgcrypt.
9 * 9 *
10 * Libgcrypt is free software; you can redistribute it and/or modify 10 * Libgcrypt is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as 11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2.1 of 12 * published by the Free Software Foundation; either version 2.1 of
13 * the License, or (at your option) any later version. 13 * the License, or (at your option) any later version.
14 * 14 *
15 * Libgcrypt is distributed in the hope that it will be useful, 15 * Libgcrypt is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details. 18 * GNU Lesser General Public License for more details.
19 * 19 *
20 * You should have received a copy of the GNU Lesser General Public 20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this program; if not, write to the Free Software 21 * License along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
23 * 23 *
24 * Note: This code is heavily based on the GNU MP Library. 24 * Note: This code is heavily based on the GNU MP Library.
25 * Actually it's the same code with only minor changes in the 25 * Actually it's the same code with only minor changes in the
26 * way the data is stored; this is to support the abstraction 26 * way the data is stored; this is to support the abstraction
27 * of an optional secure memory allocation which may be used 27 * of an optional secure memory allocation which may be used
28 * to avoid revealing of sensitive data due to paging etc. 28 * to avoid revealing of sensitive data due to paging etc.
29 */ 29 */
30 30
31 31
32 32
33! INPUT PARAMETERS 33! INPUT PARAMETERS
34! rem_ptr i0 34! rem_ptr i0
35! n1 i1 35! n1 i1
36! n0 i2 36! n0 i2
37! d i3 37! d i3
38 38
39#include "sysdep.h" 39#include "sysdep.h"
40#undef ret /* Kludge for glibc */ 40#undef ret /* Kludge for glibc */
41 41
42 .text 42 .text
43 .align 8 43 .align 8
44LC0: .double 0r4294967296 44LC0: .double 0r4294967296
45LC1: .double 0r2147483648 45LC1: .double 0r2147483648
46 46
47 .align 4 47 .align 4
48 .global C_SYMBOL_NAME(__udiv_qrnnd) 48 .global C_SYMBOL_NAME(__udiv_qrnnd)
49C_SYMBOL_NAME(__udiv_qrnnd): 49C_SYMBOL_NAME(__udiv_qrnnd):
50 !#PROLOGUE# 0 50 !#PROLOGUE# 0
51 save %sp,-104,%sp 51 save %sp,-104,%sp
52 !#PROLOGUE# 1 52 !#PROLOGUE# 1
53 st %i1,[%fp-8] 53 st %i1,[%fp-8]
54 ld [%fp-8],%f10 54 ld [%fp-8],%f10
55 sethi %hi(LC0),%o7 55 sethi %hi(LC0),%o7
56 fitod %f10,%f4 56 fitod %f10,%f4
57 ldd [%o7+%lo(LC0)],%f8 57 ldd [%o7+%lo(LC0)],%f8
58 cmp %i1,0 58 cmp %i1,0
59 bge L248 59 bge L248
60 mov %i0,%i5 60 mov %i0,%i5
61 faddd %f4,%f8,%f4 61 faddd %f4,%f8,%f4
62L248: 62L248:
63 st %i2,[%fp-8] 63 st %i2,[%fp-8]
64 ld [%fp-8],%f10 64 ld [%fp-8],%f10
65 fmuld %f4,%f8,%f6 65 fmuld %f4,%f8,%f6
66 cmp %i2,0 66 cmp %i2,0
67 bge L249 67 bge L249
68 fitod %f10,%f2 68 fitod %f10,%f2
69 faddd %f2,%f8,%f2 69 faddd %f2,%f8,%f2
70L249: 70L249:
71 st %i3,[%fp-8] 71 st %i3,[%fp-8]
72 faddd %f6,%f2,%f2 72 faddd %f6,%f2,%f2
73 ld [%fp-8],%f10 73 ld [%fp-8],%f10
74 cmp %i3,0 74 cmp %i3,0
75 bge L250 75 bge L250
76 fitod %f10,%f4 76 fitod %f10,%f4
77 faddd %f4,%f8,%f4 77 faddd %f4,%f8,%f4
78L250: 78L250:
79 fdivd %f2,%f4,%f2 79 fdivd %f2,%f4,%f2
80 sethi %hi(LC1),%o7 80 sethi %hi(LC1),%o7
81 ldd [%o7+%lo(LC1)],%f4 81 ldd [%o7+%lo(LC1)],%f4
82 fcmped %f2,%f4 82 fcmped %f2,%f4
83 nop 83 nop
84 fbge,a L251 84 fbge,a L251
85 fsubd %f2,%f4,%f2 85 fsubd %f2,%f4,%f2
86 fdtoi %f2,%f2 86 fdtoi %f2,%f2
87 st %f2,[%fp-8] 87 st %f2,[%fp-8]
88 b L252 88 b L252
89 ld [%fp-8],%i4 89 ld [%fp-8],%i4
90L251: 90L251:
91 fdtoi %f2,%f2 91 fdtoi %f2,%f2
92 st %f2,[%fp-8] 92 st %f2,[%fp-8]
93 ld [%fp-8],%i4 93 ld [%fp-8],%i4
94 sethi %hi(-2147483648),%g2 94 sethi %hi(-2147483648),%g2
95 xor %i4,%g2,%i4 95 xor %i4,%g2,%i4
96L252: 96L252:
97 umul %i3,%i4,%g3 97 umul %i3,%i4,%g3
98 rd %y,%i0 98 rd %y,%i0
99 subcc %i2,%g3,%o7 99 subcc %i2,%g3,%o7
100 subxcc %i1,%i0,%g0 100 subxcc %i1,%i0,%g0
101 be L253 101 be L253
102 cmp %o7,%i3 102 cmp %o7,%i3
103 103
104 add %i4,-1,%i0 104 add %i4,-1,%i0
105 add %o7,%i3,%o7 105 add %o7,%i3,%o7
106 st %o7,[%i5] 106 st %o7,[%i5]
107 ret 107 ret
108 restore 108 restore
109L253: 109L253:
110 blu L246 110 blu L246
111 mov %i4,%i0 111 mov %i4,%i0
112 add %i4,1,%i0 112 add %i4,1,%i0
113 sub %o7,%i3,%o7 113 sub %o7,%i3,%o7
114L246: 114L246:
115 st %o7,[%i5] 115 st %o7,[%i5]
116 ret 116 ret
117 restore 117 restore
118 118