1/* hppa   rshift
2 *
3 *      Copyright (C) 1992, 1994, 1998,
4 *                    2001, 2002 Free Software Foundation, Inc.
5 *
6 * This file is part of Libgcrypt.
7 *
8 * Libgcrypt is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * Libgcrypt is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 */
22
23
24
25
26/*******************
27 * mpi_limb_t
28 * _gcry_mpih_rshift( mpi_ptr_t wp,       (gr26)
29 *		   mpi_ptr_t up,       (gr25)
30 *		   mpi_size_t usize,   (gr24)
31 *		   unsigned cnt)       (gr23)
32 */
33
34	.code
35	.export 	_gcry_mpih_rshift
36	.label		_gcry_mpih_rshift
37	.proc
38	.callinfo	frame=64,no_calls
39	.entry
40
41	ldws,ma 	4(0,%r25),%r22
42	mtsar		%r23
43	addib,= 	-1,%r24,L$r004
44	vshd		%r22,%r0,%r28		; compute carry out limb
45	ldws,ma 	4(0,%r25),%r29
46	addib,= 	-1,%r24,L$r002
47	vshd		%r29,%r22,%r20
48
49	.label	L$roop
50	ldws,ma 	4(0,%r25),%r22
51	stws,ma 	%r20,4(0,%r26)
52	addib,= 	-1,%r24,L$r003
53	vshd		%r22,%r29,%r20
54	ldws,ma 	4(0,%r25),%r29
55	stws,ma 	%r20,4(0,%r26)
56	addib,<>	-1,%r24,L$roop
57	vshd		%r29,%r22,%r20
58
59	.label	L$r002
60	stws,ma 	%r20,4(0,%r26)
61	vshd		%r0,%r29,%r20
62	bv		0(%r2)
63	stw		%r20,0(0,%r26)
64	.label	L$r003
65	stws,ma 	%r20,4(0,%r26)
66	.label	L$r004
67	vshd		%r0,%r22,%r20
68	bv		0(%r2)
69	stw		%r20,0(0,%r26)
70
71	.exit
72	.procend
73
74