1 dnl SPARC mpn_lshift -- Shift a number left.
3 dnl Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
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.
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.
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/.
21 include(`../config.m4')
32 add %o1,%g1,%o1 C make %o1 point at end of src
33 ld [%o1-4],%g2 C load first limb
34 sub %g0,%o3,%o5 C negate shift count
35 add %o0,%g1,%o0 C make %o0 point at end of res
37 andcc %o2,4-1,%g4 C number of limbs in first loop
38 srl %g2,%o5,%g1 C compute function result
39 be L(0) C if multiple of 4 limbs, skip first loop
42 sub %o2,%g4,%o2 C adjust count for main loop
90 L(end): sll %g2,%o3,%g2