1 /* Copyright (C) 2000-2016 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Denis Joseph Barrow <djbarrow@de.ibm.com>.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
20 # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
23 /* Define bits representing the exception. We use the bit positions
24 of the appropriate bits in the FPU control word. */
28 #define FE_INVALID 0x80
31 #define FE_DIVBYZERO 0x40
34 #define FE_OVERFLOW 0x20
37 #define FE_UNDERFLOW 0x10
40 #define FE_INEXACT 0x08
43 /* We dont use the y bit of the DXC in the floating point control register
44 as glibc has no FE encoding for fe inexact incremented
45 or fe inexact truncated.
46 We currently use the flag bits in the fpc
47 as these are sticky for feholdenv & feupdatenv as it is defined
48 in the HP Manpages. */
51 #define FE_ALL_EXCEPT \
52 (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
57 #define FE_TONEAREST 0
60 #define FE_DOWNWARD 0x3
66 #define FE_TOWARDZERO 0x1
71 /* Type representing exception flags. */
72 typedef unsigned int fexcept_t
; /* size of fpc */
75 /* Type representing floating-point environment. This function corresponds
76 to the layout of the block written by the `fstenv'. */
81 /* The field __unused (formerly __ieee_instruction_pointer) is a relict from
82 commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59)
83 and isnĀ“t used anymore. */
86 /* If the default argument is used we use this value. */
87 #define FE_DFL_ENV ((const fenv_t *) -1)
90 /* Floating-point environment where none of the exceptions are masked. */
91 # define FE_NOMASK_ENV ((const fenv_t *) -2)
94 #if __GLIBC_USE (IEC_60559_BFP_EXT)
95 /* Type representing floating-point control modes. */
96 typedef unsigned int femode_t
;
98 /* Default floating-point control modes. */
99 # define FE_DFL_MODE ((const femode_t *) -1L)