1 dnl ARM v4 mpn_modexact_1c_odd
3 dnl Contributed to the GNU project by Torbjorn Granlund.
5 dnl Copyright
2012 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
')
35 C cycles/limb cycles/limb
36 C norm unorm modexact_1c_odd
44 C Architecture requirements:
62 PROLOGUE(mpn_divexact_1)
68 C count trailing zeros
82 L(inv): LEA( r4, binvert_limb_table)
84 ldrb r4, [r4, r12, lsr #1]
87 rsb r12, r12, r4, lsl #1
90 rsb r4, r4, r12, lsl #1 C r4 = inverse
93 ldr r5, [up], #4 C up[0]
98 subs n, n, #1 C set carry as side-effect
102 L(top): sbcs cy, r5, cy
111 L(end): sbc cy, r5, cy
120 subs n, n, #1 C set carry as side-effect
124 L(tpu): ldr r12, [up], #4
125 orr r9, r5, r12, lsl tnc
127 sbcs cy, r9, cy C critical path ->cy->cy->
129 mul r9, r4, cy C critical path ->cy->r9->
131 umull r12, cy, d, r9 C critical path ->r9->cy->
135 L(edu): sbc cy, r5, cy
144 .byte 8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
145 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
146 .byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
147 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
148 .byte 7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
149 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
150 .byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
151 .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0