2
* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
3
* Copyright (C) 1998 Free Software Foundation, Inc.
5
* This file is part of GNUPG.
7
* GNUPG is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* GNUPG is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21
* Note: This code is heavily based on the GNU MP Library.
22
* Actually it's the same code with only minor changes in the
23
* way the data is stored; this is to support the abstraction
24
* of an optional secure memory allocation which may be used
25
* to avoid revealing of sensitive data due to paging etc.
26
* The GNU MP Library itself is published under the LGPL;
27
* however I decided to publish this code under the plain GPL.
34
* mpihelp_lshift( mpi_ptr_t wp, (gr26)
35
* mpi_ptr_t up, (gr25)
36
* mpi_size_t usize, (gr24)
37
* unsigned cnt) (gr23)
41
.export mpihelp_lshift
44
.callinfo frame=64,no_calls
49
ldws,mb -4(0,%r25),%r22
52
addib,= -1,%r24,L$0004
53
vshd %r0,%r22,%r28 ; compute carry out limb
54
ldws,mb -4(0,%r25),%r29
55
addib,= -1,%r24,L$0002
58
L$loop ldws,mb -4(0,%r25),%r22
59
stws,mb %r20,-4(0,%r26)
60
addib,= -1,%r24,L$0003
62
ldws,mb -4(0,%r25),%r29
63
stws,mb %r20,-4(0,%r26)
64
addib,<> -1,%r24,L$loop
67
L$0002 stws,mb %r20,-4(0,%r26)
71
L$0003 stws,mb %r20,-4(0,%r26)
72
L$0004 vshd %r22,%r0,%r20
83
* mpihelp_rshift( mpi_ptr_t wp, (gr26)
84
* mpi_ptr_t up, (gr25)
85
* mpi_size_t usize, (gr24)
86
* unsigned cnt) (gr23)
90
.export mpihelp_rshift
93
.callinfo frame=64,no_calls
96
ldws,ma 4(0,%r25),%r22
98
addib,= -1,%r24,L$r004
99
vshd %r22,%r0,%r28 ; compute carry out limb
100
ldws,ma 4(0,%r25),%r29
101
addib,= -1,%r24,L$r002
104
L$roop ldws,ma 4(0,%r25),%r22
105
stws,ma %r20,4(0,%r26)
106
addib,= -1,%r24,L$r003
108
ldws,ma 4(0,%r25),%r29
109
stws,ma %r20,4(0,%r26)
110
addib,<> -1,%r24,L$roop
113
L$r002 stws,ma %r20,4(0,%r26)
117
L$r003 stws,ma %r20,4(0,%r26)
118
L$r004 vshd %r0,%r22,%r20