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