1 ; 29000 __gmpn_rshift --
3 ; Copyright (C) 1992, 1994, 2000 Free Software Foundation, Inc.
5 ; This file is part of the GNU MP Library.
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.
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.
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,
29 ; We use the loadm/storem instructions and operate on chunks of 8
30 ; limbs/per iteration, until less than 8 limbs remain.
35 .global ___gmpn_rshift
42 sll gr96,gr119,gr116 ; return value
43 sub lr4,lr4,1 ; actual loop count is SIZE - 1
45 srl gr117,lr4,3 ; chuck count = (actual count) / 8
50 sub gr117,gr117,2 ; count for jmpfdec
52 ; Main loop working 8 limbs/iteration.
57 extract gr98,gr100,gr119
58 extract gr99,gr101,gr100
59 extract gr100,gr102,gr101
60 extract gr101,gr103,gr102
61 extract gr102,gr104,gr103
62 extract gr103,gr105,gr104
63 extract gr104,gr106,gr105
64 extract gr105,gr107,gr106
72 ; Code for the last up-to-7 limbs.
75 Ltail: cpeq gr118,lr4,0
77 sub lr4,lr4,2 ; count for jmpfdec
79 Loop2: load 0,0,gr100,lr3
81 extract gr117,gr100,gr119
87 Lend: srl gr117,gr119,lr5