1 dnl Alpha mpn_addlsh1_n
/mpn_sublsh1_n
-- rp
[] = up
[] +- (vp
[] << 1).
3 dnl Copyright
2003, 2013 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
either:
10 dnl
* the GNU Lesser General
Public License as published by the Free
11 dnl Software Foundation
; either version 3 of the License, or (at your
12 dnl option
) any later version.
16 dnl
* the GNU General
Public License as published by the Free Software
17 dnl Foundation
; either version 2 of the License, or (at your option) any
20 dnl
or both
in parallel
, as here.
22 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
23 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
24 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
27 dnl You should have received copies of the GNU General
Public License
and the
28 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
29 dnl see
https://www.gnu.
org/licenses
/.
31 include(`..
/config.m4
')
55 ifdef(`OPERATION_addlsh1_n',`
57 define
(CARRY
, `cmpult
$1,$2,$3')
58 define(func, mpn_addlsh1_n)
60 ifdef
(`OPERATION_sublsh1_n
',`
62 define(CARRY, `cmpult $2,$1,$3')
63 define
(func
, mpn_sublsh1_n
)
66 MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
77 L(b00): lda vp, 48(vp)
82 L(b10): lda vp, 32(vp)
92 L(b11): lda vp, 40(vp)
103 L(top): addq v0, v0, sl C left shift vlimb
105 ADDSUB u0, sl, ps C ulimb + (vlimb << 1)
106 cmplt v0, r31, cy0 C carry out #1
108 ADDSUB ps, cy1, rr C consume carry from previous operation
109 CARRY( ps, u0, cy) C carry out #2
111 addq cy, cy0, cy0 C combine carry out #1 and #2
112 CARRY( rr, ps, cy) C carry out #3
113 addq cy, cy0, cy0 C final carry out
114 lda vp, 32(vp) C bookkeeping
115 L(lo0): addq v1, v1, sl
126 lda rp, 32(rp) C bookkeeping
127 L(lo3): addq v0, v0, sl
138 lda up, 32(up) C bookkeeping
139 L(lo2): addq v1, v1, sl
150 lda n, -4(n) C bookkeeping
153 L(end): addq v0, v0, sl