1 dnl PowerPC-32 mpn_lshift -- Shift a number left.
3 dnl Copyright 1995, 1998, 2000, 2002, 2003, 2004, 2005 Free Software
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 3 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. If not, see http://www.gnu.org/licenses/.
21 include(`../config.m4')
28 C 7445,7455 (G4+): 2.5
29 C 7447,7457 (G4+): 2.25
41 cmpwi cr0, r5, 12 C more than 12 limbs?
43 add r4, r4, r0 C make r4 point at end of s1
44 add r7, r3, r0 C make r7 point at end of res
45 bgt L(BIG) C branch if more than 12 limbs
47 mtctr r5 C copy size into CTR
49 lwzu r11, -4(r4) C load first s1 limb
50 srw r3, r11, r8 C compute function return value
53 L(oop): lwzu r10, -4(r4)
76 stmw r24, -32(r1) C save registers we are supposed to preserve
79 srw r3, r9, r8 C compute function return value
83 andi. r10, r5, 3 C count for spill loop
96 bdnz L(loop0) C taken at most once!
98 L(xe0): slw r12, r28, r6
104 L(e): srwi r5, r5, 2 C count for unrolled loop
154 lmw r24, -32(r1) C restore registers