1 dnl PowerPC
-64 mpn_rshift
-- rp
[] = up
[] >> cnt
3 dnl Copyright
2003, 2005, 2010, 2011 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
')
41 C * Try to reduce the number of needed live registers
42 C * Micro-optimise header code
43 C * Keep in synch with lshift.asm and lshiftc.asm
61 C sldi r30, n, 3 C byte count corresponding to n
62 C add rp, rp, r30 C rp = rp + n
63 C add up, up, r30 C up = up + n
64 rldicl. r30, n, 0,62 C r30 = n & 3, set cr0
66 addi r31, n, 3 C compute count...
67 ld r10, 0(up) C load 1st limb for b00...b11
69 ifdef(`HAVE_ABI_mode32',
70 ` rldicl r31
, r31
, 62,34', C ...branch count
71 ` srdi r31, r31, 2') C ...for ctr
72 mtctr r31 C copy count
into ctr
75 ld r11
, 8(up
) C load
2nd limb for b10
and b11
79 L
(b11
): srd r8
, r10
, cnt
102 L
(b10
): srd r12
, r10
, cnt
111 L
(gt2
): ld u0
, 16(up
)
137 L
(gt4
): addi up
, up
, 32
164 L
(top
): srd r12
, u0
, cnt
169 L
(L00
): srd r8
, u1
, cnt
174 L
(L11
): srd r12
, u0
, cnt
179 L
(L10
): srd r8
, u1
, cnt
189 L
(end): srd r12
, u0
, cnt
192 L
(cj4
): or r11
, r8
, r9
195 L
(cj3
): or r10
, r12
, r7
197 L
(cj2
): std r10
, 24(rp
)
200 L
(ret): ld r31
, -8(r1
)
202 ifdef
(`HAVE_ABI_mode32
',
203 ` srdi r3, retval, 32