1 dnl PowerPC
-64 mpn_mod_1_1p
3 dnl Copyright
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 * Optimise, in particular the cps function. This was compiler-generated and
42 C then hand optimised.
52 EXTERN_FUNC(mpn_invert_limb)
54 PROLOGUE(mpn_mod_1_1p)
58 ld r0, 16(r6) C B1modb
59 ld r12, 24(r6) C B2modb
70 L(top): ld r4, -24(r3)
84 ifdef(`HAVE_LIMB_LITTLE_ENDIAN',
94 L
(4): subfc r10
, r5
, r9
108 bge cr7
, L
(5) C
FIXME: Make branch
-less
110 L
(5): cmpld cr7
, r3
, r5
115 L
(10): subf r3
, r5
, r3
120 PROLOGUE
(mpn_mod_1_1p_cps
,toc
)
132 CALL( mpn_invert_limb
)
143 L
(13): mulhdu r9
, r0
, r3
151 L
(14): addi r1
, r1
, 144