Switched to GPLv3.
[gnupg.git] / mpi / pa7100 / mpih-lshift.S
1 /* hppa   lshift
2  *        optimized for the PA7100, where it runs at 3.25 cycles/limb
3  * 
4  *      Copyright (C) 1992, 1994, 1998, 
5  *                    2001 Free Software Foundation, Inc.
6  *
7  * This file is part of GnuPG.
8  *
9  * GnuPG is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * GnuPG is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22
23
24
25 /*******************
26  * mpi_limb_t
27  * mpihelp_lshift( mpi_ptr_t wp,        (gr26)
28  *                 mpi_ptr_t up,        (gr25)
29  *                 mpi_size_t usize,    (gr24)
30  *                 unsigned cnt)        (gr23)
31  */
32
33         .code
34         .export         mpihelp_lshift
35         .label          mpihelp_lshift
36         .proc
37         .callinfo       frame=64,no_calls
38         .entry
39
40         sh2add          %r24,%r25,%r25
41         sh2add          %r24,%r26,%r26
42         ldws,mb         -4(0,%r25),%r22
43         subi            32,%r23,%r1
44         mtsar           %r1
45         addib,=         -1,%r24,L$0004
46         vshd            %r0,%r22,%r28           ; compute carry out limb
47         ldws,mb         -4(0,%r25),%r29
48         addib,<=        -5,%r24,L$rest
49         vshd            %r22,%r29,%r20
50
51         .label  L$loop
52         ldws,mb         -4(0,%r25),%r22
53         stws,mb         %r20,-4(0,%r26)
54         vshd            %r29,%r22,%r20
55         ldws,mb         -4(0,%r25),%r29
56         stws,mb         %r20,-4(0,%r26)
57         vshd            %r22,%r29,%r20
58         ldws,mb         -4(0,%r25),%r22
59         stws,mb         %r20,-4(0,%r26)
60         vshd            %r29,%r22,%r20
61         ldws,mb         -4(0,%r25),%r29
62         stws,mb         %r20,-4(0,%r26)
63         addib,>         -4,%r24,L$loop
64         vshd            %r22,%r29,%r20
65
66         .label  L$rest
67         addib,=         4,%r24,L$end1
68         nop
69         .label  L$eloop
70         ldws,mb         -4(0,%r25),%r22
71         stws,mb         %r20,-4(0,%r26)
72         addib,<=        -1,%r24,L$end2
73         vshd            %r29,%r22,%r20
74         ldws,mb         -4(0,%r25),%r29
75         stws,mb         %r20,-4(0,%r26)
76         addib,>         -1,%r24,L$eloop
77         vshd            %r22,%r29,%r20
78
79         .label  L$end1
80         stws,mb         %r20,-4(0,%r26)
81         vshd            %r29,%r0,%r20
82         bv              0(%r2)
83         stw             %r20,-4(0,%r26)
84         .label  L$end2
85         stws,mb         %r20,-4(0,%r26)
86         .label  L$0004
87         vshd            %r22,%r0,%r20
88         bv              0(%r2)
89         stw             %r20,-4(0,%r26)
90
91         .exit
92         .procend
93
94
95