1dnl  Alpha mpn_copyi -- copy, incrementing.
2
3dnl  Copyright 2002, 2003 Free Software Foundation, Inc.
4
5dnl  This file is part of the GNU MP Library.
6
7dnl  The GNU MP Library is free software; you can redistribute it and/or modify
8dnl  it under the terms of the GNU Lesser General Public License as published
9dnl  by the Free Software Foundation; either version 3 of the License, or (at
10dnl  your option) any later version.
11
12dnl  The GNU MP Library is distributed in the hope that it will be useful, but
13dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15dnl  License for more details.
16
17dnl  You should have received a copy of the GNU Lesser General Public License
18dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
19
20include(`../config.m4')
21
22C      cycles/limb
23C EV4:     4
24C EV5:     1.75
25C EV6:     1
26
27C INPUT PARAMETERS
28C rp	r16
29C up	r17
30C n	r18
31
32
33ASM_START()
34PROLOGUE(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
74EPILOGUE(mpn_copyi)
75ASM_END()
76