]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/Aarch64/machine/fenv.h
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / StdLib / Include / Aarch64 / machine / fenv.h
1 /* $NetBSD: fenv.h,v 1.2 2014/01/29 00:22:09 matt Exp $ */
2
3 /*
4 * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995
5 * Public domain.
6 */
7
8 #ifndef _AARCH64_FENV_H_
9 #define _AARCH64_FENV_H_
10
11 /* AArch64 split FPSCR into two registers FPCR and FPSR */
12 typedef struct {
13 unsigned int __fpcr;
14 unsigned int __fpsr;
15 } fenv_t;
16 typedef int fexcept_t;
17
18 #define FE_INVALID 0x01 /* invalid operation exception */
19 #define FE_DIVBYZERO 0x02 /* divide-by-zero exception */
20 #define FE_OVERFLOW 0x04 /* overflow exception */
21 #define FE_UNDERFLOW 0x08 /* underflow exception */
22 #define FE_INEXACT 0x10 /* imprecise (loss of precision; "inexact") */
23
24 #define FE_ALL_EXCEPT 0x1f
25
26 #define FE_TONEAREST 0 /* round to nearest representable number */
27 #define FE_UPWARD 1 /* round toward positive infinity */
28 #define FE_DOWNWARD 2 /* round toward negative infinity */
29 #define FE_TOWARDZERO 3 /* round to zero (truncate) */
30
31 __BEGIN_DECLS
32
33 /* Default floating-point environment */
34 extern const fenv_t __fe_dfl_env;
35 #define FE_DFL_ENV (&__fe_dfl_env)
36
37 __END_DECLS
38
39 #endif /* _AARCH64_FENV_H_ */