1 dnl IBM POWER mpn_lshift -- Shift a number left.
3 dnl Copyright 1992, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
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 3 of the License, or (at
10 dnl your option) any later version.
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.
17 dnl You should have received a copy of the GNU Lesser General Public License
18 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
27 include(`../config.m4')
35 mtctr 5 C put limb count in CTR loop register
36 lu 0,-4(4) C read most significant limb
37 sre 3,0,8 C compute carry out limb, and init MQ register
38 bdz Lend2 C if just one limb, skip loop
39 lu 0,-4(4) C read 2:nd most significant limb
40 sreq 7,0,8 C compute most significant limb of result
41 bdz Lend C if just two limb, skip loop
42 Loop: lu 0,-4(4) C load next lower limb
43 stu 7,-4(9) C store previous result during read latency
44 sreq 7,0,8 C compute result limb
45 bdn Loop C loop back until CTR is zero
46 Lend: stu 7,-4(9) C store 2:nd least significant limb
47 Lend2: sle 7,0,6 C compute least significant limb