1 dnl PowerPC
-64 mpn_lshift
-- rp
[] = up
[] << cnt
3 dnl Copyright
2003, 2005, 2010, 2013 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
')
40 C * Micro-optimise header code
41 C * Perhaps do 4-way unrolling, for 2.5 c/l on POWER6. The code is 4236
42 C bytes, 4-way code would become about 50% larger.
45 define(`rp_param', `r3
')
55 PROLOGUE(mpn_lshift,toc)
57 ifdef(`HAVE_ABI_mode32',`
58 rldicl n
, n
, 0,32 C
FIXME: avoid
this zero extend
62 sldi r10, cnt, 6 C multiply cnt by size of a SHIFT block
63 LEAL( r11, L(e1)) C address of L(e1) label in SHIFT(1)
64 add up, up, r8 C make up point at end of up[]
65 add r11, r11, r10 C address of L(oN) for N = cnt
67 add rp, rp_param, r8 C make rp point at end of rp[]
69 rlwinm. r8, n, 0,31,31 C extract bit 0
74 cmpdi cr0, n, 1 C n = 1?
77 addi r11, r11, -84 C L(o1) - L(e1) - 64
79 srd r3, r9, tnc C retval
88 srd r3, r8, tnc C retval
91 L(1): srd r3, r9, tnc C retval
95 ifdef(`HAVE_ABI_mode32',
103 L(lo$1):ld r8, -24(up)
106 L(o$1): srdi r10, r8, eval(64-$1)
107 rldimi r10, r9, $1, 0
111 L(e$1): srdi r11, r9, eval(64-$1)
112 rldimi r11, r8, $1, 0
122 forloop
(`i
',1,63,`SHIFT(i)')
124 L
(com
): std r10
, -16(rp
)
126 ifdef
(`HAVE_ABI_mode32
',