1 dnl PowerPC
-32 mpn_rshift
-- Shift a number right.
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?
52 addi r7, r3, -4 C dst-4
53 bgt L(BIG) C branch if more than 12 limbs
55 mtctr r5 C copy size into CTR
57 lwz r11, 0(r4) C load first s1 limb
58 slw r3, r11, r8 C compute function return value
61 L(oop): lwzu r10, 4(r4)
85 stmw r24, 8(r1) C save registers we are supposed to preserve
88 slw r3, r9, r8 C compute function return value
92 andi. r10, r5, 3 C count for spill loop
105 bdnz L(loop0) C taken at most once!
107 L(xe0): srw r12, r28, r6
113 L(e): srwi r5, r5, 2 C count for unrolled loop
163 lmw r24, 8(r1) C restore registers