1 dnl PowerPC
-64 mpn_rsh1add_n
, mpn_rsh1sub_n
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
')
45 ifdef(`OPERATION_rsh1add_n', `
46 define
(`ADDSUBC
', `addc')
47 define
(`ADDSUBE
', `adde')
48 define
(INITCY
, `addic
$1, r1
, 0')
49 define(`func', mpn_rsh1add_n
)')
50 ifdef(`OPERATION_rsh1sub_n', `
51 define
(`ADDSUBC
', `subfc')
52 define
(`ADDSUBE
', `subfe')
53 define
(INITCY
, `addic
$1, r1
, -1')
54 define(`func', mpn_rsh1sub_n
)')
63 MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1sub_n)
74 mtctr r0 C copy size to count register
79 L(bx0): ADDSUBC x1, v0, u0
87 rldicl r11, x1, 0, 63 C return value
91 L(b00): addi rp, rp, -24
93 L(b10): addi up, up, 16
99 L(bx1): ADDSUBC x0, v0, u0
107 rldicl r11, x0, 0, 63 C return value
111 L(b01): addi up, up, 8
115 L(b11): addi up, up, 24
132 L(lo1): ld u0, 16(up)
138 L(lo0): ld u0, 24(up)
149 L(end): srdi s0, x1, 1
152 L(cj2): srdi s1, x0, 1
155 L(cj1): ADDSUBE x1, x1, x1 C pseudo-depends on x1
161 L(n1): srdi s1, x0, 1
162 rldicl r11, x0, 0, 63 C return value
163 ADDSUBE x1, x1, x1 C pseudo-depends on x1
169 L(n2): addi rp, rp, -8
171 rldicl r11, x1, 0, 63 C return value