Home | History | Annotate | Line # | Download | only in ultrasparct1
add_n.asm revision 1.1.1.1
      1 dnl  SPARC v9 mpn_add_n for T1/T2.
      2 
      3 dnl  Copyright 2010 Free Software Foundation, Inc.
      4 
      5 dnl  This file is part of the GNU MP Library.
      6 
      7 dnl  The GNU MP Library is free software; you can redistribute it and/or modify
      8 dnl  it under the terms of the GNU Lesser General Public License as published
      9 dnl  by the Free Software Foundation; either version 3 of the License, or (at
     10 dnl  your option) any later version.
     11 
     12 dnl  The GNU MP Library is distributed in the hope that it will be useful, but
     13 dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     14 dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
     15 dnl  License for more details.
     16 
     17 dnl  You should have received a copy of the GNU Lesser General Public License
     18 dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
     19 
     20 include(`../config.m4')
     21 
     22 C		   cycles/limb
     23 C UltraSPARC T1:	 ?
     24 C UltraSPARC T2:	 ?
     25 
     26 C INPUT PARAMETERS
     27 define(`rp', `%o0')
     28 define(`up', `%o1')
     29 define(`vp', `%o2')
     30 define(`n',  `%o3')
     31 define(`cy', `%o4')
     32 
     33 ASM_START()
     34 	REGISTER(%g2,#scratch)
     35 	REGISTER(%g3,#scratch)
     36 PROLOGUE(mpn_add_nc)
     37 	b,a	L(ent)
     38 EPILOGUE()
     39 PROLOGUE(mpn_add_n)
     40 	mov	0, cy
     41 L(ent):	cmp	%g0, cy
     42 L(top):	ldx	[up+0], %o4
     43 	add	up, 8, up
     44 	ldx	[vp+0], %o5
     45 	add	vp, 8, vp
     46 	add	rp, 8, rp
     47 	add	n, -1, n
     48 	srlx	%o4, 32, %g1
     49 	srlx	%o5, 32, %g2
     50 	addccc	%o4, %o5, %g3
     51 	addccc	%g1, %g2, %g0
     52 	brgz	n, L(top)
     53 	 stx	%g3, [rp-8]
     54 
     55 	retl
     56 	addc	%g0, %g0, %o0
     57 EPILOGUE()
     58