Blame mpn/arm64/com.asm

Packit 5c3484
dnl  ARM64 mpn_com.
Packit 5c3484
Packit 5c3484
dnl  Copyright 2013, 2014 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(`n',  `x2')
Packit 5c3484
Packit 5c3484
ASM_START()
Packit 5c3484
PROLOGUE(mpn_com)
Packit 5c3484
	cmp	n, #3
Packit 5c3484
	b.le	L(bc)
Packit 5c3484
Packit 5c3484
C Copy until rp is 128-bit aligned
Packit 5c3484
	tbz	rp, #3, L(al2)
Packit 5c3484
	ld1	{v22.1d}, [up], #8
Packit 5c3484
	sub	n, n, #1
Packit 5c3484
	mvn	v22.8b, v22.8b
Packit 5c3484
	st1	{v22.1d}, [rp], #8
Packit 5c3484
Packit 5c3484
L(al2):	ld1	{v26.2d}, [up], #16
Packit 5c3484
	subs	n, n, #6
Packit 5c3484
	b.lt	L(end)
Packit 5c3484
Packit 5c3484
	ALIGN(16)
Packit 5c3484
L(top):	ld1	{v22.2d}, [up], #16
Packit 5c3484
	mvn	v26.16b, v26.16b
Packit 5c3484
	st1	{v26.2d}, [rp], #16
Packit 5c3484
	ld1	{v26.2d}, [up], #16
Packit 5c3484
	mvn	v22.16b, v22.16b
Packit 5c3484
	st1	{v22.2d}, [rp], #16
Packit 5c3484
	subs	n, n, #4
Packit 5c3484
	b.ge	L(top)
Packit 5c3484
Packit 5c3484
L(end):	mvn	v26.16b, v26.16b
Packit 5c3484
	st1	{v26.2d}, [rp], #16
Packit 5c3484
Packit 5c3484
C Copy last 0-3 limbs.  Note that rp is aligned after loop, but not when we
Packit 5c3484
C arrive here via L(bc)
Packit 5c3484
L(bc):	tbz	n, #1, L(tl1)
Packit 5c3484
	ld1	{v22.2d}, [up], #16
Packit 5c3484
	mvn	v22.16b, v22.16b
Packit 5c3484
	st1	{v22.2d}, [rp], #16
Packit 5c3484
L(tl1):	tbz	n, #0, L(tl2)
Packit 5c3484
	ld1	{v22.1d}, [up]
Packit 5c3484
	mvn	v22.8b, v22.8b
Packit 5c3484
	st1	{v22.1d}, [rp]
Packit 5c3484
L(tl2):	ret
Packit 5c3484
EPILOGUE()