Browse Source

Define new C99 macros:

- MATH_ERRNO, MATH_ERREXCEPTION and math_errhandling
- Optional FP_FAST_FMA{,F,L} macros if fma() executes as fast or faster
than (x * y) + z;  which in practice is achievable if gcc implements
__FP_FAST_FMA{,F,L}
Reported by John Marino @ DragonFlyBSD.
OPENBSD_5_8
martynas 9 years ago
parent
commit
d17d076200
1 changed files with 17 additions and 1 deletions
  1. +17
    -1
      src/include/math.h

+ 17
- 1
src/include/math.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: math.h,v 1.33 2014/05/03 16:13:03 martynas Exp $ */
/* $OpenBSD: math.h,v 1.34 2015/07/19 17:41:49 martynas Exp $ */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@ -67,6 +67,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) \


Loading…
Cancel
Save