1 dnl ARM mpn_submul_1 optimised for A15.
3 dnl Copyright
2012, 2013 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
')
39 C Cortex-A15 2.32 this
41 C This code uses umlal and umaal for adding in the rp[] data, keeping the
42 C recurrency path separate from any multiply instructions. It performs well on
43 C A15, but not quite at the multiply bandwidth like the corresponding addmul_1
46 C We don't use r12 due to ldrd
and strd limitations.
48 C
This loop complements U on the fly
,
51 C R - U*v = R + U'*v
+ v
- B^n v
53 C Architecture
requirements:
66 define
(`w0
', `r10') define
(`w1
', `r11')
67 define
(`u0
', `r8') define
(`u1
', `r9')
70 PROLOGUE
(mpn_submul_1
)
72 strd r10
, r11
, [sp, #
24]
73 strd r8
, r9
, [sp, #
16]
92 L
(b00
): ldrd u0
, u1
, [up
]
93 ldrd w0
, w1
, [rp
], #
-12
98 cmn r13
, #
0 C carry clear
103 L
(b10
): ldrd u0
, u1
, [up
], #
8
116 L
(b01
): ldr u1
, [up
], #
4
126 L
(top
): ldrd u0
, u1
, [up
, #
0]
129 ldrd w0
, w1
, [rp
, #
12]
132 umlal w0
, r6
, u0
, v0 C
1 2
135 strd r4
, r5
, [rp
, #
8]
136 L
(mid
): umaal w1
, r7
, u1
, v0 C
2 3
137 ldrd u0
, u1
, [up
, #
8]
141 ldrd w0
, w1
, [rp
, #
20]
144 umlal w0
, r4
, u0
, v0 C
3 4
147 strd r6
, r7
, [rp
, #
16]!
149 umlal w1
, r5
, u1
, v0 C
0 1
153 L
(end): adcs r4
, r4
, w1