aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S')
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/powerpc32/mpih-sub1.S266
1 files changed, 133 insertions, 133 deletions
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