1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
2 *
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
6
7 #include "fdlibm.h"
8
9 #if !_HAVE_FAST_FMAF
10
11 #if __FLT_EVAL_METHOD__ == 2 && defined(_HAVE_LONG_DOUBLE)
12
13 float
fmaf(float x,float y,float z)14 fmaf(float x, float y, float z)
15 {
16 return (float) fmal((long double) x, (long double) y, (long double) z);
17 }
18
19 #else
20
21 typedef float FLOAT_T;
22
23 #define FMA fmaf
24 #define NEXTAFTER nextafterf
25 #define LDEXP ldexpf
26 #define FREXP frexpf
27 #define SCALBN scalbnf
28 #define SPLIT (0x1p12f + 1.0f)
29 #define COPYSIGN copysignf
30 #define FLOAT_MANT_DIG __FLT_MANT_DIG__
31 #define FLOAT_MAX_EXP __FLT_MAX_EXP__
32 #define FLOAT_MIN __FLT_MIN__
33 #define ILOGB ilogbf
34
35 static inline int
odd_mant(FLOAT_T x)36 odd_mant(FLOAT_T x)
37 {
38 return asuint(x) & 1;
39 }
40
41 static unsigned int
EXPONENT(FLOAT_T x)42 EXPONENT(FLOAT_T x)
43 {
44 return _exponent32(asuint(x));
45 }
46
47 #include "fma_inc.h"
48
49 #endif
50
51 _MATH_ALIAS_f_fff(fma)
52
53 #endif
54