diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -34,35 +34,16 @@ float __uf; } __nan; -#if __GNUC_PREREQ__(3, 3) -#define __MATH_BUILTIN_CONSTANTS -#endif - -#if __GNUC_PREREQ__(3, 0) -#define __MATH_BUILTIN_RELOPS -#endif - -#ifdef __MATH_BUILTIN_CONSTANTS #define HUGE_VAL __builtin_huge_val() -#else -#define HUGE_VAL (__infinity.__ud) -#endif #if __ISO_C_VISIBLE >= 1999 #define FP_ILOGB0 (-__INT_MAX) #define FP_ILOGBNAN __INT_MAX -#ifdef __MATH_BUILTIN_CONSTANTS #define HUGE_VALF __builtin_huge_valf() #define HUGE_VALL __builtin_huge_vall() #define INFINITY __builtin_inff() #define NAN __builtin_nanf("") -#else -#define HUGE_VALF (float)HUGE_VAL -#define HUGE_VALL (long double)HUGE_VAL -#define INFINITY HUGE_VALF -#define NAN (__nan.__uf) -#endif /* __MATH_BUILTIN_CONSTANTS */ #define MATH_ERRNO 1 #define MATH_ERREXCEPT 2 @@ -82,7 +63,7 @@ float: f(x), \ double: d(x), \ long double: ld(x)) -#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) +#elif !defined(__cplusplus) #define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ __builtin_choose_expr( \ @@ -103,24 +84,12 @@ #define isnan(x) \ __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl) #define isnormal(x) __fp_type_select(x, __isnormalf, __isnormal, __isnormall) - -#ifdef __MATH_BUILTIN_RELOPS #define isgreater(x, y) __builtin_isgreater((x), (y)) #define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) #define isless(x, y) __builtin_isless((x), (y)) #define islessequal(x, y) __builtin_islessequal((x), (y)) #define islessgreater(x, y) __builtin_islessgreater((x), (y)) #define isunordered(x, y) __builtin_isunordered((x), (y)) -#else -#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y)) -#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y)) -#define isless(x, y) (!isunordered((x), (y)) && (x) < (y)) -#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y)) -#define islessgreater(x, y) (!isunordered((x), (y)) && \ - ((x) > (y) || (y) > (x))) -#define isunordered(x, y) (isnan(x) || isnan(y)) -#endif /* __MATH_BUILTIN_RELOPS */ - #define signbit(x) __fp_type_select(x, __signbitf, __signbit, __signbitl) typedef __double_t double_t;