1 dnl AMD64 mpn_add_err3_n
, mpn_sub_err3_n
3 dnl Contributed by David Harvey.
5 dnl Copyright
2011 Free Software Foundation
, Inc.
7 dnl
This file is part of the GNU MP Library.
9 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
10 dnl it under the terms of
either:
12 dnl
* the GNU Lesser General
Public License as published by the Free
13 dnl Software Foundation
; either version 3 of the License, or (at your
14 dnl option
) any later version.
18 dnl
* the GNU General
Public License as published by the Free Software
19 dnl Foundation
; either version 2 of the License, or (at your option) any
22 dnl
or both
in parallel
, as here.
24 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
25 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
26 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
29 dnl You should have received copies of the GNU General
Public License
and the
30 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
31 dnl see
https://www.gnu.
org/licenses
/.
33 include(`..
/config.m4
')
51 define(`yp3_param', `
8(%rsp
)')
52 define(`n_param', `
16(%rsp
)')
53 define(`cy_param', `
24(%rsp
)')
68 ifdef(`OPERATION_add_err3_n', `
70 define
(func
, mpn_add_err3_n
)')
71 ifdef(`OPERATION_sub_err3_n', `
73 define
(func
, mpn_sub_err3_n
)')
75 MULFUNC_PROLOGUE(mpn_add_err3_n mpn_sub_err3_n)
93 mov 64(%rsp), yp3 C load from yp3_param
95 xor R32(e1l), R32(e1l)
96 xor R32(e1h), R32(e1h)
97 xor R32(e2l), R32(e2l)
98 xor R32(e2h), R32(e2h)
99 xor R32(e3l), R32(e3l)
100 xor R32(e3h), R32(e3h)
113 shr $1, %rax C restore carry
115 ADCSBB (vp,n,8), %rax
117 sbb %rax, %rax C save carry and generate mask