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