1
dnl SPARC mpn_lshift -- Shift a number left.
4
dnl Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
6
dnl This file is part of the GNU MP Library.
8
dnl The GNU MP Library is free software; you can redistribute it and/or modify
9
dnl it under the terms of the GNU Lesser General Public License as published
10
dnl by the Free Software Foundation; either version 2.1 of the License, or (at
11
dnl your option) any later version.
13
dnl The GNU MP Library is distributed in the hope that it will be useful, but
14
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16
dnl License for more details.
18
dnl You should have received a copy of the GNU Lesser General Public License
19
dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20
dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21
dnl MA 02111-1307, USA.
24
include(`../config.m4')
35
add %o1,%g1,%o1 C make %o1 point at end of src
36
ld [%o1-4],%g2 C load first limb
37
sub %g0,%o3,%o5 C negate shift count
38
add %o0,%g1,%o0 C make %o0 point at end of res
40
andcc %o2,4-1,%g4 C number of limbs in first loop
41
srl %g2,%o5,%g1 C compute function result
42
be L(0) C if multiple of 4 limbs, skip first loop
45
sub %o2,%g4,%o2 C adjust count for main loop
93
L(end): sll %g2,%o3,%g2