Annotation of OpenXM_contrib/gmp/mpn/power/lshift.asm, Revision 1.1.1.1
1.1 ohara 1: dnl IBM POWER mpn_lshift -- Shift a number left.
2:
3: dnl Copyright 1992, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
4:
5: dnl This file is part of the GNU MP Library.
6:
7: dnl The GNU MP Library is free software; you can redistribute it and/or modify
8: dnl it under the terms of the GNU Lesser General Public License as published
9: dnl by the Free Software Foundation; either version 2.1 of the License, or (at
10: dnl your option) any later version.
11:
12: dnl The GNU MP Library is distributed in the hope that it will be useful, but
13: dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15: dnl License for more details.
16:
17: dnl You should have received a copy of the GNU Lesser General Public License
18: dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to
19: dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20: dnl MA 02111-1307, USA.
21:
22:
23: dnl INPUT PARAMETERS
24: dnl res_ptr r3
25: dnl s_ptr r4
26: dnl size r5
27: dnl cnt r6
28:
29: include(`../config.m4')
30:
31: ASM_START()
32: PROLOGUE(mpn_lshift)
33: sli 0,5,2
34: cax 9,3,0
35: cax 4,4,0
36: sfi 8,6,32
37: mtctr 5 C put limb count in CTR loop register
38: lu 0,-4(4) C read most significant limb
39: sre 3,0,8 C compute carry out limb, and init MQ register
40: bdz Lend2 C if just one limb, skip loop
41: lu 0,-4(4) C read 2:nd most significant limb
42: sreq 7,0,8 C compute most significant limb of result
43: bdz Lend C if just two limb, skip loop
44: Loop: lu 0,-4(4) C load next lower limb
45: stu 7,-4(9) C store previous result during read latency
46: sreq 7,0,8 C compute result limb
47: bdn Loop C loop back until CTR is zero
48: Lend: stu 7,-4(9) C store 2:nd least significant limb
49: Lend2: sle 7,0,6 C compute least significant limb
50: st 7,-4(9) C store it
51: br
52: EPILOGUE(mpn_lshift)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>