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

     1  dnl  PowerPC-64 mpn_copyd.
     2  
     3  dnl  Copyright 2004, 2005, 2013 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 POWER3/PPC630          ?
    35  C POWER4/PPC970          ?
    36  C POWER5                 ?
    37  C POWER6                 1.25
    38  C POWER7                 1.09
    39  
    40  C INPUT PARAMETERS
    41  define(`rp',	`r3')
    42  define(`up',	`r4')
    43  define(`n',	`r5')
    44  
    45  ASM_START()
    46  PROLOGUE(mpn_copyd)
    47  
    48  ifdef(`HAVE_ABI_mode32',
    49  `	rldicl	n, n, 0,32')
    50  
    51  	sldi	r0, n, 3
    52  	add	up, up, r0		C point at u[] end
    53  	add	rp, rp, r0		C point at r[] end
    54  
    55  	cmpdi	cr0, n, 4
    56  	blt	L(sml)
    57  
    58  	addi	r10, n, 4
    59  	srdi	r10, r10, 3
    60  	mtctr	r10
    61  
    62  	andi.	r0, n, 1
    63  	rlwinm	r11, n, 0,30,30
    64  	rlwinm	r12, n, 0,29,29
    65  	cmpdi	cr6, r11, 0
    66  	cmpdi	cr7, r12, 0
    67  
    68  	beq	cr0, L(xx0)
    69  L(xx1):	ld	r6, -8(up)
    70  	addi	up, up, -8
    71  	std	r6, -8(rp)
    72  	addi	rp, rp, -8
    73  
    74  L(xx0):	bne	cr6, L(x10)
    75  L(x00):	ld	r6, -8(up)
    76  	ld	r7, -16(up)
    77  	bne	cr7, L(100)
    78  L(000):	addi	rp, rp, 32
    79  	b	L(lo0)
    80  L(100):	addi	up, up, 32
    81  	b	L(lo4)
    82  L(x10):	ld	r8, -8(up)
    83  	ld	r9, -16(up)
    84  	bne	cr7, L(110)
    85  L(010):	addi	up, up, -16
    86  	addi	rp, rp, 16
    87  	b	L(lo2)
    88  L(110):	addi	up, up, 16
    89  	addi	rp, rp, 48
    90  	b	L(lo6)
    91  
    92  L(sml):	cmpdi	cr0, n, 0
    93  	beqlr-	cr0
    94  	mtctr	n
    95  L(t):	ld	r6, -8(up)
    96  	addi	up, up, -8
    97  	std	r6, -8(rp)
    98  	addi	rp, rp, -8
    99  	bdnz	L(t)
   100  	blr
   101  
   102  	ALIGN(32)
   103  L(top):	std	r6, -8(rp)
   104  	std	r7, -16(rp)
   105  L(lo2):	ld	r6, -8(up)
   106  	ld	r7, -16(up)
   107  	std	r8, -24(rp)
   108  	std	r9, -32(rp)
   109  L(lo0):	ld	r8, -24(up)
   110  	ld	r9, -32(up)
   111  	std	r6, -40(rp)
   112  	std	r7, -48(rp)
   113  L(lo6):	ld	r6, -40(up)
   114  	ld	r7, -48(up)
   115  	std	r8, -56(rp)
   116  	std	r9, -64(rp)
   117  	addi	rp, rp, -64
   118  L(lo4):	ld	r8, -56(up)
   119  	ld	r9, -64(up)
   120  	addi	up, up, -64
   121  	bdnz	L(top)
   122  
   123  L(end):	std	r6, -8(rp)
   124  	std	r7, -16(rp)
   125  	std	r8, -24(rp)
   126  	std	r9, -32(rp)
   127  	blr
   128  EPILOGUE()