Home | History | Annotate | Line # | Download | only in ultrasparct3
sqr_diag_addlsh1.asm revision 1.1.1.2
      1 dnl  SPARC v9 mpn_sqr_diag_addlsh1 for T3/T4/T5.
      2 
      3 dnl  Contributed to the GNU project by Torbjrn Granlund.
      4 
      5 dnl  Copyright 2013 Free Software Foundation, Inc.
      6 
      7 dnl  This file is part of the GNU MP Library.
      8 dnl
      9 dnl  The GNU MP Library is free software; you can redistribute it and/or modify
     10 dnl  it under the terms of either:
     11 dnl
     12 dnl    * the GNU Lesser General Public License as published by the Free
     13 dnl      Software Foundation; either version 3 of the License, or (at your
     14 dnl      option) any later version.
     15 dnl
     16 dnl  or
     17 dnl
     18 dnl    * the GNU General Public License as published by the Free Software
     19 dnl      Foundation; either version 2 of the License, or (at your option) any
     20 dnl      later version.
     21 dnl
     22 dnl  or both in parallel, as here.
     23 dnl
     24 dnl  The GNU MP Library is distributed in the hope that it will be useful, but
     25 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     26 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     27 dnl  for more details.
     28 dnl
     29 dnl  You should have received copies of the GNU General Public License and the
     30 dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
     31 dnl  see https://www.gnu.org/licenses/.
     32 
     33 include(`../config.m4')
     34 
     35 C		   cycles/limb
     36 C UltraSPARC T3:	?
     37 C UltraSPARC T4:	>= 4.5
     38 
     39 
     40 define(`rp', `%i0')
     41 define(`tp', `%i1')
     42 define(`up', `%i2')
     43 define(`n',  `%i3')
     44 
     45 ASM_START()
     46 	REGISTER(%g2,#scratch)
     47 	REGISTER(%g3,#scratch)
     48 PROLOGUE(mpn_sqr_diag_addlsh1)
     49 	save	%sp, -176, %sp
     50 
     51 	ldx	[up+0], %g1
     52 	mulx	%g1, %g1, %o0
     53 	umulxhi(%g1, %g1, %g2)
     54 	stx	%o0, [rp+0]
     55 
     56 	ldx	[up+8], %g1
     57 	ldx	[tp+0], %g4
     58 	ldx	[tp+8], %g5
     59 	mulx	%g1, %g1, %o0
     60 	orcc	%g0, %g0, %o5
     61 	b	L(dm)
     62 	 add	n, -2, n
     63 
     64 	ALIGN(16)
     65 L(top):	ldx	[up+8], %g1
     66 	addcc	%g4, %o2, %o2
     67 	addxccc(%g5, %o0, %g3)
     68 	ldx	[tp+16], %g4
     69 	ldx	[tp+24], %g5
     70 	mulx	%g1, %g1, %o0
     71 	stx	%o2, [rp+8]
     72 	stx	%g3, [rp+16]
     73 	add	rp, 16, rp
     74 	add	tp, 16, tp
     75 L(dm):	add	%g2, %o5, %o2
     76 	umulxhi(%g1, %g1, %g2)
     77 	addxccc(%g4, %g4, %g4)
     78 	addxccc(%g5, %g5, %g5)
     79 	add	up, 8, up
     80 	addxc(	%g0, %g0, %o5)
     81 	brnz	n, L(top)
     82 	 add	n, -1, n
     83 
     84 	addcc	%o2, %g4, %g4
     85 	addxccc(%o0, %g5, %g5)
     86 	stx	%g4, [rp+8]
     87 	stx	%g5, [rp+16]
     88 	addxc(	%o5, %g2, %g2)
     89 	stx	%g2, [rp+24]
     90 
     91 	ret
     92 	 restore
     93 EPILOGUE()
     94