1dnl ARM Neon mpn_copyi optimised for A15. 2 3dnl Copyright 2013 Free Software Foundation, Inc. 4 5dnl This file is part of the GNU MP Library. 6dnl 7dnl The GNU MP Library is free software; you can redistribute it and/or modify 8dnl it under the terms of either: 9dnl 10dnl * the GNU Lesser General Public License as published by the Free 11dnl Software Foundation; either version 3 of the License, or (at your 12dnl option) any later version. 13dnl 14dnl or 15dnl 16dnl * the GNU General Public License as published by the Free Software 17dnl Foundation; either version 2 of the License, or (at your option) any 18dnl later version. 19dnl 20dnl or both in parallel, as here. 21dnl 22dnl The GNU MP Library is distributed in the hope that it will be useful, but 23dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25dnl for more details. 26dnl 27dnl You should have received copies of the GNU General Public License and the 28dnl GNU Lesser General Public License along with the GNU MP Library. If not, 29dnl see https://www.gnu.org/licenses/. 30 31include(`../config.m4') 32 33C cycles/limb 34C StrongARM - 35C XScale - 36C Cortex-A7 ? 37C Cortex-A8 ? 38C Cortex-A9 1.75 slower than core register code 39C Cortex-A15 0.52 40 41define(`rp', `r0') 42define(`up', `r1') 43define(`n', `r2') 44 45ASM_START() 46PROLOGUE(mpn_copyi) 47 cmp n, #7 48 ble L(bc) 49 50C Copy until rp is 128-bit aligned 51 tst rp, #4 52 beq L(al1) 53 vld1.32 {d22[0]}, [up]! 54 sub n, n, #1 55 vst1.32 {d22[0]}, [rp]! 56L(al1): tst rp, #8 57 beq L(al2) 58 vld1.32 {d22}, [up]! 59 sub n, n, #2 60 vst1.32 {d22}, [rp:64]! 61L(al2): vld1.32 {d26-d27}, [up]! 62 subs n, n, #12 63 blt L(end) 64 65 ALIGN(16) 66L(top): vld1.32 {d22-d23}, [up]! 67 vst1.32 {d26-d27}, [rp:128]! 68 vld1.32 {d26-d27}, [up]! 69 vst1.32 {d22-d23}, [rp:128]! 70 subs n, n, #8 71 bge L(top) 72 73L(end): vst1.32 {d26-d27}, [rp:128]! 74 75C Copy last 0-7 limbs. Note that rp is aligned after loop, but not when we 76C arrive here via L(bc) 77L(bc): tst n, #4 78 beq L(tl1) 79 vld1.32 {d22-d23}, [up]! 80 vst1.32 {d22-d23}, [rp]! 81L(tl1): tst n, #2 82 beq L(tl2) 83 vld1.32 {d22}, [up]! 84 vst1.32 {d22}, [rp]! 85L(tl2): tst n, #1 86 beq L(tl3) 87 vld1.32 {d22[0]}, [up] 88 vst1.32 {d22[0]}, [rp] 89L(tl3): bx lr 90EPILOGUE() 91