Upload Tizen:Base source
[external/gmp.git] / mpn / pa32 / hppa1_1 / pa7100 / sub_n.asm
1 dnl  HP-PA mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
2 dnl  store difference in a third limb vector.  Optimized for the PA7100, where
3 dnl  is runs at 4.25 cycles/limb.
4
5 dnl  Copyright 1992, 1994, 2000, 2001, 2002, 2003 Free Software Foundation,
6 dnl  Inc.
7
8 dnl  This file is part of the GNU MP Library.
9
10 dnl  The GNU MP Library is free software; you can redistribute it and/or modify
11 dnl  it under the terms of the GNU Lesser General Public License as published
12 dnl  by the Free Software Foundation; either version 3 of the License, or (at
13 dnl  your option) any later version.
14
15 dnl  The GNU MP Library is distributed in the hope that it will be useful, but
16 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
18 dnl  License for more details.
19
20 dnl  You should have received a copy of the GNU Lesser General Public License
21 dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
22
23 include(`../config.m4')
24
25 C INPUT PARAMETERS
26 C res_ptr       r26
27 C s1_ptr        r25
28 C s2_ptr        r24
29 C size          r23
30
31 ASM_START()
32 PROLOGUE(mpn_sub_n)
33         ldws,ma         4(0,%r25),%r20
34         ldws,ma         4(0,%r24),%r19
35
36         addib,<=        -5,%r23,L(rest)
37          sub            %r20,%r19,%r28  C subtract first limbs ignoring cy
38
39 LDEF(loop)
40         ldws,ma         4(0,%r25),%r20
41         ldws,ma         4(0,%r24),%r19
42         stws,ma         %r28,4(0,%r26)
43         subb            %r20,%r19,%r28
44         ldws,ma         4(0,%r25),%r20
45         ldws,ma         4(0,%r24),%r19
46         stws,ma         %r28,4(0,%r26)
47         subb            %r20,%r19,%r28
48         ldws,ma         4(0,%r25),%r20
49         ldws,ma         4(0,%r24),%r19
50         stws,ma         %r28,4(0,%r26)
51         subb            %r20,%r19,%r28
52         ldws,ma         4(0,%r25),%r20
53         ldws,ma         4(0,%r24),%r19
54         stws,ma         %r28,4(0,%r26)
55         addib,>         -4,%r23,L(loop)
56         subb            %r20,%r19,%r28
57
58 LDEF(rest)
59         addib,=         4,%r23,L(end)
60         nop
61
62 LDEF(eloop)
63         ldws,ma         4(0,%r25),%r20
64         ldws,ma         4(0,%r24),%r19
65         stws,ma         %r28,4(0,%r26)
66         addib,>         -1,%r23,L(eloop)
67         subb            %r20,%r19,%r28
68
69 LDEF(end)
70         stws            %r28,0(0,%r26)
71         addc            %r0,%r0,%r28
72         bv              0(%r2)
73          subi           1,%r28,%r28
74 EPILOGUE()