Blame sysdeps/sparc/sparc64/multiarch/addmul_1-vis3.S

Packit 6c4009
! SPARC v9 64-bit VIS3 __mpn_addmul_1 -- Multiply a limb vector with a
Packit 6c4009
! limb and add the result to a second limb vector.
Packit 6c4009
!
Packit 6c4009
! Copyright (C) 2013-2018 Free Software Foundation, Inc.
Packit 6c4009
! This file is part of the GNU C Library.
Packit 6c4009
! Contributed by David S. Miller <davem@davemloft.net>
Packit 6c4009
!
Packit 6c4009
! The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
! modify it under the terms of the GNU Lesser General Public
Packit 6c4009
! License as published by the Free Software Foundation; either
Packit 6c4009
! version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
!
Packit 6c4009
! The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
! but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
! Lesser General Public License for more details.
Packit 6c4009
!
Packit 6c4009
! You should have received a copy of the GNU Lesser General Public
Packit 6c4009
! License along with the GNU C Library; if not, see
Packit 6c4009
! <http://www.gnu.org/licenses/>.
Packit 6c4009
Packit 6c4009
#include <sysdep.h>
Packit 6c4009
Packit 6c4009
#define res_ptr	%i0
Packit 6c4009
#define s1_ptr	%i1
Packit 6c4009
#define sz	%i2
Packit 6c4009
#define s2_limb	%i3
Packit 6c4009
#define carry	%o5
Packit 6c4009
#define tmp1	%g1
Packit 6c4009
#define tmp2	%g2
Packit 6c4009
#define tmp3	%g3
Packit 6c4009
#define tmp4	%o4
Packit 6c4009
#define tmp5	%l0
Packit 6c4009
#define tmp6	%l1
Packit 6c4009
#define tmp7	%l2
Packit 6c4009
#define tmp8	%l3
Packit 6c4009
Packit 6c4009
	.register	%g2,#scratch
Packit 6c4009
	.register	%g3,#scratch
Packit 6c4009
ENTRY(__mpn_addmul_1_vis3)
Packit 6c4009
	save	%sp, -176, %sp
Packit 6c4009
	subcc	sz, 1, sz
Packit 6c4009
	be	.Lfinal_limb
Packit 6c4009
	 clr	carry
Packit 6c4009
Packit 6c4009
.Lloop:
Packit 6c4009
	ldx	[s1_ptr  + 0x00], tmp1
Packit 6c4009
	ldx	[res_ptr + 0x00], tmp3
Packit 6c4009
	ldx	[s1_ptr  + 0x08], tmp2
Packit 6c4009
	ldx	[res_ptr + 0x08], tmp4
Packit 6c4009
	mulx	tmp1, s2_limb, tmp5
Packit 6c4009
	add	s1_ptr, 0x10, s1_ptr
Packit 6c4009
	umulxhi	tmp1, s2_limb, tmp6
Packit 6c4009
	add	res_ptr, 0x10, res_ptr
Packit 6c4009
	mulx	tmp2, s2_limb, tmp7
Packit 6c4009
	sub	sz, 2, sz
Packit 6c4009
	umulxhi	tmp2, s2_limb, tmp8
Packit 6c4009
	addcc	carry, tmp5, tmp5
Packit 6c4009
	addxc	%g0, tmp6, carry
Packit 6c4009
	addcc	tmp3, tmp5, tmp5
Packit 6c4009
	addxc	%g0, carry, carry
Packit 6c4009
	stx	tmp5, [res_ptr - 0x10]
Packit 6c4009
	addcc	carry, tmp7, tmp7
Packit 6c4009
	addxc	%g0, tmp8, carry
Packit 6c4009
	addcc	tmp4, tmp7, tmp7
Packit 6c4009
	addxc	%g0, carry, carry
Packit 6c4009
	brgz	sz, .Lloop
Packit 6c4009
	 stx	tmp7, [res_ptr - 0x08]
Packit 6c4009
Packit 6c4009
	brlz,pt	sz, .Lfinish
Packit 6c4009
	 nop
Packit 6c4009
Packit 6c4009
.Lfinal_limb:
Packit 6c4009
	ldx	[s1_ptr  + 0x00], tmp1
Packit 6c4009
	ldx	[res_ptr + 0x00], tmp3
Packit 6c4009
	mulx	tmp1, s2_limb, tmp5
Packit 6c4009
	umulxhi	tmp1, s2_limb, tmp6
Packit 6c4009
	addcc	carry, tmp5, tmp5
Packit 6c4009
	addxc	%g0, tmp6, carry
Packit 6c4009
	addcc	tmp3, tmp5, tmp5
Packit 6c4009
	addxc	%g0, carry, carry
Packit 6c4009
	stx	tmp5, [res_ptr + 0x00]
Packit 6c4009
Packit 6c4009
.Lfinish:
Packit 6c4009
	jmpl	%i7 + 8, %g0
Packit 6c4009
	 restore carry, 0, %o0
Packit 6c4009
END(__mpn_addmul_1_vis3)