1 /* Shift a limb left, low level routine.
2 Copyright (C) 1996-2015 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
21 /* mp_limb_t mpn_lshift (mp_ptr wp, mp_srcptr up, mp_size_t usize,
24 EALIGN (__mpn_lshift, 3, 0)
26 mtctr r5 # copy size into CTR
27 cmplwi cr0,r5,16 # is size < 16
29 add r7,r3,r0 # make r7 point at end of res
30 add r4,r4,r0 # make r4 point at end of s1
31 lwzu r11,-4(r4) # load first s1 limb
33 srw r3,r11,r8 # compute function return value
34 bge cr0,L(big) # branch if size >= 16
56 /* Guaranteed not to succeed. */
59 /* We imitate a case statement, by using (yuk!) fixed-length code chunks,
60 of size 4*12 bytes. We have to do this (or something) to make this PIC. */
63 bltl- cr0,L(boom) # Never taken, only used to set LR.
79 #define DO_LSHIFT(n) \
81 L(n): lwzu r10,-4(r4); \
83 inslwi r9,r10,n,32-n; \
88 inslwi r9,r11,n,32-n; \