1 dnl ARM mpn_cnd_add_n, mpn_cnd_sub_n
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')
49 ifdef(`OPERATION_cnd_add_n', `
50 define(`ADDSUB', adds)
51 define(`ADDSUBC', adcs)
52 define(`INITCY', `cmn r0, #0')
53 define(`RETVAL', `adc r0, n, #0')
54 define(func, mpn_cnd_add_n)')
55 ifdef(`OPERATION_cnd_sub_n', `
56 define(`ADDSUB', subs)
57 define(`ADDSUBC', sbcs)
58 define(`INITCY', `cmp r0, #0')
59 define(`RETVAL', `adc r0, n, #0
61 define(func, mpn_cnd_sub_n)')
63 MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
71 sbc cnd, cnd, cnd C conditionally set to 0xffffffff
73 INITCY C really only needed for n = 0 (mod 4)
81 L(b3): ldm vp!, {r4,r5,r6}
95 L(b2): ldm vp!, {r4,r5}
107 L(b1): ldr r4, [vp], #4
116 L(top): ldm vp!, {r4,r5,r6,r7}
117 ldm up!, {r8,r9,r10,r11}
127 stm rp!, {r8,r9,r10,r11}