1*e4b17023SJohn Marino /* Software floating-point emulation.
2*e4b17023SJohn Marino    Return a + b
3*e4b17023SJohn Marino    Copyright (C) 1997,1999,2006 Free Software Foundation, Inc.
4*e4b17023SJohn Marino    This file is part of the GNU C Library.
5*e4b17023SJohn Marino    Contributed by Richard Henderson (rth@cygnus.com) and
6*e4b17023SJohn Marino 		  Jakub Jelinek (jj@ultra.linux.cz).
7*e4b17023SJohn Marino 
8*e4b17023SJohn Marino    The GNU C Library is free software; you can redistribute it and/or
9*e4b17023SJohn Marino    modify it under the terms of the GNU Lesser General Public
10*e4b17023SJohn Marino    License as published by the Free Software Foundation; either
11*e4b17023SJohn Marino    version 2.1 of the License, or (at your option) any later version.
12*e4b17023SJohn Marino 
13*e4b17023SJohn Marino    In addition to the permissions in the GNU Lesser General Public
14*e4b17023SJohn Marino    License, the Free Software Foundation gives you unlimited
15*e4b17023SJohn Marino    permission to link the compiled version of this file into
16*e4b17023SJohn Marino    combinations with other programs, and to distribute those
17*e4b17023SJohn Marino    combinations without any restriction coming from the use of this
18*e4b17023SJohn Marino    file.  (The Lesser General Public License restrictions do apply in
19*e4b17023SJohn Marino    other respects; for example, they cover modification of the file,
20*e4b17023SJohn Marino    and distribution when not linked into a combine executable.)
21*e4b17023SJohn Marino 
22*e4b17023SJohn Marino    The GNU C Library is distributed in the hope that it will be useful,
23*e4b17023SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
24*e4b17023SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25*e4b17023SJohn Marino    Lesser General Public License for more details.
26*e4b17023SJohn Marino 
27*e4b17023SJohn Marino    You should have received a copy of the GNU Lesser General Public
28*e4b17023SJohn Marino    License along with the GNU C Library; if not, see
29*e4b17023SJohn Marino    <http://www.gnu.org/licenses/>.  */
30*e4b17023SJohn Marino 
31*e4b17023SJohn Marino #include "soft-fp.h"
32*e4b17023SJohn Marino #include "quad.h"
33*e4b17023SJohn Marino 
__addtf3(TFtype a,TFtype b)34*e4b17023SJohn Marino TFtype __addtf3(TFtype a, TFtype b)
35*e4b17023SJohn Marino {
36*e4b17023SJohn Marino   FP_DECL_EX;
37*e4b17023SJohn Marino   FP_DECL_Q(A); FP_DECL_Q(B); FP_DECL_Q(R);
38*e4b17023SJohn Marino   TFtype r;
39*e4b17023SJohn Marino 
40*e4b17023SJohn Marino   FP_INIT_ROUNDMODE;
41*e4b17023SJohn Marino   FP_UNPACK_SEMIRAW_Q(A, a);
42*e4b17023SJohn Marino   FP_UNPACK_SEMIRAW_Q(B, b);
43*e4b17023SJohn Marino   FP_ADD_Q(R, A, B);
44*e4b17023SJohn Marino   FP_PACK_SEMIRAW_Q(r, R);
45*e4b17023SJohn Marino   FP_HANDLE_EXCEPTIONS;
46*e4b17023SJohn Marino 
47*e4b17023SJohn Marino   return r;
48*e4b17023SJohn Marino }
49