|
Packit |
5c3484 |
dnl ARM64 mpn_and_n, mpn_andn_n. mpn_nand_n, etc.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Contributed to the GNU project by Torbjörn Granlund.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl Copyright 2013 Free Software Foundation, Inc.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
dnl This file is part of the GNU MP Library.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit |
5c3484 |
dnl it under the terms of either:
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU Lesser General Public License as published by the Free
|
|
Packit |
5c3484 |
dnl Software Foundation; either version 3 of the License, or (at your
|
|
Packit |
5c3484 |
dnl option) any later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl * the GNU General Public License as published by the Free Software
|
|
Packit |
5c3484 |
dnl Foundation; either version 2 of the License, or (at your option) any
|
|
Packit |
5c3484 |
dnl later version.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl or both in parallel, as here.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit |
5c3484 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit |
5c3484 |
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
Packit |
5c3484 |
dnl for more details.
|
|
Packit |
5c3484 |
dnl
|
|
Packit |
5c3484 |
dnl You should have received copies of the GNU General Public License and the
|
|
Packit |
5c3484 |
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
|
|
Packit |
5c3484 |
dnl see https://www.gnu.org/licenses/.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
include(`../config.m4')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
C cycles/limb
|
|
Packit |
5c3484 |
C Cortex-A53 ?
|
|
Packit |
5c3484 |
C Cortex-A57 ?
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
changecom(@&*$)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
define(`rp', `x0')
|
|
Packit |
5c3484 |
define(`up', `x1')
|
|
Packit |
5c3484 |
define(`vp', `x2')
|
|
Packit |
5c3484 |
define(`n', `x3')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
define(`POSTOP', `dnl')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ifdef(`OPERATION_and_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_and_n')
|
|
Packit |
5c3484 |
define(`LOGOP', `and $1, $2, $3')')
|
|
Packit |
5c3484 |
ifdef(`OPERATION_andn_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_andn_n')
|
|
Packit |
5c3484 |
define(`LOGOP', `bic $1, $2, $3')')
|
|
Packit |
5c3484 |
ifdef(`OPERATION_nand_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_nand_n')
|
|
Packit |
5c3484 |
define(`POSTOP', `mvn $1, $1')
|
|
Packit |
5c3484 |
define(`LOGOP', `and $1, $2, $3')')
|
|
Packit |
5c3484 |
ifdef(`OPERATION_ior_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_ior_n')
|
|
Packit |
5c3484 |
define(`LOGOP', `orr $1, $2, $3')')
|
|
Packit |
5c3484 |
ifdef(`OPERATION_iorn_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_iorn_n')
|
|
Packit |
5c3484 |
define(`LOGOP', `orn $1, $2, $3')')
|
|
Packit |
5c3484 |
ifdef(`OPERATION_nior_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_nior_n')
|
|
Packit |
5c3484 |
define(`POSTOP', `mvn $1, $1')
|
|
Packit |
5c3484 |
define(`LOGOP', `orr $1, $2, $3')')
|
|
Packit |
5c3484 |
ifdef(`OPERATION_xor_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_xor_n')
|
|
Packit |
5c3484 |
define(`LOGOP', `eor $1, $2, $3')')
|
|
Packit |
5c3484 |
ifdef(`OPERATION_xnor_n',`
|
|
Packit |
5c3484 |
define(`func', `mpn_xnor_n')
|
|
Packit |
5c3484 |
define(`LOGOP', `eon $1, $2, $3')')
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ASM_START()
|
|
Packit |
5c3484 |
PROLOGUE(func)
|
|
Packit |
5c3484 |
tbz n, #0, L(b0)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
ldr x4, [up],#8
|
|
Packit |
5c3484 |
ldr x6, [vp],#8
|
|
Packit |
5c3484 |
sub n, n, #1
|
|
Packit |
5c3484 |
LOGOP( x8, x4, x6)
|
|
Packit |
5c3484 |
POSTOP( x8)
|
|
Packit |
5c3484 |
str x8, [rp],#8
|
|
Packit |
5c3484 |
cbz n, L(rtn)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
L(b0): ldp x4, x5, [up],#16
|
|
Packit |
5c3484 |
ldp x6, x7, [vp],#16
|
|
Packit |
5c3484 |
sub n, n, #2
|
|
Packit |
5c3484 |
b L(mid)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
L(top): ldp x4, x5, [up],#16
|
|
Packit |
5c3484 |
ldp x6, x7, [vp],#16
|
|
Packit |
5c3484 |
sub n, n, #2
|
|
Packit |
5c3484 |
stp x8, x9, [rp],#16
|
|
Packit |
5c3484 |
L(mid): LOGOP( x8, x4, x6)
|
|
Packit |
5c3484 |
LOGOP( x9, x5, x7)
|
|
Packit |
5c3484 |
POSTOP( x8)
|
|
Packit |
5c3484 |
POSTOP( x9)
|
|
Packit |
5c3484 |
cbnz n, L(top)
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
stp x8, x9, [rp],#16
|
|
Packit |
5c3484 |
L(rtn): ret
|
|
Packit |
5c3484 |
EPILOGUE()
|