]> git.ipfire.org Git - thirdparty/glibc.git/blame - soft-fp/fmadf4.c
nptl: Add tst-robust-fork
[thirdparty/glibc.git] / soft-fp / fmadf4.c
CommitLineData
77f01ab5 1/* Implement fma using soft-fp.
bfff8b1b 2 Copyright (C) 2013-2017 Free Software Foundation, Inc.
77f01ab5
JM
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
dc6b5aed 28#include <libc-internal.h>
37430363
SE
29#include <sys/cdefs.h>
30/* R_e is not set in cases where it is not used in packing, but the
31 compiler does not see that it is set in all cases where it is
32 used, resulting in warnings that it may be used uninitialized.
33 The location of the warning differs in different versions of GCC,
34 it may be where R is defined using a macro or it may be where the
35 macro is defined. */
36DIAG_PUSH_NEEDS_COMMENT;
37430363 37DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wmaybe-uninitialized");
77f01ab5
JM
38#include <math.h>
39#include "soft-fp.h"
40#include "double.h"
41
42double
43__fma (double a, double b, double c)
44{
45 FP_DECL_EX;
51ca9e29
JM
46 FP_DECL_D (A);
47 FP_DECL_D (B);
48 FP_DECL_D (C);
49 FP_DECL_D (R);
77f01ab5
JM
50 double r;
51
52 FP_INIT_ROUNDMODE;
51ca9e29
JM
53 FP_UNPACK_D (A, a);
54 FP_UNPACK_D (B, b);
55 FP_UNPACK_D (C, c);
56 FP_FMA_D (R, A, B, C);
57 FP_PACK_D (r, R);
77f01ab5
JM
58 FP_HANDLE_EXCEPTIONS;
59
60 return r;
61}
37430363
SE
62DIAG_POP_NEEDS_COMMENT;
63
77f01ab5
JM
64#ifndef __fma
65weak_alias (__fma, fma)
66#endif
67
68#ifdef NO_LONG_DOUBLE
69strong_alias (__fma, __fmal)
70weak_alias (__fmal, fmal)
71#endif