2006-01-10 Roland McGrath <roland@redhat.com>
[glibc-ports.git] / sysdeps / am33 / fpu / bits / fenv.h
blob04fe293b139d8e868dcdc610af1d742024695079
1 /* Copyright (C) 1998, 1999, 2000, 2004 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.
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.
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.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 #ifndef _FENV_H
22 # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
23 #endif
26 /* Define bits representing the exception. We use the EF bit
27 positions of the appropriate bits in the FPCR register. */
28 enum
30 FE_INEXACT = 0x01,
31 #define FE_INEXACT FE_INEXACT
32 FE_UNDERFLOW = 0x02,
33 #define FE_UNDERFLOW FE_UNDERFLOW
34 FE_OVERFLOW = 0x04,
35 #define FE_OVERFLOW FE_OVERFLOW
36 FE_DIVBYZERO = 0x08,
37 #define FE_DIVBYZERO FE_DIVBYZERO
38 FE_INVALID = 0x10,
39 #define FE_INVALID FE_INVALID
42 #define FE_ALL_EXCEPT \
43 (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
45 /* The AM33/2.0 FPU supports only Round to nearest. Bits 3<<16 are
46 reserved to represent other rounding modes. */
47 enum
49 FE_TONEAREST = 0x00000,
50 #define FE_TONEAREST FE_TONEAREST
54 /* Type representing exception flags. */
55 typedef unsigned int fexcept_t;
58 /* Type representing floating-point environment. */
59 typedef unsigned int fenv_t;
61 /* If the default argument is used we use this value. */
62 #define FE_DFL_ENV ((__const fenv_t *) -1)
64 #ifdef __USE_GNU
65 /* Floating-point environment where none of the exception is masked. */
66 # define FE_NOMASK_ENV ((__const fenv_t *) -2)
67 #endif