1 dnl PowerPC
-32 mpn_lshift
-- Shift a number left.
3 dnl Copyright
1995, 1998, 2000, 2002-2005 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
either:
10 dnl
* the GNU Lesser General
Public License as published by the Free
11 dnl Software Foundation
; either version 3 of the License, or (at your
12 dnl option
) any later version.
16 dnl
* the GNU General
Public License as published by the Free Software
17 dnl Foundation
; either version 2 of the License, or (at your option) any
20 dnl
or both
in parallel
, as here.
22 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
23 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
24 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
27 dnl You should have received copies of the GNU General
Public License
and the
28 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
29 dnl see
https://www.gnu.
org/licenses
/.
31 include(`..
/config.m4
')
38 C 7445,7455 (G4+): 2.5
39 C 7447,7457 (G4+): 2.25
51 cmpwi cr0, r5, 30 C more than 30 limbs?
53 add r4, r4, r0 C make r4 point at end of s1
54 add r7, r3, r0 C make r7 point at end of res
55 bgt L(BIG) C branch if more than 12 limbs
57 mtctr r5 C copy size into CTR
59 lwzu r11, -4(r4) C load first s1 limb
60 srw r3, r11, r8 C compute function return value
63 L(oop): lwzu r10, -4(r4)
87 stmw r24, 8(r1) C save registers we are supposed to preserve
90 srw r3, r9, r8 C compute function return value
94 andi. r10, r5, 3 C count for spill loop
107 bdnz L(loop0) C taken at most once!
109 L(xe0): slw r12, r28, r6
115 L(e): srwi r5, r5, 2 C count for unrolled loop
165 lmw r24, 8(r1) C restore registers