]>
Commit | Line | Data |
---|---|---|
3352b62b N |
1 | /* $NetBSD: ieeefp.h,v 1.3 2013/04/23 05:42:23 matt Exp $ */\r |
2 | /** @file\r | |
3 | *\r | |
4 | * Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.\r | |
5 | *\r | |
6 | * This program and the accompanying materials\r | |
7 | * are licensed and made available under the terms and conditions of the BSD License\r | |
8 | * which accompanies this distribution. The full text of the license may be found at\r | |
9 | * http://opensource.org/licenses/bsd-license.php\r | |
10 | *\r | |
11 | * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | *\r | |
14 | **/\r | |
15 | /*\r | |
16 | * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995\r | |
17 | * Public domain.\r | |
18 | */\r | |
19 | \r | |
20 | #ifndef _ARM_IEEEFP_H_\r | |
21 | #define _ARM_IEEEFP_H_\r | |
22 | \r | |
23 | #include <LibConfig.h>\r | |
24 | #include <sys/featuretest.h>\r | |
25 | \r | |
26 | #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)\r | |
27 | \r | |
28 | //#include <arm/fenv.h>\r | |
29 | #include <machine/fenv.h>\r | |
30 | \r | |
31 | #if !defined(_ISOC99_SOURCE)\r | |
32 | \r | |
33 | /* Exception type (used by fpsetmask() et al.) */\r | |
34 | \r | |
35 | typedef int fp_except;\r | |
36 | \r | |
37 | /* Bit defines for fp_except */\r | |
38 | \r | |
39 | #define FP_X_INV FE_INVALID /* invalid operation exception */\r | |
40 | #define FP_X_DZ FE_DIVBYZERO /* divide-by-zero exception */\r | |
41 | #define FP_X_OFL FE_OVERFLOW /* overflow exception */\r | |
42 | #define FP_X_UFL FE_UNDERFLOW /* underflow exception */\r | |
43 | #define FP_X_IMP FE_INEXACT /* imprecise (prec. loss; "inexact") */\r | |
44 | \r | |
45 | /* Rounding modes */\r | |
46 | \r | |
47 | typedef enum {\r | |
48 | FP_RN=FE_TONEAREST, /* round to nearest representable number */\r | |
49 | FP_RP=FE_UPWARD, /* round toward positive infinity */\r | |
50 | FP_RM=FE_DOWNWARD, /* round toward negative infinity */\r | |
51 | FP_RZ=FE_TOWARDZERO /* round to zero (truncate) */\r | |
52 | } fp_rnd;\r | |
53 | \r | |
54 | #endif /* !_ISOC99_SOURCE */\r | |
55 | \r | |
56 | #endif /* _NETBSD_SOURCE || _ISOC99_SOURCE */\r | |
57 | \r | |
58 | #endif /* _ARM_IEEEFP_H_ */\r |