]>
Commit | Line | Data |
---|---|---|
3352b62b N |
1 | /* $NetBSD: fenv.h,v 1.2 2014/01/29 00:22:09 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_FENV_H_\r | |
21 | #define _ARM_FENV_H_\r | |
22 | \r | |
23 | #ifdef __ARM_PCS_AAPCS64\r | |
24 | /* AArch64 split FPSCR into two registers FPCR and FPSR */\r | |
25 | typedef struct {\r | |
26 | unsigned int __fpcr;\r | |
27 | unsigned int __fpsr;\r | |
28 | } fenv_t;\r | |
29 | #else\r | |
30 | typedef int fenv_t; /* FPSCR */\r | |
31 | #endif\r | |
32 | typedef int fexcept_t;\r | |
33 | \r | |
34 | #define FE_INVALID 0x01 /* invalid operation exception */\r | |
35 | #define FE_DIVBYZERO 0x02 /* divide-by-zero exception */\r | |
36 | #define FE_OVERFLOW 0x04 /* overflow exception */\r | |
37 | #define FE_UNDERFLOW 0x08 /* underflow exception */\r | |
38 | #define FE_INEXACT 0x10 /* imprecise (loss of precision; "inexact") */\r | |
39 | \r | |
40 | #define FE_ALL_EXCEPT 0x1f\r | |
41 | \r | |
42 | #define FE_TONEAREST 0 /* round to nearest representable number */\r | |
43 | #define FE_UPWARD 1 /* round toward positive infinity */\r | |
44 | #define FE_DOWNWARD 2 /* round toward negative infinity */\r | |
45 | #define FE_TOWARDZERO 3 /* round to zero (truncate) */\r | |
46 | \r | |
47 | __BEGIN_DECLS\r | |
48 | \r | |
49 | /* Default floating-point environment */\r | |
50 | extern const fenv_t __fe_dfl_env;\r | |
51 | #define FE_DFL_ENV (&__fe_dfl_env)\r | |
52 | \r | |
53 | __END_DECLS\r | |
54 | \r | |
55 | #endif /* _ARM_FENV_H_ */\r |