Blame mpn/sparc64/ultrasparct1/addmul_1.asm

Packit 5c3484
dnl  SPARC v9 mpn_addmul_1 for T1/T2.
Packit 5c3484
Packit 5c3484
dnl  Copyright 2010 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:	74
Packit 5c3484
C UltraSPARC T2:	 ?
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
	REGISTER(%g2,#scratch)
Packit 5c3484
	REGISTER(%g3,#scratch)
Packit 5c3484
PROLOGUE(mpn_addmul_1)
Packit 5c3484
	save	%sp, -176, %sp
Packit 5c3484
	mov	1, %o2
Packit 5c3484
	mov	%i0, %g2
Packit 5c3484
	srlx	%i3, 32, %o4
Packit 5c3484
	sllx	%o2, 32, %o2
Packit 5c3484
	srl	%i3, 0, %i3
Packit 5c3484
	mov	0, %g3
Packit 5c3484
	mov	0, %i0
Packit 5c3484
Packit 5c3484
L(top):	ldx	[%i1+%g3], %g1
Packit 5c3484
	srl	%g1, 0, %g4
Packit 5c3484
	mulx	%g4, %i3, %o5
Packit 5c3484
	srlx	%g1, 32, %g1
Packit 5c3484
	mulx	%g1, %i3, %g5
Packit 5c3484
	mulx	%g4, %o4, %g4
Packit 5c3484
	mulx	%g1, %o4, %g1
Packit 5c3484
	srlx	%o5, 32, %o1
Packit 5c3484
	add	%g5, %o1, %o1
Packit 5c3484
	addcc	%o1, %g4, %g4
Packit 5c3484
	srl	%o5, 0, %o0
Packit 5c3484
	ldx	[%g2+%g3], %o5
Packit 5c3484
	sllx	%g4, 32, %o1
Packit 5c3484
	add	%g1, %o2, %l1
Packit 5c3484
	movlu	%xcc, %l1, %g1
Packit 5c3484
	add	%o1, %o0, %l0
Packit 5c3484
	addcc	%l0, %i0, %g5
Packit 5c3484
	srlx	%g4, 32, %i0
Packit 5c3484
	add	%i0, 1, %g4
Packit 5c3484
	movlu	%xcc, %g4, %i0
Packit 5c3484
	addcc	%o5, %g5, %g5
Packit 5c3484
	stx	%g5, [%g2+%g3]
Packit 5c3484
	add	%i0, 1, %g4
Packit 5c3484
	movlu	%xcc, %g4, %i0
Packit 5c3484
	add	%i2, -1, %i2
Packit 5c3484
	add	%i0, %g1, %i0
Packit 5c3484
	brnz,pt	%i2, L(top)
Packit 5c3484
	 add	%g3, 8, %g3
Packit 5c3484
	return	%i7+8
Packit 5c3484
	 nop
Packit 5c3484
EPILOGUE()