From 1bd3f1e4c46c8b1b8efec0628634f075d004d0f1 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 10 Feb 2020 17:22:59 +0100 Subject: [PATCH] Really sync with OpenBSD on the vendor branch. --- contrib/openbsd_libm/include/global/math.h | 56 +++++++++++++--------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/contrib/openbsd_libm/include/global/math.h b/contrib/openbsd_libm/include/global/math.h index 02e1417ab7..e6dd268c7f 100644 --- a/contrib/openbsd_libm/include/global/math.h +++ b/contrib/openbsd_libm/include/global/math.h @@ -1,4 +1,4 @@ -/* $OpenBSD: math.h,v 1.33 2014/05/03 16:13:03 martynas Exp $ */ +/* $OpenBSD: math.h,v 1.36 2018/03/10 20:52:58 kettenis Exp $ */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -25,11 +25,11 @@ __BEGIN_DECLS * ANSI/POSIX */ extern char __infinity[]; -#if __GNUC_PREREQ__(3, 3) && !defined(__vax__) +#if __GNUC_PREREQ__(3, 3) #define HUGE_VAL __builtin_huge_val() -#else /* __GNUC_PREREQ__(3, 3) && !__vax__ */ +#else /* __GNUC_PREREQ__(3, 3) */ #define HUGE_VAL (*(double *)(void *)__infinity) -#endif /* __GNUC_PREREQ__(3, 3) && !__vax__ */ +#endif /* __GNUC_PREREQ__(3, 3) */ /* * C99 @@ -38,25 +38,18 @@ extern char __infinity[]; typedef __double_t double_t; typedef __float_t float_t; -#if __GNUC_PREREQ__(3, 3) && !defined(__vax__) +#if __GNUC_PREREQ__(3, 3) #define HUGE_VALF __builtin_huge_valf() #define HUGE_VALL __builtin_huge_vall() #define INFINITY __builtin_inff() #define NAN __builtin_nanf("") -#else /* __GNUC_PREREQ__(3, 3) && !__vax__ */ -#ifdef __vax__ -extern char __infinityf[]; -#define HUGE_VALF (*(float *)(void *)__infinityf) -#else /* __vax__ */ +#else /* __GNUC_PREREQ__(3, 3) */ #define HUGE_VALF ((float)HUGE_VAL) -#endif /* __vax__ */ #define HUGE_VALL ((long double)HUGE_VAL) #define INFINITY HUGE_VALF -#ifndef __vax__ extern char __nan[]; #define NAN (*(float *)(void *)__nan) -#endif /* !__vax__ */ -#endif /* __GNUC_PREREQ__(3, 3) && !__vax__ */ +#endif /* __GNUC_PREREQ__(3, 3) */ #define FP_INFINITE 0x01 #define FP_NAN 0x02 @@ -67,6 +60,22 @@ extern char __nan[]; #define FP_ILOGB0 (-INT_MAX) #define FP_ILOGBNAN INT_MAX +#ifdef __FP_FAST_FMA +#define FP_FAST_FMA 1 +#endif /* __FP_FAST_FMA */ + +#ifdef __FP_FAST_FMAF +#define FP_FAST_FMAF 1 +#endif /* __FP_FAST_FMAF */ + +#ifdef __FP_FAST_FMAL +#define FP_FAST_FMAL 1 +#endif /* __FP_FAST_FMAL */ + +#define MATH_ERRNO 1 +#define MATH_ERREXCEPT 2 +#define math_errhandling MATH_ERREXCEPT + #define fpclassify(x) \ ((sizeof (x) == sizeof (float)) ? \ __fpclassifyf(x) \ @@ -132,11 +141,7 @@ extern char __nan[]; #define M_SQRT2 ((double)1.41421356237309504880) /* sqrt(2) */ #define M_SQRT1_2 ((double)0.70710678118654752440) /* 1/sqrt(2) */ -#ifdef __vax__ -#define MAXFLOAT ((float)1.70141173319264430e+38) -#else #define MAXFLOAT ((float)3.40282346638528860e+38) -#endif /* __vax__ */ extern int signgam; #endif /* __BSD_VISIBLE || __XPG_VISIBLE */ @@ -268,6 +273,8 @@ int finite(double); double gamma_r(double, int *); double lgamma_r(double, int *); +void sincos(double, double *, double *); + /* * IEEE Test Vector */ @@ -377,6 +384,8 @@ int isnanf(float); float gammaf_r(float, int *); float lgammaf_r(float, int *); +void sincosf(float, float *, float *); + /* * Float version of IEEE Test Vector */ @@ -455,6 +464,13 @@ long double fminl(long double, long double); long double fmal(long double, long double, long double); #endif /* __ISO_C_VISIBLE >= 1999 */ +/* + * Long double versions of BSD math library entry points + */ +#if __BSD_VISIBLE +void sincosl(long double, long double *, long double *); +#endif + /* * Library implementation */ @@ -476,10 +492,6 @@ int __isnormall(long double); int __signbit(double); int __signbitf(float); int __signbitl(long double); - -#if __BSD_VISIBLE && defined(__vax__) -double infnan(int); -#endif /* __BSD_VISIBLE && defined(__vax__) */ __END_DECLS #endif /* !_MATH_H_ */ -- 2.41.0