Home | History | Annotate | Line # | Download | only in sparc32
      1      1.1  mrg dnl  SPARC mpn_rshift -- Shift a number right.
      2      1.1  mrg 
      3      1.1  mrg dnl  Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
      4      1.1  mrg 
      5      1.1  mrg dnl  This file is part of the GNU MP Library.
      6  1.1.1.2  mrg dnl
      7      1.1  mrg dnl  The GNU MP Library is free software; you can redistribute it and/or modify
      8  1.1.1.2  mrg dnl  it under the terms of either:
      9  1.1.1.2  mrg dnl
     10  1.1.1.2  mrg dnl    * the GNU Lesser General Public License as published by the Free
     11  1.1.1.2  mrg dnl      Software Foundation; either version 3 of the License, or (at your
     12  1.1.1.2  mrg dnl      option) any later version.
     13  1.1.1.2  mrg dnl
     14  1.1.1.2  mrg dnl  or
     15  1.1.1.2  mrg dnl
     16  1.1.1.2  mrg dnl    * the GNU General Public License as published by the Free Software
     17  1.1.1.2  mrg dnl      Foundation; either version 2 of the License, or (at your option) any
     18  1.1.1.2  mrg dnl      later version.
     19  1.1.1.2  mrg dnl
     20  1.1.1.2  mrg dnl  or both in parallel, as here.
     21  1.1.1.2  mrg dnl
     22      1.1  mrg dnl  The GNU MP Library is distributed in the hope that it will be useful, but
     23      1.1  mrg dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     24  1.1.1.2  mrg dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     25  1.1.1.2  mrg dnl  for more details.
     26  1.1.1.2  mrg dnl
     27  1.1.1.2  mrg dnl  You should have received copies of the GNU General Public License and the
     28  1.1.1.2  mrg dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
     29  1.1.1.2  mrg dnl  see https://www.gnu.org/licenses/.
     30      1.1  mrg 
     31      1.1  mrg 
     32      1.1  mrg include(`../config.m4')
     33      1.1  mrg 
     34      1.1  mrg C INPUT PARAMETERS
     35      1.1  mrg C res_ptr	%o0
     36      1.1  mrg C src_ptr	%o1
     37      1.1  mrg C size		%o2
     38      1.1  mrg C cnt		%o3
     39      1.1  mrg 
     40      1.1  mrg ASM_START()
     41      1.1  mrg PROLOGUE(mpn_rshift)
     42      1.1  mrg 	ld	[%o1],%g2	C load first limb
     43      1.1  mrg 	sub	%g0,%o3,%o5	C negate shift count
     44      1.1  mrg 	add	%o2,-1,%o2
     45      1.1  mrg 	andcc	%o2,4-1,%g4	C number of limbs in first loop
     46      1.1  mrg 	sll	%g2,%o5,%g1	C compute function result
     47      1.1  mrg 	be	L(0)		C if multiple of 4 limbs, skip first loop
     48      1.1  mrg 	st	%g1,[%sp+80]
     49      1.1  mrg 
     50      1.1  mrg 	sub	%o2,%g4,%o2	C adjust count for main loop
     51      1.1  mrg 
     52      1.1  mrg L(loop0):
     53      1.1  mrg 	ld	[%o1+4],%g3
     54      1.1  mrg 	add	%o0,4,%o0
     55      1.1  mrg 	add	%o1,4,%o1
     56      1.1  mrg 	addcc	%g4,-1,%g4
     57      1.1  mrg 	srl	%g2,%o3,%o4
     58      1.1  mrg 	sll	%g3,%o5,%g1
     59      1.1  mrg 	mov	%g3,%g2
     60      1.1  mrg 	or	%o4,%g1,%o4
     61      1.1  mrg 	bne	L(loop0)
     62      1.1  mrg 	 st	%o4,[%o0-4]
     63      1.1  mrg 
     64      1.1  mrg L(0):	tst	%o2
     65      1.1  mrg 	be	L(end)
     66      1.1  mrg 	 nop
     67      1.1  mrg 
     68      1.1  mrg L(loop):
     69      1.1  mrg 	ld	[%o1+4],%g3
     70      1.1  mrg 	add	%o0,16,%o0
     71      1.1  mrg 	addcc	%o2,-4,%o2
     72      1.1  mrg 	srl	%g2,%o3,%o4
     73      1.1  mrg 	sll	%g3,%o5,%g1
     74      1.1  mrg 
     75      1.1  mrg 	ld	[%o1+8],%g2
     76      1.1  mrg 	srl	%g3,%o3,%g4
     77      1.1  mrg 	or	%o4,%g1,%o4
     78      1.1  mrg 	st	%o4,[%o0-16]
     79      1.1  mrg 	sll	%g2,%o5,%g1
     80      1.1  mrg 
     81      1.1  mrg 	ld	[%o1+12],%g3
     82      1.1  mrg 	srl	%g2,%o3,%o4
     83      1.1  mrg 	or	%g4,%g1,%g4
     84      1.1  mrg 	st	%g4,[%o0-12]
     85      1.1  mrg 	sll	%g3,%o5,%g1
     86      1.1  mrg 
     87      1.1  mrg 	ld	[%o1+16],%g2
     88      1.1  mrg 	srl	%g3,%o3,%g4
     89      1.1  mrg 	or	%o4,%g1,%o4
     90      1.1  mrg 	st	%o4,[%o0-8]
     91      1.1  mrg 	sll	%g2,%o5,%g1
     92      1.1  mrg 
     93      1.1  mrg 	add	%o1,16,%o1
     94      1.1  mrg 	or	%g4,%g1,%g4
     95      1.1  mrg 	bne	L(loop)
     96      1.1  mrg 	 st	%g4,[%o0-4]
     97      1.1  mrg 
     98      1.1  mrg L(end):	srl	%g2,%o3,%g2
     99      1.1  mrg 	st	%g2,[%o0-0]
    100      1.1  mrg 	retl
    101      1.1  mrg 	ld	[%sp+80],%o0
    102      1.1  mrg EPILOGUE(mpn_rshift)
    103