1 dnl IBM POWER mpn_addmul_1
-- Multiply a limb vector with a limb
and add the
2 dnl result to a second limb vector.
4 dnl Copyright
1992, 1994, 1999-2001 Free Software Foundation
, Inc.
6 dnl
This file is part of the GNU MP Library.
8 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
9 dnl it under the terms of
either:
11 dnl
* the GNU Lesser General
Public License as published by the Free
12 dnl Software Foundation
; either version 3 of the License, or (at your
13 dnl option
) any later version.
17 dnl
* the GNU General
Public License as published by the Free Software
18 dnl Foundation
; either version 2 of the License, or (at your option) any
21 dnl
or both
in parallel
, as here.
23 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
24 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
25 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
28 dnl You should have received copies of the GNU General
Public License
and the
29 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
30 dnl see
https://www.gnu.
org/licenses
/.
39 dnl The POWER architecture has no unsigned
32x32
->64 bit multiplication
40 dnl instruction. To obtain that operation
, we have to use the
32x32
->64
41 dnl signed multiplication instruction
, and add the appropriate compensation to
42 dnl the
high limb of the result. We
add the multiplicand if the multiplier
43 dnl has its most significant bit set
, and we
add the multiplier if the
44 dnl multiplicand has its most significant bit set. We need to preserve the
45 dnl carry flag between each iteration
, so we have to compute the compensation
46 dnl carefully
(the natural
, srai
+and doesn
't work). Since all POWER can
47 dnl branch in zero cycles, we use conditional branches for the compensation.
49 include(`../config.m4')
52 PROLOGUE
(mpn_addmul_1
)
63 a
8,8,7 C
add res_limb
72 ae
8,0,9 C
low limb
+ old_cy_limb
+ old cy
74 aze
10,10 C propagate cy to new cy_limb
75 a
8,8,7 C
add res_limb
77 cax
10,10,6 C adjust
high limb for negative limb from s1
89 cax
9,9,6 C adjust
high limb for negative limb from s1
103 ae
10,10,0 C propagate cy to new cy_limb
104 a
8,8,7 C
add res_limb
106 cax
10,10,6 C adjust
high limb for negative limb from s1
115 ae
9,9,0 C propagate cy to new cy_limb
116 a
8,8,7 C
add res_limb
118 cax
9,9,6 C adjust
high limb for negative limb from s1
126 EPILOGUE
(mpn_addmul_1
)