1 dnl ARM 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 the GNU Lesser General Public License as published
11 dnl by the Free Software Foundation; either version 3 of the License, or (at
12 dnl your option) any later version.
14 dnl The GNU MP Library is distributed in the hope that it will be useful, but
15 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 dnl License for more details.
19 dnl You should have received a copy of the GNU Lesser General Public License
20 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
22 include(`../config.m4')
36 .protected binvert_limb_table
38 PROLOGUE(mpn_modexact_1c_odd)
41 LEA( r4, binvert_limb_table)
43 ldr r5, [up], #4 C up[0]
46 ldrb r4, [r4, r12, lsr #1]
49 rsb r12, r12, r4, asl #1
52 rsb r4, r4, r12, asl #1 C r4 = inverse
54 subs n, n, #1 C set carry as side-effect
57 L(top): sbcs cy, r5, cy
65 L(end): sbcs cy, r5, cy