1 dnl SPARC v9 mpn_add_n -- Add two limb vectors of the same length > 0 and
2 dnl store sum in a third limb vector.
4 dnl Copyright 2001, 2002, 2003 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 the GNU Lesser General Public License as published
10 dnl by the Free Software Foundation; either version 3 of the License, or (at
11 dnl your option) any later version.
13 dnl The GNU MP Library is distributed in the hope that it will be useful, but
14 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 dnl License for more details.
18 dnl You should have received a copy of the GNU Lesser General Public License
19 dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
21 include(`../config.m4')
27 C Compute carry-out from the most significant bits of u,v, and r, where
28 C r=u+v+carry_in, using logic operations.
30 C This code runs at 4 cycles/limb on UltraSPARC 1 and 2. It has a 4 insn
31 C recurrency, and the UltraSPARC 1 and 2 the IE units are 100% saturated.
32 C Therefore, it seems futile to try to optimize this any further...
51 define(`fanop',`fitod %f0,%f2') dnl A quasi nop running in the FA pipe
52 define(`fmnop',`fmuld %f0,%f0,%f4') dnl A quasi nop running in the FM pipe
55 REGISTER(%g2,#scratch)
56 REGISTER(%g3,#scratch)
60 fitod %f0,%f0 C make sure f0 contains small, quiet number
76 add u0,v0,%g1 C main add
77 add %g1,cy,%g4 C carry add
85 .Loop: andn %g2,%g4,%g2