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