github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpn/arm64/mul_1.asm (about) 1 dnl ARM64 mpn_mul_1 2 3 dnl Contributed to the GNU project by Torbjörn Granlund. 4 5 dnl Copyright 2013 Free Software Foundation, Inc. 6 7 dnl This file is part of the GNU MP Library. 8 dnl 9 dnl The GNU MP Library is free software; you can redistribute it and/or modify 10 dnl it under the terms of either: 11 dnl 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. 15 dnl 16 dnl or 17 dnl 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 20 dnl later version. 21 dnl 22 dnl or both in parallel, as here. 23 dnl 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 27 dnl for more details. 28 dnl 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/. 32 33 include(`../config.m4') 34 35 C cycles/limb 36 C Cortex-A53 ? 37 C Cortex-A57 ? 38 39 define(`rp', `x0') 40 define(`up', `x1') 41 define(`n', `x2') 42 define(`v0', `x3') 43 44 ASM_START() 45 PROLOGUE(mpn_mul_1) 46 ldr x12, [up], #8 47 and x6, n, #3 48 and n, n, #-4 49 cbz x6, L(fi0) 50 cmp x6, #2 51 b.cc L(fi1) 52 b.eq L(fi2) 53 54 L(fi3): mul x8, x12, v0 55 umulh x13, x12, v0 56 cmn xzr, xzr 57 b L(L3) 58 L(fi2): mul x7, x12, v0 59 umulh x5, x12, v0 60 cmn xzr, xzr 61 b L(L2) 62 L(fi0): mul x9, x12, v0 63 umulh x5, x12, v0 64 sub n, n, #4 65 cmn xzr, xzr 66 b L(L0) 67 L(fi1): mul x10, x12, v0 68 umulh x13, x12, v0 69 cmn xzr, xzr 70 cbz n, L(end) 71 72 L(top): sub n, n, #4 73 ldr x12, [up], #8 74 mul x6, x12, v0 75 umulh x5, x12, v0 76 str x10, [rp], #8 77 adcs x9, x6, x13 78 L(L0): ldr x12, [up], #8 79 mul x6, x12, v0 80 umulh x13, x12, v0 81 str x9, [rp] ,#8 82 adcs x8, x6, x5 83 L(L3): ldr x12, [up], #8 84 mul x6, x12, v0 85 umulh x5, x12, v0 86 str x8, [rp], #8 87 adcs x7, x6, x13 88 L(L2): ldr x12, [up], #8 89 mul x6, x12, v0 90 umulh x13, x12, v0 91 str x7, [rp], #8 92 adcs x10, x6, x5 93 cbnz n, L(top) 94 95 L(end): str x10, [rp] 96 adc x0, x13, xzr 97 ret 98 EPILOGUE()