1 dnl SPARC mpn_rshift -- Shift a number right.
3 dnl Copyright (C) 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 2.1 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; see the file COPYING.LIB. If not, write to
19 dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 dnl MA 02111-1307, USA.
23 include(`../config.m4')
33 ld [%o1],%g2 C load first limb
34 sub %g0,%o3,%o5 C negate shift count
36 andcc %o2,4-1,%g4 C number of limbs in first loop
37 sll %g2,%o5,%g1 C compute function result
38 be L(0) C if multiple of 4 limbs, skip first loop
41 sub %o2,%g4,%o2 C adjust count for main loop
89 L(end): srl %g2,%o3,%g2