1 dnl PowerPC-32 mpn_rshift -- Shift a number right.
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?
42 addi r7, r3, -4 C dst-4
43 bgt L(BIG) C branch if more than 12 limbs
45 mtctr r5 C copy size into CTR
47 lwz r11, 0(r4) C load first s1 limb
48 slw r3, r11, r8 C compute function return value
51 L(oop): lwzu r10, 4(r4)
74 stmw r24, -32(r1) C save registers we are supposed to preserve
77 slw r3, r9, r8 C compute function return value
81 andi. r10, r5, 3 C count for spill loop
94 bdnz L(loop0) C taken at most once!
96 L(xe0): srw r12, r28, r6
102 L(e): srwi r5, r5, 2 C count for unrolled loop
152 lmw r24, -32(r1) C restore registers