Move all files into ports/ subdirectory in preparation for merge with glibc
[jlayton/glibc.git] / ports / sysdeps / am33 / fpu / bits / fenv.h
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.
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 = 0x01,
30 #define FE_INEXACT      FE_INEXACT
31     FE_UNDERFLOW = 0x02,
32 #define FE_UNDERFLOW    FE_UNDERFLOW
33     FE_OVERFLOW = 0x04,
34 #define FE_OVERFLOW     FE_OVERFLOW
35     FE_DIVBYZERO = 0x08,
36 #define FE_DIVBYZERO    FE_DIVBYZERO
37     FE_INVALID = 0x10,
38 #define FE_INVALID      FE_INVALID
39   };
40
41 #define FE_ALL_EXCEPT \
42         (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
43
44 /* The AM33/2.0 FPU supports only Round to nearest.  Bits 3<<16 are
45    reserved to represent other rounding modes.  */
46 enum
47   {
48     FE_TONEAREST = 0x00000,
49 #define FE_TONEAREST    FE_TONEAREST
50   };
51
52
53 /* Type representing exception flags.  */
54 typedef unsigned int fexcept_t;
55
56
57 /* Type representing floating-point environment.  */
58 typedef unsigned int fenv_t;
59
60 /* If the default argument is used we use this value.  */
61 #define FE_DFL_ENV      ((__const fenv_t *) -1)
62
63 #ifdef __USE_GNU
64 /* Floating-point environment where none of the exception is masked.  */
65 # define FE_NOMASK_ENV  ((__const fenv_t *) -2)
66 #endif