Upload Tizen:Base source
[external/gmp.git] / mpn / alpha / copyi.asm
1 dnl  Alpha mpn_copyi -- copy, incrementing.
2
3 dnl  Copyright 2002, 2003 Free Software Foundation, Inc.
4
5 dnl  This file is part of the GNU MP Library.
6
7 dnl  The GNU MP Library is free software; you can redistribute it and/or modify
8 dnl  it under the terms of the GNU Lesser General Public License as published
9 dnl  by the Free Software Foundation; either version 3 of the License, or (at
10 dnl  your option) any later version.
11
12 dnl  The GNU MP Library is distributed in the hope that it will be useful, but
13 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15 dnl  License for more details.
16
17 dnl  You should have received a copy of the GNU Lesser General Public License
18 dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
19
20 include(`../config.m4')
21
22 C      cycles/limb
23 C EV4:     4
24 C EV5:     1.75
25 C EV6:     1
26
27 C INPUT PARAMETERS
28 C rp    r16
29 C up    r17
30 C n     r18
31
32
33 ASM_START()
34 PROLOGUE(mpn_copyi)
35         lda     r18,-8(r18)             C E0
36         blt     r18,$Lend               C E1
37 $Loop:  ldq     r0,0(r17)               C E0
38         ldq     r1,8(r17)               C E1
39         ldq     r2,16(r17)              C E0
40         ldq     r3,24(r17)              C E1
41         ldq     r4,32(r17)              C E0
42         ldq     r5,40(r17)              C E1
43         ldq     r6,48(r17)              C E0
44         ldq     r7,56(r17)              C E1
45         stq     r0,0(r16)               C E0
46         lda     r17,64(r17)             C E1
47         stq     r1,8(r16)               C E0
48         bis     r31, r31, r31           C E1
49         stq     r2,16(r16)              C E0
50         lda     r18,-8(r18)             C E1
51         stq     r3,24(r16)              C E0
52         bis     r31, r31, r31           C E1
53         stq     r4,32(r16)              C E0
54         bis     r31, r31, r31           C E1
55         stq     r5,40(r16)              C E0
56         bis     r31, r31, r31           C E1
57         stq     r6,48(r16)              C E0
58         bis     r31, r31, r31           C E1
59         stq     r7,56(r16)              C E0
60         lda     r16,64(r16)             C E1
61         bge     r18,$Loop               C E1
62 $Lend:  lda     r18,7(r18)              C E0
63         blt     r18,$Lret               C E1
64         ldq     r0,0(r17)               C E0
65         beq     r18,$Lend0              C E1
66 $Loop0: stq     r0,0(r16)               C E0
67         lda     r16,8(r16)              C E1
68         ldq     r0,8(r17)               C E0
69         lda     r18,-1(r18)             C E1
70         lda     r17,8(r17)              C E0
71         bgt     r18,$Loop0              C E1
72 $Lend0: stq     r0,0(r16)               C E0
73 $Lret:  ret     r31,(r26),1             C E1
74 EPILOGUE(mpn_copyi)
75 ASM_END()