aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power')
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest27
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/distfiles8
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-add1.S87
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-lshift.S64
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul1.S115
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul2.S130
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul3.S135
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-rshift.S64
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-sub1.S88
9 files changed, 718 insertions, 0 deletions
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest
new file mode 100755
index 0000000..d901318
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/Manifest
@@ -0,0 +1,27 @@
1# Manifest - checksums
2# Copyright 2003 Free Software Foundation, Inc.
3#
4# This file is part of Libgcrypt.
5#
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
8# published by the Free Software Foundation; either version 2.1 of
9# the License, or (at your option) any later version.
10#
11# Libgcrypt is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Lesser General Public License for more details.
15#
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
18# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
20mpih-add1.S
21mpih-lshift.S
22mpih-mul1.S
23mpih-mul2.S
24mpih-mul3.S
25mpih-rshift.S
26mpih-sub1.S
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
new file mode 100755
index 0000000..8988899
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/distfiles
@@ -0,0 +1,8 @@
1Manifest
2mpih-add1.S
3mpih-lshift.S
4mpih-mul1.S
5mpih-mul2.S
6mpih-mul3.S
7mpih-rshift.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
new file mode 100755
index 0000000..4214520
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-add1.S
@@ -0,0 +1,87 @@
1/* IBM POWER add_n -- Add two limb vectors of equal, non-zero length.
2 *
3 * Copyright (C) 1992, 1994, 1996, 1999,
4 * 2002 Free Software Foundation, Inc.
5 *
6 * This file is part of Libgcrypt.
7 *
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
10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
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
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */
22
23#include "sysdep.h"
24#include "asm-syntax.h"
25
26/*
27# INPUT PARAMETERS
28# res_ptr r3
29# s1_ptr r4
30# s2_ptr r5
31# size r6
32 */
33
34 .toc
35 .extern _gcry_mpih_add_n[DS]
36 .extern ._gcry_mpih_add_n
37.csect [PR]
38 .align 2
39 .globl _gcry_mpih_add_n
40 .globl ._gcry_mpih_add_n
41 .csect _gcry_mpih_add_n[DS]
42_gcry_mpih_add_n:
43 .long ._gcry_mpih_add_n, TOC[tc0], 0
44 .csect [PR]
45._gcry_mpih_add_n:
46 andil. 10,6,1 # odd or even number of limbs?
47 l 8,0(4) # load least significant s1 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
50 sri 10,6,1 # count for unrolled loop
51 a 7,0,8 # add least significant limbs, set cy
52 mtctr 10 # copy count into CTR
53 beq 0,Leven # branch if even # of limbs (# of limbs >= 2)
54
55# We have an odd # of limbs. Add the first limbs separately.
56 cmpi 1,10,0 # is count for unrolled loop zero?
57 bne 1,L1 # branch if not
58 st 7,4(3)
59 aze 3,10 # use the fact that r10 is zero...
60 br # return
61
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
64 lu 0,4(5) # load s2 limb and update s2_ptr
65 stu 7,4(3)
66 ae 7,0,8 # add limbs, set cy
67Leven: lu 9,4(4) # load s1 limb and update s1_ptr
68 lu 10,4(5) # load s2 limb and update s2_ptr
69 bdz Lend # If done, skip loop
70
71Loop: lu 8,4(4) # load s1 limb and update s1_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
74 stu 7,4(3) #
75 lu 9,4(4) # load s1 limb and update s1_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
78 stu 11,4(3) #
79 bdn Loop # decrement CTR and loop back
80
81Lend: ae 11,9,10 # add limbs with cy, set cy
82 st 7,4(3) #
83 st 11,8(3) #
84 lil 3,0 # load cy into ...
85 aze 3,3 # ... return value register
86 br
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
new file mode 100755
index 0000000..0ce1788
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-lshift.S
@@ -0,0 +1,64 @@
1/* IBM POWER lshift
2 *
3 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
4 *
5 * This file is part of Libgcrypt.
6 *
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
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
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
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */
21
22#include "sysdep.h"
23#include "asm-syntax.h"
24
25/*
26# INPUT PARAMETERS
27# res_ptr r3
28# s_ptr r4
29# size r5
30# cnt r6
31 */
32
33 .toc
34 .extern _gcry_mpih_lshift[DS]
35 .extern ._gcry_mpih_lshift
36.csect [PR]
37 .align 2
38 .globl _gcry_mpih_lshift
39 .globl ._gcry_mpih_lshift
40 .csect _gcry_mpih_lshift[DS]
41_gcry_mpih_lshift:
42 .long ._gcry_mpih_lshift, TOC[tc0], 0
43 .csect [PR]
44._gcry_mpih_lshift:
45 sli 0,5,2
46 cax 9,3,0
47 cax 4,4,0
48 sfi 8,6,32
49 mtctr 5 # put limb count in CTR loop register
50 lu 0,-4(4) # read most significant limb
51 sre 3,0,8 # compute carry out limb, and init MQ register
52 bdz Lend2 # if just one limb, skip loop
53 lu 0,-4(4) # read 2:nd most significant limb
54 sreq 7,0,8 # compute most significant limb of result
55 bdz Lend # if just two limb, skip loop
56Loop: lu 0,-4(4) # load next lower limb
57 stu 7,-4(9) # store previous result during read latency
58 sreq 7,0,8 # compute result limb
59 bdn Loop # loop back until CTR is zero
60Lend: stu 7,-4(9) # store 2:nd least significant limb
61Lend2: sle 7,0,6 # compute least significant limb
62 st 7,-4(9) # store it
63 br
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
new file mode 100755
index 0000000..f36e97b
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul1.S
@@ -0,0 +1,115 @@
1/* IBM POWER mul_1 -- Multiply a limb vector with a limb and store
2 * the result in a second limb vector.
3 *
4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
5 *
6 * This file is part of Libgcrypt.
7 *
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
10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
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
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */
22
23#include "sysdep.h"
24#include "asm-syntax.h"
25
26/*
27# INPUT PARAMETERS
28# res_ptr r3
29# s1_ptr r4
30# size r5
31# s2_limb r6
32
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
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
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
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
41# we can branch in zero cycles, so that's how we perform the additions.
42 */
43
44 .toc
45 .csect ._gcry_mpih_mul_1[PR]
46 .align 2
47 .globl _gcry_mpih_mul_1
48 .globl ._gcry_mpih_mul_1
49 .csect _gcry_mpih_mul_1[DS]
50_gcry_mpih_mul_1:
51 .long ._gcry_mpih_mul_1[PR], TOC[tc0], 0
52 .csect ._gcry_mpih_mul_1[PR]
53._gcry_mpih_mul_1:
54
55 cal 3,-4(3)
56 l 0,0(4)
57 cmpi 0,6,0
58 mtctr 5
59 mul 9,0,6
60 srai 7,0,31
61 and 7,7,6
62 mfmq 8
63 ai 0,0,0 # reset carry
64 cax 9,9,7
65 blt Lneg
66Lpos: bdz Lend
67Lploop: lu 0,4(4)
68 stu 8,4(3)
69 cmpi 0,0,0
70 mul 10,0,6
71 mfmq 0
72 ae 8,0,9
73 bge Lp0
74 cax 10,10,6 # adjust high limb for negative limb from s1
75Lp0: bdz Lend0
76 lu 0,4(4)
77 stu 8,4(3)
78 cmpi 0,0,0
79 mul 9,0,6
80 mfmq 0
81 ae 8,0,10
82 bge Lp1
83 cax 9,9,6 # adjust high limb for negative limb from s1
84Lp1: bdn Lploop
85 b Lend
86
87Lneg: cax 9,9,0
88 bdz Lend
89Lnloop: lu 0,4(4)
90 stu 8,4(3)
91 cmpi 0,0,0
92 mul 10,0,6
93 cax 10,10,0 # adjust high limb for negative s2_limb
94 mfmq 0
95 ae 8,0,9
96 bge Ln0
97 cax 10,10,6 # adjust high limb for negative limb from s1
98Ln0: bdz Lend0
99 lu 0,4(4)
100 stu 8,4(3)
101 cmpi 0,0,0
102 mul 9,0,6
103 cax 9,9,0 # adjust high limb for negative s2_limb
104 mfmq 0
105 ae 8,0,10
106 bge Ln1
107 cax 9,9,6 # adjust high limb for negative limb from s1
108Ln1: bdn Lnloop
109 b Lend
110
111Lend0: cal 9,0(10)
112Lend: st 8,4(3)
113 aze 3,9
114 br
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
new file mode 100755
index 0000000..7894a95
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul2.S
@@ -0,0 +1,130 @@
1/* IBM POWER addmul_1 -- Multiply a limb vector with a limb and add
2 * the result to a second limb vector.
3 *
4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
5 *
6 * This file is part of Libgcrypt.
7 *
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
10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
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
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */
22
23#include "sysdep.h"
24#include "asm-syntax.h"
25
26
27
28/*
29# INPUT PARAMETERS
30# res_ptr r3
31# s1_ptr r4
32# size r5
33# s2_limb r6
34
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
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
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
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
43# we can branch in zero cycles, so that's how we perform the additions.
44 */
45
46 .toc
47 .csect ._gcry_mpih_addmul_1[PR]
48 .align 2
49 .globl _gcry_mpih_addmul_1
50 .globl ._gcry_mpih_addmul_1
51 .csect _gcry_mpih_addmul_1[DS]
52_gcry_mpih_addmul_1:
53 .long ._gcry_mpih_addmul_1[PR], TOC[tc0], 0
54 .csect ._gcry_mpih_addmul_1[PR]
55._gcry_mpih_addmul_1:
56
57 cal 3,-4(3)
58 l 0,0(4)
59 cmpi 0,6,0
60 mtctr 5
61 mul 9,0,6
62 srai 7,0,31
63 and 7,7,6
64 mfmq 8
65 cax 9,9,7
66 l 7,4(3)
67 a 8,8,7 # add res_limb
68 blt Lneg
69Lpos: bdz Lend
70
71Lploop: lu 0,4(4)
72 stu 8,4(3)
73 cmpi 0,0,0
74 mul 10,0,6
75 mfmq 0
76 ae 8,0,9 # low limb + old_cy_limb + old cy
77 l 7,4(3)
78 aze 10,10 # propagate cy to new cy_limb
79 a 8,8,7 # add res_limb
80 bge Lp0
81 cax 10,10,6 # adjust high limb for negative limb from s1
82Lp0: bdz Lend0
83 lu 0,4(4)
84 stu 8,4(3)
85 cmpi 0,0,0
86 mul 9,0,6
87 mfmq 0
88 ae 8,0,10
89 l 7,4(3)
90 aze 9,9
91 a 8,8,7
92 bge Lp1
93 cax 9,9,6 # adjust high limb for negative limb from s1
94Lp1: bdn Lploop
95
96 b Lend
97
98Lneg: cax 9,9,0
99 bdz Lend
100Lnloop: lu 0,4(4)
101 stu 8,4(3)
102 cmpi 0,0,0
103 mul 10,0,6
104 mfmq 7
105 ae 8,7,9
106 l 7,4(3)
107 ae 10,10,0 # propagate cy to new cy_limb
108 a 8,8,7 # add res_limb
109 bge Ln0
110 cax 10,10,6 # adjust high limb for negative limb from s1
111Ln0: bdz Lend0
112 lu 0,4(4)
113 stu 8,4(3)
114 cmpi 0,0,0
115 mul 9,0,6
116 mfmq 7
117 ae 8,7,10
118 l 7,4(3)
119 ae 9,9,0 # propagate cy to new cy_limb
120 a 8,8,7 # add res_limb
121 bge Ln1
122 cax 9,9,6 # adjust high limb for negative limb from s1
123Ln1: bdn Lnloop
124 b Lend
125
126Lend0: cal 9,0(10)
127Lend: st 8,4(3)
128 aze 3,9
129 br
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
new file mode 100755
index 0000000..df3a2ed
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-mul3.S
@@ -0,0 +1,135 @@
1/* IBM POWER submul_1 -- Multiply a limb vector with a limb and subtract
2 * the result from a second limb vector.
3 *
4 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
5 *
6 * This file is part of Libgcrypt.
7 *
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
10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
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
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */
22
23#include "sysdep.h"
24#include "asm-syntax.h"
25
26
27/*
28
29# INPUT PARAMETERS
30# res_ptr r3
31# s1_ptr r4
32# size r5
33# s2_limb r6
34
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
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
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
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
43# we can branch in zero cycles, so that's how we perform the additions.
44 */
45
46 .toc
47 .csect ._gcry_mpih_submul_1[PR]
48 .align 2
49 .globl _gcry_mpih_submul_1
50 .globl ._gcry_mpih_submul_1
51 .csect _gcry_mpih_submul_1[DS]
52_gcry_mpih_submul_1:
53 .long ._gcry_mpih_submul_1[PR], TOC[tc0], 0
54 .csect ._gcry_mpih_submul_1[PR]
55._gcry_mpih_submul_1:
56
57 cal 3,-4(3)
58 l 0,0(4)
59 cmpi 0,6,0
60 mtctr 5
61 mul 9,0,6
62 srai 7,0,31
63 and 7,7,6
64 mfmq 11
65 cax 9,9,7
66 l 7,4(3)
67 sf 8,11,7 # add res_limb
68 a 11,8,11 # invert cy (r11 is junk)
69 blt Lneg
70Lpos: bdz Lend
71
72Lploop: lu 0,4(4)
73 stu 8,4(3)
74 cmpi 0,0,0
75 mul 10,0,6
76 mfmq 0
77 ae 11,0,9 # low limb + old_cy_limb + old cy
78 l 7,4(3)
79 aze 10,10 # propagate cy to new cy_limb
80 sf 8,11,7 # add res_limb
81 a 11,8,11 # invert cy (r11 is junk)
82 bge Lp0
83 cax 10,10,6 # adjust high limb for negative limb from s1
84Lp0: bdz Lend0
85 lu 0,4(4)
86 stu 8,4(3)
87 cmpi 0,0,0
88 mul 9,0,6
89 mfmq 0
90 ae 11,0,10
91 l 7,4(3)
92 aze 9,9
93 sf 8,11,7
94 a 11,8,11 # invert cy (r11 is junk)
95 bge Lp1
96 cax 9,9,6 # adjust high limb for negative limb from s1
97Lp1: bdn Lploop
98
99 b Lend
100
101Lneg: cax 9,9,0
102 bdz Lend
103Lnloop: lu 0,4(4)
104 stu 8,4(3)
105 cmpi 0,0,0
106 mul 10,0,6
107 mfmq 7
108 ae 11,7,9
109 l 7,4(3)
110 ae 10,10,0 # propagate cy to new cy_limb
111 sf 8,11,7 # add res_limb
112 a 11,8,11 # invert cy (r11 is junk)
113 bge Ln0
114 cax 10,10,6 # adjust high limb for negative limb from s1
115Ln0: bdz Lend0
116 lu 0,4(4)
117 stu 8,4(3)
118 cmpi 0,0,0
119 mul 9,0,6
120 mfmq 7
121 ae 11,7,10
122 l 7,4(3)
123 ae 9,9,0 # propagate cy to new cy_limb
124 sf 8,11,7 # add res_limb
125 a 11,8,11 # invert cy (r11 is junk)
126 bge Ln1
127 cax 9,9,6 # adjust high limb for negative limb from s1
128Ln1: bdn Lnloop
129 b Lend
130
131Lend0: cal 9,0(10)
132Lend: st 8,4(3)
133 aze 3,9
134 br
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
new file mode 100755
index 0000000..0e85ae3
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-rshift.S
@@ -0,0 +1,64 @@
1/* IBM POWER rshift
2 *
3 * Copyright (C) 1992, 1994, 1999, 2002 Free Software Foundation, Inc.
4 *
5 * This file is part of Libgcrypt.
6 *
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
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * Libgcrypt is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
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
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */
21
22#include "sysdep.h"
23#include "asm-syntax.h"
24
25
26/*
27# INPUT PARAMETERS
28# res_ptr r3
29# s_ptr r4
30# size r5
31# cnt r6
32*/
33
34 .toc
35 .extern _gcry_mpih_rshift[DS]
36 .extern ._gcry_mpih_rshift
37.csect [PR]
38 .align 2
39 .globl _gcry_mpih_rshift
40 .globl ._gcry_mpih_rshift
41 .csect _gcry_mpih_rshift[DS]
42_gcry_mpih_rshift:
43 .long ._gcry_mpih_rshift, TOC[tc0], 0
44 .csect [PR]
45._gcry_mpih_rshift:
46 sfi 8,6,32
47 mtctr 5 # put limb count in CTR loop register
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
50 sle 3,0,8 # compute carry limb, and init MQ register
51 bdz Lend2 # if just one limb, skip loop
52 lu 0,4(4) # read 2:nd least significant limb
53 sleq 7,0,8 # compute least significant limb of result
54 bdz Lend # if just two limb, skip loop
55Loop: lu 0,4(4) # load next higher limb
56 stu 7,4(9) # store previous result during read latency
57 sleq 7,0,8 # compute result limb
58 bdn Loop # loop back until CTR is zero
59Lend: stu 7,4(9) # store 2:nd most significant limb
60Lend2: sre 7,0,6 # compute most significant limb
61 st 7,4(9) # store it
62 br
63
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
new file mode 100755
index 0000000..5e08ac3
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/power/mpih-sub1.S
@@ -0,0 +1,88 @@
1/* IBM POWER sub_n -- Subtract two limb vectors of equal, non-zero length.
2 *
3 * Copyright (C) 1992, 1994, 1995, 1996, 1999,
4 * 2002 Free Software Foundation, Inc.
5 *
6 * This file is part of Libgcrypt.
7 *
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
10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
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
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */
22
23#include "sysdep.h"
24#include "asm-syntax.h"
25
26/*
27# INPUT PARAMETERS
28# res_ptr r3
29# s1_ptr r4
30# s2_ptr r5
31# size r6
32 */
33
34 .toc
35 .extern _gcry_mpih_sub_n[DS]
36 .extern ._gcry_mpih_sub_n
37.csect [PR]
38 .align 2
39 .globl _gcry_mpih_sub_n
40 .globl ._gcry_mpih_sub_n
41 .csect _gcry_mpih_sub_n[DS]
42_gcry_mpih_sub_n:
43 .long ._gcry_mpih_sub_n, TOC[tc0], 0
44 .csect [PR]
45._gcry_mpih_sub_n:
46 andil. 10,6,1 # odd or even number of limbs?
47 l 8,0(4) # load least significant s1 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
50 sri 10,6,1 # count for unrolled loop
51 sf 7,0,8 # subtract least significant limbs, set cy
52 mtctr 10 # copy count into CTR
53 beq 0,Leven # branch if even # of limbs (# of limbs >= 2)
54
55# We have an odd # of limbs. Add the first limbs separately.
56 cmpi 1,10,0 # is count for unrolled loop zero?
57 bne 1,L1 # branch if not
58 st 7,4(3)
59 sfe 3,0,0 # load !cy into ...
60 sfi 3,3,0 # ... return value register
61 br # return
62
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
65 lu 0,4(5) # load s2 limb and update s2_ptr
66 stu 7,4(3)
67 sfe 7,0,8 # subtract limbs, set cy
68Leven: lu 9,4(4) # load s1 limb and update s1_ptr
69 lu 10,4(5) # load s2 limb and update s2_ptr
70 bdz Lend # If done, skip loop
71
72Loop: lu 8,4(4) # load s1 limb and update s1_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
75 stu 7,4(3) #
76 lu 9,4(4) # load s1 limb and update s1_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
79 stu 11,4(3) #
80 bdn Loop # decrement CTR and loop back
81
82Lend: sfe 11,10,9 # subtract limbs with cy, set cy
83 st 7,4(3) #
84 st 11,8(3) #
85 sfe 3,0,0 # load !cy into ...
86 sfi 3,3,0 # ... return value register
87 br
88