mirror of
https://sourceware.org/git/glibc.git
synced 2025-10-12 19:04:54 +03:00
math: Add math-use-builtinds-fmax.h
It allows the architecture to use the builtin instead of generic implementation.
This commit is contained in:
@@ -17,10 +17,14 @@
|
|||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <math-use-builtins.h>
|
||||||
|
|
||||||
FLOAT
|
FLOAT
|
||||||
M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y)
|
M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y)
|
||||||
{
|
{
|
||||||
|
#if M_USE_BUILTIN (FMAX)
|
||||||
|
return M_SUF (__builtin_fmax) (x, y);
|
||||||
|
#else
|
||||||
if (isgreaterequal (x, y))
|
if (isgreaterequal (x, y))
|
||||||
return x;
|
return x;
|
||||||
else if (isless (x, y))
|
else if (isless (x, y))
|
||||||
@@ -29,6 +33,7 @@ M_DECL_FUNC (__fmax) (FLOAT x, FLOAT y)
|
|||||||
return x + y;
|
return x + y;
|
||||||
else
|
else
|
||||||
return isnan (y) ? x : y;
|
return isnan (y) ? x : y;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
declare_mgen_alias (__fmax, fmax);
|
declare_mgen_alias (__fmax, fmax);
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#define FLOAT double
|
#define FLOAT double
|
||||||
#define CFLOAT _Complex double
|
#define CFLOAT _Complex double
|
||||||
#define M_STRTO_NAN __strtod_nan
|
#define M_STRTO_NAN __strtod_nan
|
||||||
|
#define M_USE_BUILTIN(c) USE_ ##c ##_BUILTIN
|
||||||
|
|
||||||
#include <libm-alias-double.h>
|
#include <libm-alias-double.h>
|
||||||
#include <math-nan-payload-double.h>
|
#include <math-nan-payload-double.h>
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#define FLOAT float
|
#define FLOAT float
|
||||||
#define CFLOAT _Complex float
|
#define CFLOAT _Complex float
|
||||||
#define M_STRTO_NAN __strtof_nan
|
#define M_STRTO_NAN __strtof_nan
|
||||||
|
#define M_USE_BUILTIN(c) USE_ ##c ##F_BUILTIN
|
||||||
|
|
||||||
/* Standard/GNU macro literals do not exist for the float type. Use
|
/* Standard/GNU macro literals do not exist for the float type. Use
|
||||||
the double macro constants. */
|
the double macro constants. */
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#define M_SUF(c) c ## f128
|
#define M_SUF(c) c ## f128
|
||||||
#define FLOAT _Float128
|
#define FLOAT _Float128
|
||||||
#define M_STRTO_NAN __strtof128_nan
|
#define M_STRTO_NAN __strtof128_nan
|
||||||
|
#define M_USE_BUILTIN(c) USE_ ##c ##F128_BUILTIN
|
||||||
|
|
||||||
#define CFLOAT __CFLOAT128
|
#define CFLOAT __CFLOAT128
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#define FLOAT long double
|
#define FLOAT long double
|
||||||
#define CFLOAT _Complex long double
|
#define CFLOAT _Complex long double
|
||||||
#define M_STRTO_NAN __strtold_nan
|
#define M_STRTO_NAN __strtold_nan
|
||||||
|
#define M_USE_BUILTIN(c) USE_ ##c ##L_BUILTIN
|
||||||
|
|
||||||
#include <libm-alias-ldouble.h>
|
#include <libm-alias-ldouble.h>
|
||||||
#include <math-nan-payload-ldouble.h>
|
#include <math-nan-payload-ldouble.h>
|
||||||
|
4
sysdeps/generic/math-use-builtins-fmax.h
Normal file
4
sysdeps/generic/math-use-builtins-fmax.h
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#define USE_FMAX_BUILTIN 0
|
||||||
|
#define USE_FMAXF_BUILTIN 0
|
||||||
|
#define USE_FMAXL_BUILTIN 0
|
||||||
|
#define USE_FMAXF128_BUILTIN 0
|
@@ -34,5 +34,6 @@
|
|||||||
#include <math-use-builtins-copysign.h>
|
#include <math-use-builtins-copysign.h>
|
||||||
#include <math-use-builtins-sqrt.h>
|
#include <math-use-builtins-sqrt.h>
|
||||||
#include <math-use-builtins-fma.h>
|
#include <math-use-builtins-fma.h>
|
||||||
|
#include <math-use-builtins-fmax.h>
|
||||||
|
|
||||||
#endif /* MATH_USE_BUILTINS_H */
|
#endif /* MATH_USE_BUILTINS_H */
|
||||||
|
Reference in New Issue
Block a user