1 dnl AMD64 mpn_sec_tabselect.
3 dnl Contributed to the GNU project by Torbjörn Granlund.
5 dnl Copyright
2011-2013 Free Software Foundation
, Inc.
7 dnl
This file is part of the GNU MP Library.
9 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
10 dnl it under the terms of
either:
12 dnl
* the GNU Lesser General
Public License as published by the Free
13 dnl Software Foundation
; either version 3 of the License, or (at your
14 dnl option
) any later version.
18 dnl
* the GNU General
Public License as published by the Free Software
19 dnl Foundation
; either version 2 of the License, or (at your option) any
22 dnl
or both
in parallel
, as here.
24 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
25 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
26 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
29 dnl You should have received copies of the GNU General
Public License
and the
30 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
31 dnl see
https://www.gnu.
org/licenses
/.
33 include(`..
/config.m4
')
36 C cycles/limb good for cpu
49 C * This has not been tuned for any specific processor. Its speed should not
51 C * Using SSE2/AVX2 could result in many-fold speedup.
52 C * WORKS FOR n mod 4 = 0 ONLY!
54 C mpn_sec_tabselect (mp_limb_t *rp, mp_limb_t *tp, mp_size_t n, mp_size_t nents, mp_size_t which)
58 define(`nents', `
%rcx
')
59 define(`which', `
%r8
')
64 C rax rbx rcx rdx rdi rsi rbp r8 r9 r10 r11 r12 r13 r14 r15
65 C nents n rp tab i which j * * * * * *
73 PROLOGUE(mpn_sec_tabselect)
75 IFDOS(` mov 56(%rsp), %r8d ')
91 xor R32
(%r12
), R32
(%r12
)
92 xor R32
(%r13
), R32
(%r13
)
93 xor R32
(%r14
), R32
(%r14
)
94 xor R32
(%r15
), R32
(%r15
)
131 xor R32
(%r12
), R32
(%r12
)
132 xor R32
(%r13
), R32
(%r13
)
152 L
(b0x
): test $1, R8
(n
)
155 xor R32
(%r12
), R32
(%r12
)