Blame mpn/sparc32/ultrasparct1/submul_1.asm

Packit 5c3484
dnl  SPARC T1 32-bit mpn_submul_1.
Packit 5c3484
Packit 5c3484
dnl  Contributed to the GNU project by David Miller.
Packit 5c3484
Packit 5c3484
dnl  Copyright 2010, 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 UltraSPARC T1:       24
Packit 5c3484
C UltraSPARC T2:       19
Packit 5c3484
C UltraSPARC T3:       19
Packit 5c3484
C UltraSPARC T4:       5
Packit 5c3484
Packit 5c3484
C INPUT PARAMETERS
Packit 5c3484
define(`rp',	`%i0')
Packit 5c3484
define(`up',	`%i1')
Packit 5c3484
define(`n',	`%i2')
Packit 5c3484
define(`v0',	`%i3')
Packit 5c3484
Packit 5c3484
ASM_START()
Packit 5c3484
PROLOGUE(mpn_submul_1)
Packit 5c3484
	save	%sp, -96, %sp
Packit 5c3484
	srl	n, 0, %o4
Packit 5c3484
	srl	v0, 0, %g1
Packit 5c3484
	subcc	%o4, 1, %o4
Packit 5c3484
	be	L(final_one)
Packit 5c3484
	 subcc	%g0, 0, %o5
Packit 5c3484
Packit 5c3484
L(top):	lduw	[up+0], %l0
Packit 5c3484
	lduw	[rp+0], %l2
Packit 5c3484
	lduw	[up+4], %l1
Packit 5c3484
	lduw	[rp+4], %l3
Packit 5c3484
	mulx	%l0, %g1, %g3
Packit 5c3484
	add	up, 8, up
Packit 5c3484
	mulx	%l1, %g1, %o3
Packit 5c3484
	sub	%o4, 2, %o4
Packit 5c3484
	add	rp, 8, rp
Packit 5c3484
	addx	%o5, %g3, %g3
Packit 5c3484
	srlx	%g3, 32, %o5
Packit 5c3484
	subcc	%l2, %g3, %g3
Packit 5c3484
	stw	%g3, [rp-8]
Packit 5c3484
	addx	%o5, %o3, %o3
Packit 5c3484
	srlx	%o3, 32, %o5
Packit 5c3484
	subcc	%l3, %o3, %o3
Packit 5c3484
	brgz	%o4, L(top)
Packit 5c3484
	 stw	%o3, [rp-4]
Packit 5c3484
Packit 5c3484
	brlz,pt	%o4, L(done)
Packit 5c3484
	 nop
Packit 5c3484
Packit 5c3484
L(final_one):
Packit 5c3484
	lduw	[up+0], %l0
Packit 5c3484
	lduw	[rp+0], %l2
Packit 5c3484
	mulx	%l0, %g1, %g3
Packit 5c3484
	addx	%o5, %g3, %g3
Packit 5c3484
	srlx	%g3, 32, %o5
Packit 5c3484
	subcc	%l2, %g3, %g3
Packit 5c3484
	stw	%g3, [rp+0]
Packit 5c3484
Packit 5c3484
L(done):
Packit 5c3484
	addx	%o5, 0, %o5
Packit 5c3484
	ret
Packit 5c3484
	 restore %o5, 0, %o0
Packit 5c3484
EPILOGUE()