[BACK]Return to rshift.asm CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpn / powerpc64

Annotation of OpenXM_contrib/gmp/mpn/powerpc64/rshift.asm, Revision 1.1.1.1

1.1       maekawa     1: # PowerPC-64 mpn_rshift -- Shift a number right.
                      2:
                      3: # Copyright (C) 1999, 2000 Free Software Foundation, Inc.
                      4:
                      5: # This file is part of the GNU MP Library.
                      6:
                      7: # The GNU MP Library is free software; you can redistribute it and/or modify
                      8: # it under the terms of the GNU Lesser General Public License as published by
                      9: # the Free Software Foundation; either version 2.1 of the License, or (at your
                     10: # option) any later version.
                     11:
                     12: # The GNU MP Library is distributed in the hope that it will be useful, but
                     13: # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
                     14: # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
                     15: # License for more details.
                     16:
                     17: # You should have received a copy of the GNU Lesser General Public License
                     18: # along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
                     19: # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
                     20: # MA 02111-1307, USA.
                     21:
                     22:
                     23: # INPUT PARAMETERS
                     24: # res_ptr      r3
                     25: # s1_ptr       r4
                     26: # size         r5
                     27: # cnt          r6
                     28:
                     29: include(`../config.m4')
                     30:
                     31: ASM_START()
                     32: PROLOGUE(mpn_rshift)
                     33:        mtctr   r5              # copy size into CTR
                     34:        addi    r7,r3,-8        # move adjusted res_ptr to free return reg
                     35:        subfic  r8,r6,64
                     36:        ld      r11,0(r4)       # load first s1 limb
                     37:        sld     r3,r11,r8       # compute function return value
                     38:        bdz     .Lend1
                     39:
                     40: .Loop: ldu     r10,8(r4)
                     41:        srd     r9,r11,r6
                     42:        sld     r12,r10,r8
                     43:        or      r9,r9,r12
                     44:        stdu    r9,8(r7)
                     45:        bdz     .Lend2
                     46:        ldu     r11,8(r4)
                     47:        srd     r9,r10,r6
                     48:        sld     r12,r11,r8
                     49:        or      r9,r9,r12
                     50:        stdu    r9,8(r7)
                     51:        bdnz    .Loop
                     52:
                     53: .Lend1:        srd     r0,r11,r6
                     54:        std     r0,8(r7)
                     55:        blr
                     56:
                     57: .Lend2:        srd     r0,r10,r6
                     58:        std     r0,8(r7)
                     59:        blr
                     60: EPILOGUE(mpn_rshift)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>