1 dnl PowerPC
-64 mpn_mod_34lsub1
-- modulo
2^
48-1.
3 dnl Copyright
2005 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 PROLOGUE(mpn_mod_34lsub1)
54 li r0, -0x5556 C 0xFFFFFFFFFFFFAAAA
55 rldimi r0, r0, 16, 32 C 0xFFFFFFFFAAAAAAAA
56 rldimi r0, r0, 32, 63 C 0xAAAAAAAAAAAAAAAB
58 srdi r0, r0, 1 C r0 = [n / 3]
68 L(top): addc r8, r8, r5
92 L(end): addc r8, r8, r5
98 add r5, r5, r0 C r11 = n / 3 * 3
99 sub n, n, r5 C n = n mod 3
100 L(lt3): cmpdi cr6, n, 1
109 L(1): adde r9, r9, r6
113 L(2): rldicl r0, r8, 0, 16 C r0 = r8 mod 2^48
114 srdi r3, r8, 48 C r3 = r8 div 2^48
115 rldic r4, r9, 16, 16 C r4 = (r9 mod 2^32) << 16
116 srdi r5, r9, 32 C r5 = r9 div 2^32
117 rldic r6, r10, 32, 16 C r6 = (r10 mod 2^16) << 32
118 srdi r7, r10, 16 C r7 = r10 div 2^16
131 C |__r10__|__r9___|__r8___|
132 C |-----|-----|-----|-----|