github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpn/sparc64/copyd.asm (about)

     1  dnl  SPARC v9 mpn_copyd -- Copy a limb vector, decrementing.
     2  
     3  dnl  Copyright 1999-2003 Free Software Foundation, Inc.
     4  
     5  dnl  This file is part of the GNU MP Library.
     6  dnl
     7  dnl  The GNU MP Library is free software; you can redistribute it and/or modify
     8  dnl  it under the terms of either:
     9  dnl
    10  dnl    * the GNU Lesser General Public License as published by the Free
    11  dnl      Software Foundation; either version 3 of the License, or (at your
    12  dnl      option) any later version.
    13  dnl
    14  dnl  or
    15  dnl
    16  dnl    * the GNU General Public License as published by the Free Software
    17  dnl      Foundation; either version 2 of the License, or (at your option) any
    18  dnl      later version.
    19  dnl
    20  dnl  or both in parallel, as here.
    21  dnl
    22  dnl  The GNU MP Library is distributed in the hope that it will be useful, but
    23  dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    24  dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    25  dnl  for more details.
    26  dnl
    27  dnl  You should have received copies of the GNU General Public License and the
    28  dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
    29  dnl  see https://www.gnu.org/licenses/.
    30  
    31  include(`../config.m4')
    32  
    33  C		   cycles/limb
    34  C UltraSPARC 1&2:	 2
    35  C UltraSPARC 3:		 2.5
    36  C UltraSPARC T1:	17
    37  C UltraSPARC T3:	 6
    38  C UltraSPARC T4/T5:	 2
    39  
    40  C INPUT PARAMETERS
    41  C rptr	%o0
    42  C sptr	%o1
    43  C n	%o2
    44  
    45  ASM_START()
    46  	REGISTER(%g2,#scratch)
    47  	REGISTER(%g3,#scratch)
    48  PROLOGUE(mpn_copyd)
    49  	sllx	%o2,3,%g1
    50  	add	%g1,%o0,%o0
    51  	add	%g1,%o1,%o1
    52  	addcc	%o2,-8,%o2
    53  	bl,pt	%xcc,L(end01234567)
    54  	nop
    55  L(loop1):
    56  	ldx	[%o1-8],%g1
    57  	ldx	[%o1-16],%g2
    58  	ldx	[%o1-24],%g3
    59  	ldx	[%o1-32],%g4
    60  	ldx	[%o1-40],%g5
    61  	ldx	[%o1-48],%o3
    62  	ldx	[%o1-56],%o4
    63  	ldx	[%o1-64],%o5
    64  	add	%o1,-64,%o1
    65  	stx	%g1,[%o0-8]
    66  	stx	%g2,[%o0-16]
    67  	stx	%g3,[%o0-24]
    68  	stx	%g4,[%o0-32]
    69  	stx	%g5,[%o0-40]
    70  	stx	%o3,[%o0-48]
    71  	stx	%o4,[%o0-56]
    72  	stx	%o5,[%o0-64]
    73  	addcc	%o2,-8,%o2
    74  	bge,pt	%xcc,L(loop1)
    75  	add	%o0,-64,%o0
    76  L(end01234567):
    77  	addcc	%o2,8,%o2
    78  	bz,pn	%xcc,L(end)
    79  	nop
    80  L(loop2):
    81  	ldx	[%o1-8],%g1
    82  	add	%o1,-8,%o1
    83  	addcc	%o2,-1,%o2
    84  	stx	%g1,[%o0-8]
    85  	bg,pt	%xcc,L(loop2)
    86  	add	%o0,-8,%o0
    87  L(end):	retl
    88  	nop
    89  EPILOGUE(mpn_copyd)