1 dnl ARM64 Neon mpn_sec_tabselect.
3 dnl Contributed to the GNU project by Torbjörn Granlund.
5 dnl Copyright
2011-2014 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
')
41 C mpn_sec_tabselect (mp_ptr rp, mp_srcptr *tab,
42 C mp_size_t n, mp_size_t nents, mp_size_t which)
58 PROLOGUE(mpn_sec_tabselect)
59 dup v7.2d, x4 C 2 `which' copies
62 dup v6.2d
, x10 C
2 copies of
1
69 mov x12
, tp C preserve tp
70 movi v5.16b
, #
0 C zero
2 counter copies
74 L
(tp4
): cmeq maskq
.2d
, v5.2d
, v7.2d C compare idx copies to `which
' copies
75 ld1 {v0.2d,v1.2d}, [tp]
76 add v5.2d, v5.2d, v6.2d
77 bit v2.16b, v0.16b, maskq.16b
78 bit v3.16b, v1.16b, maskq.16b
82 st1 {v2.2d,v3.2d}, [rp], #32
83 add tp, x12, #32 C restore tp, point to next slice
91 movi v5.16b, #0 C zero 2 counter copies
94 L(tp2): cmeq maskq.2d, v5.2d, v7.2d
96 add v5.2d, v5.2d, v6.2d
97 bit v2.16b, v0.16b, maskq.16b
101 st1 {v2.2d}, [rp], #16
104 L(b0x): tbz n, #0, L(b00)
107 movi v5.16b, #0 C zero 2 counter copies
110 L(tp1): cmeq maskq.2d, v5.2d, v7.2d
112 add v5.2d, v5.2d, v6.2d C FIXME size should be `1d'
113 bit v2.8b
, v0.8b
, maskq
.8b
114 add tp
, tp
, n
, lsl #
3
117 st1
{v2.1d}, [rp
], #
8