Annotation of OpenXM_contrib/gmp/mpn/pa32/hppa1_1/pa7100/lshift.asm, Revision 1.1.1.1
1.1 ohara 1: dnl HP-PA mpn_lshift -- Shift a number left.
2: dnl Optimized for the PA7100, where is runs at 3.25 cycles/limb.
3:
4: dnl Copyright 1992, 1994, 2000, 2001, 2002 Free Software Foundation, Inc.
5:
6: dnl This file is part of the GNU MP Library.
7:
8: dnl The GNU MP Library is free software; you can redistribute it and/or modify
9: dnl it under the terms of the GNU Lesser General Public License as published
10: dnl by the Free Software Foundation; either version 2.1 of the License, or (at
11: dnl your option) any later version.
12:
13: dnl The GNU MP Library is distributed in the hope that it will be useful, but
14: dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15: dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16: dnl License for more details.
17:
18: dnl You should have received a copy of the GNU Lesser General Public License
19: dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20: dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21: dnl MA 02111-1307, USA.
22:
23: include(`../config.m4')
24:
25: C INPUT PARAMETERS
26: C res_ptr r26
27: C s_ptr r25
28: C size r24
29: C cnt r23
30:
31: ASM_START()
32: PROLOGUE(mpn_lshift)
33: sh2add %r24,%r25,%r25
34: sh2add %r24,%r26,%r26
35: ldws,mb -4(0,%r25),%r22
36: subi 32,%r23,%r1
37: mtsar %r1
38: addib,= -1,%r24,L(0004)
39: vshd %r0,%r22,%r28 C compute carry out limb
40: ldws,mb -4(0,%r25),%r29
41: addib,<= -5,%r24,L(rest)
42: vshd %r22,%r29,%r20
43:
44: .label L(loop)
45: ldws,mb -4(0,%r25),%r22
46: stws,mb %r20,-4(0,%r26)
47: vshd %r29,%r22,%r20
48: ldws,mb -4(0,%r25),%r29
49: stws,mb %r20,-4(0,%r26)
50: vshd %r22,%r29,%r20
51: ldws,mb -4(0,%r25),%r22
52: stws,mb %r20,-4(0,%r26)
53: vshd %r29,%r22,%r20
54: ldws,mb -4(0,%r25),%r29
55: stws,mb %r20,-4(0,%r26)
56: addib,> -4,%r24,L(loop)
57: vshd %r22,%r29,%r20
58:
59: .label L(rest)
60: addib,= 4,%r24,L(end1)
61: nop
62:
63: .label L(eloop)
64: ldws,mb -4(0,%r25),%r22
65: stws,mb %r20,-4(0,%r26)
66: addib,<= -1,%r24,L(end2)
67: vshd %r29,%r22,%r20
68: ldws,mb -4(0,%r25),%r29
69: stws,mb %r20,-4(0,%r26)
70: addib,> -1,%r24,L(eloop)
71: vshd %r22,%r29,%r20
72:
73: .label L(end1)
74: stws,mb %r20,-4(0,%r26)
75: vshd %r29,%r0,%r20
76: bv 0(%r2)
77: stw %r20,-4(0,%r26)
78:
79: .label L(end2)
80: stws,mb %r20,-4(0,%r26)
81:
82: .label L(0004)
83: vshd %r22,%r0,%r20
84: bv 0(%r2)
85: stw %r20,-4(0,%r26)
86: EPILOGUE()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>