1dnl ARM mpn_copyd. 2 3dnl Copyright 2003, 2012 Free Software Foundation, Inc. 4 5dnl This file is part of the GNU MP Library. 6 7dnl The GNU MP Library is free software; you can redistribute it and/or modify 8dnl it under the terms of the GNU Lesser General Public License as published 9dnl by the Free Software Foundation; either version 3 of the License, or (at 10dnl your option) any later version. 11 12dnl The GNU MP Library is distributed in the hope that it will be useful, but 13dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 15dnl License for more details. 16 17dnl You should have received a copy of the GNU Lesser General Public License 18dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. 19 20include(`../config.m4') 21 22C cycles/limb 23C StrongARM ? 24C XScale ? 25C Cortex-A8 ? 26C Cortex-A9 1.5 27C Cortex-A15 ? 28 29define(`rp', `r0') 30define(`up', `r1') 31define(`n', `r2') 32 33ASM_START() 34PROLOGUE(mpn_copyd) 35 mov r12, n, lsl #2 36 sub r12, r12, #4 37 add rp, rp, r12 C make rp point at last limb 38 add up, up, r12 C make up point at last limb 39 40 tst n, #1 41 beq L(skip1) 42 ldr r3, [up], #-4 43 str r3, [rp], #-4 44L(skip1): 45 tst n, #2 46 beq L(skip2) 47 ldmda up!, { r3, r12 } C load 2 limbs 48 stmda rp!, { r3, r12 } C store 2 limbs 49L(skip2): 50 bics n, n, #3 51 beq L(rtn) 52 stmfd sp!, { r7, r8, r9 } C save regs on stack 53 54L(top): ldmda up!, { r3, r8, r9, r12 } C load 4 limbs 55 subs n, n, #4 56 stmda rp!, { r3, r8, r9, r12 } C store 4 limbs 57 bne L(top) 58 59 ldmfd sp!, { r7, r8, r9 } C restore regs from stack 60L(rtn): 61ifdef(`ARM_THUMB_MODE', 62` bx lr 63',` mov pc, lr 64') 65EPILOGUE() 66