1 dnl ARM64 mpn_mod_34lsub1
-- remainder modulo
2^
48-1.
3 dnl Copyright
2012-2014 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
')
42 C mp_limb_t mpn_mod_34lsub1 (mp_srcptr up, mp_size_t n)
45 C * An alternative inner loop which could run at 0.722 c/l:
48 C ldp x2, x3, [ap, #-32]
52 C ldp x4, x5, [ap, #-16]
56 C ldp x6, x7, [ap], #48
63 PROLOGUE(mpn_mod_34lsub1)
73 cmn x0, #0 C clear carry
75 L(top): ldp x5, x6, [ap, #0]
84 adc x8, xzr, xzr C x8 <= 1
96 adc x8, x8, xzr C x8 <= 2
99 and x0, x2, #0xffffffffffff
100 add x0, x0, x2, lsr #48
104 and x1, x8, #0xffffffffffff
106 add x0, x0, x3, lsr #32
109 and x1, x8, #0xffffffffffff
111 add x0, x0, x4, lsr #16
120 and x0, x2, #0xffffffffffff
121 add x0, x0, x2, lsr #48