3
* Copyright (C) 1995, 1996, 1998,
4
* 2001, 2002 Free Software Foundation, Inc.
6
* This file is part of Libgcrypt.
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.
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.
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
34
.global C_SYMBOL_NAME(_gcry_mpih_lshift)
35
C_SYMBOL_NAME(_gcry_mpih_lshift):
37
add %o1,%g1,%o1 ! make %o1 point at end of src
38
ld [%o1-4],%g2 ! load first limb
39
sub %g0,%o3,%o5 ! negate shift count
40
add %o0,%g1,%o0 ! make %o0 point at end of res
42
andcc %o2,4-1,%g4 ! number of limbs in first loop
43
srl %g2,%o5,%g1 ! compute function result
44
be L0 ! if multiple of 4 limbs, skip first loop
47
sub %o2,%g4,%o2 ! adjust count for main loop