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