]> git.ipfire.org Git - thirdparty/glibc.git/blob - ports/sysdeps/am33/fpu/bits/fenv.h
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / ports / sysdeps / am33 / fpu / bits / fenv.h
1 /* Copyright (C) 1998-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Alexandre Oliva <aoliva@redhat.com>
4 based on the corresponding file in the mips port.
5
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library. If not, see
18 <http://www.gnu.org/licenses/>. */
19
20 #ifndef _FENV_H
21 # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
22 #endif
23
24
25 /* Define bits representing the exception. We use the EF bit
26 positions of the appropriate bits in the FPCR register. */
27 enum
28 {
29 FE_INEXACT =
30 #define FE_INEXACT 0x01
31 FE_INEXACT,
32 FE_UNDERFLOW =
33 #define FE_UNDERFLOW 0x02
34 FE_UNDERFLOW,
35 FE_OVERFLOW =
36 #define FE_OVERFLOW 0x04
37 FE_OVERFLOW,
38 FE_DIVBYZERO =
39 #define FE_DIVBYZERO 0x08
40 FE_DIVBYZERO,
41 FE_INVALID =
42 #define FE_INVALID 0x10
43 FE_INVALID,
44 };
45
46 #define FE_ALL_EXCEPT \
47 (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
48
49 /* The AM33/2.0 FPU supports only Round to nearest. Bits 3<<16 are
50 reserved to represent other rounding modes. */
51 enum
52 {
53 FE_TONEAREST =
54 #define FE_TONEAREST 0x00000
55 FE_TONEAREST,
56 };
57
58
59 /* Type representing exception flags. */
60 typedef unsigned int fexcept_t;
61
62
63 /* Type representing floating-point environment. */
64 typedef unsigned int fenv_t;
65
66 /* If the default argument is used we use this value. */
67 #define FE_DFL_ENV ((__const fenv_t *) -1)
68
69 #ifdef __USE_GNU
70 /* Floating-point environment where none of the exception is masked. */
71 # define FE_NOMASK_ENV ((__const fenv_t *) -2)
72 #endif