Tizen 2.1 base
[external/gmp.git] / mpn / pa32 / lshift.asm
1 dnl  HP-PA  mpn_lshift -- Shift a number left.
2
3 dnl  Copyright 1992, 1994, 2000, 2001, 2002 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 INPUT PARAMETERS
23 C res_ptr       gr26
24 C s_ptr         gr25
25 C size          gr24
26 C cnt           gr23
27
28 ASM_START()
29 PROLOGUE(mpn_lshift)
30         sh2add          %r24,%r25,%r25
31         sh2add          %r24,%r26,%r26
32         ldws,mb         -4(0,%r25),%r22
33         subi            32,%r23,%r1
34         mtsar           %r1
35         addib,=         -1,%r24,L(0004)
36         vshd            %r0,%r22,%r28           C compute carry out limb
37         ldws,mb         -4(0,%r25),%r29
38         addib,=         -1,%r24,L(0002)
39         vshd            %r22,%r29,%r20
40
41 LDEF(loop)
42         ldws,mb         -4(0,%r25),%r22
43         stws,mb         %r20,-4(0,%r26)
44         addib,=         -1,%r24,L(0003)
45         vshd            %r29,%r22,%r20
46         ldws,mb         -4(0,%r25),%r29
47         stws,mb         %r20,-4(0,%r26)
48         addib,<>        -1,%r24,L(loop)
49         vshd            %r22,%r29,%r20
50
51 LDEF(0002)
52         stws,mb         %r20,-4(0,%r26)
53         vshd            %r29,%r0,%r20
54         bv              0(%r2)
55         stw             %r20,-4(0,%r26)
56
57 LDEF(0003)
58         stws,mb         %r20,-4(0,%r26)
59
60 LDEF(0004)
61         vshd            %r22,%r0,%r20
62         bv              0(%r2)
63         stw             %r20,-4(0,%r26)
64 EPILOGUE()