1 dnl PowerPC
-64 mpn_and_n
, mpn_andn_n
, mpn_nand_n
, mpn_ior_n
, mpn_iorn_n
,
2 dnl mpn_nior_n
, mpn_xor_n
, mpn_xnor_n
-- mpn bitwise logical operations.
4 dnl Copyright
2003-2005 Free Software Foundation
, Inc.
6 dnl
This file is part of the GNU MP Library.
8 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
9 dnl it under the terms of
either:
11 dnl
* the GNU Lesser General
Public License as published by the Free
12 dnl Software Foundation
; either version 3 of the License, or (at your
13 dnl option
) any later version.
17 dnl
* the GNU General
Public License as published by the Free Software
18 dnl Foundation
; either version 2 of the License, or (at your option) any
21 dnl
or both
in parallel
, as here.
23 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
24 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
25 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
28 dnl You should have received copies of the GNU General
Public License
and the
29 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
30 dnl see
https://www.gnu.
org/licenses
/.
32 include(`..
/config.m4
')
41 C n POWER3/PPC630 POWER4/PPC970
69 ifdef(`OPERATION_and_n',
70 ` define
(`func
',`mpn_and_n')
71 define
(`logop
', `and')')
72 ifdef(`OPERATION_andn_n',
73 ` define
(`func
',`mpn_andn_n')
74 define
(`logop
', `andc')')
75 ifdef(`OPERATION_nand_n',
76 ` define
(`func
',`mpn_nand_n')
77 define
(`logop
', `nand')')
78 ifdef(`OPERATION_ior_n',
79 ` define
(`func
',`mpn_ior_n')
80 define
(`logop
', `or')')
81 ifdef(`OPERATION_iorn_n',
82 ` define
(`func
',`mpn_iorn_n')
83 define
(`logop
', `orc')')
84 ifdef(`OPERATION_nior_n',
85 ` define
(`func
',`mpn_nior_n')
86 define
(`logop
', `nor')')
87 ifdef(`OPERATION_xor_n',
88 ` define
(`func
',`mpn_xor_n')
89 define
(`logop
', `xor')')
90 ifdef(`OPERATION_xnor_n',
91 ` define
(`func
',`mpn_xnor_n')
92 define
(`logop
', `eqv')')
100 MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
104 ld r8, 0(r4) C read lowest u limb
105 ld r9, 0(r5) C read lowest v limb
106 addi r6, r6, 3 C compute branch count (1)
107 rldic. r0, r6, 3, 59 C r0 = (n-1 & 3) << 3; cr0 = (n == 4(t+1))?
108 cmpldi cr6, r0, 16 C cr6 = (n cmp 4t + 3)
110 ifdef(`HAVE_ABI_mode32',
111 ` rldicl r6
, r6
, 62,34', C ...branch count
112 ` rldicl r6, r6, 62, 2') C ...branch count
115 ld r6
, 0(r4
) C read lowest u limb
(again
)
116 ld r7
, 0(r5
) C read lowest v limb
(again
)
118 add r5
, r5
, r0 C
offset vp
119 add r4
, r4
, r0 C
offset up
120 add r3
, r3
, r0 C
offset rp
127 L
(oop
): ld r8
, -24(r4
)
131 L
(L00
): ld r6
, -16(r4
)
135 L
(L11
): ld r8
, -8(r4
)
143 L
(L01
): addi r5
, r5
, 32