1 /* Floating point environment, RISC-V version.
2    Copyright (C) 1998-2018 Free Software Foundation, Inc.
3 
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8 
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13 
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library.  If not, see
16    <http://www.gnu.org/licenses/>.  */
17 
18 #ifndef _FENV_H
19 # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
20 #endif
21 
22 enum
23   {
24     FE_INEXACT   =
25 #define FE_INEXACT	(0x01)
26       FE_INEXACT,
27     FE_UNDERFLOW =
28 #define FE_UNDERFLOW	(0x02)
29       FE_UNDERFLOW,
30     FE_OVERFLOW  =
31 #define FE_OVERFLOW	(0x04)
32       FE_OVERFLOW,
33     FE_DIVBYZERO =
34 #define FE_DIVBYZERO	(0x08)
35       FE_DIVBYZERO,
36     FE_INVALID   =
37 #define FE_INVALID	(0x10)
38       FE_INVALID
39   };
40 
41 #define FE_ALL_EXCEPT \
42 	(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
43 
44 enum
45   {
46     FE_TONEAREST  =
47 #define FE_TONEAREST	(0x0)
48       FE_TONEAREST,
49     FE_TOWARDZERO =
50 #define FE_TOWARDZERO	(0x1)
51       FE_TOWARDZERO,
52     FE_DOWNWARD   =
53 #define FE_DOWNWARD	(0x2)
54       FE_DOWNWARD,
55     FE_UPWARD     =
56 #define FE_UPWARD	(0x3)
57       FE_UPWARD
58   };
59 
60 
61 typedef unsigned int fexcept_t;
62 typedef unsigned int fenv_t;
63 
64 /* If the default argument is used we use this value.  */
65 #define FE_DFL_ENV	((__const fenv_t *) -1)
66 
67 /* Type representing floating-point control modes.  */
68 typedef unsigned int femode_t;
69 
70 /* Default floating-point control modes.  */
71 # define FE_DFL_MODE	((const femode_t *) -1L)
72