diff options
author | Harry Liebel <Harry.Liebel@arm.com> | 2015-07-30 09:51:04 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-07-30 09:51:04 +0000 |
commit | 1bbb83b5267b8a6701a6acae504a2b2e6b5db569 (patch) | |
tree | c42482da4a77a01d4c4910a5fc89035aa6df3fa1 /StdLib/Include/Aarch64/machine/fenv.h | |
parent | d799c0283259ed7709055aca3871e8f67f38610a (diff) | |
download | edk2-1bbb83b5267b8a6701a6acae504a2b2e6b5db569.tar.gz edk2-1bbb83b5267b8a6701a6acae504a2b2e6b5db569.tar.bz2 edk2-1bbb83b5267b8a6701a6acae504a2b2e6b5db569.zip |
StdLib: Add support for AArch64
- Use some files from ARM version.
- Use NetBSD software floating point library to provide floating point
operations not handled directly by hardware floating point enabled
GCC compiler.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Harry Liebel <Harry.Liebel@arm.com>
Reviewed-by: Olivier Martin <Olivier.Martin@arm.com>
Reviewed-by: Daryl McDaniel <edk2-lists@mc2research.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18118 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/Include/Aarch64/machine/fenv.h')
-rw-r--r-- | StdLib/Include/Aarch64/machine/fenv.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/StdLib/Include/Aarch64/machine/fenv.h b/StdLib/Include/Aarch64/machine/fenv.h new file mode 100644 index 0000000000..8e255f56d3 --- /dev/null +++ b/StdLib/Include/Aarch64/machine/fenv.h @@ -0,0 +1,39 @@ +/* $NetBSD: fenv.h,v 1.2 2014/01/29 00:22:09 matt Exp $ */
+
+/*
+ * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995
+ * Public domain.
+ */
+
+#ifndef _AARCH64_FENV_H_
+#define _AARCH64_FENV_H_
+
+/* AArch64 split FPSCR into two registers FPCR and FPSR */
+typedef struct {
+ unsigned int __fpcr;
+ unsigned int __fpsr;
+} fenv_t;
+typedef int fexcept_t;
+
+#define FE_INVALID 0x01 /* invalid operation exception */
+#define FE_DIVBYZERO 0x02 /* divide-by-zero exception */
+#define FE_OVERFLOW 0x04 /* overflow exception */
+#define FE_UNDERFLOW 0x08 /* underflow exception */
+#define FE_INEXACT 0x10 /* imprecise (loss of precision; "inexact") */
+
+#define FE_ALL_EXCEPT 0x1f
+
+#define FE_TONEAREST 0 /* round to nearest representable number */
+#define FE_UPWARD 1 /* round toward positive infinity */
+#define FE_DOWNWARD 2 /* round toward negative infinity */
+#define FE_TOWARDZERO 3 /* round to zero (truncate) */
+
+__BEGIN_DECLS
+
+/* Default floating-point environment */
+extern const fenv_t __fe_dfl_env;
+#define FE_DFL_ENV (&__fe_dfl_env)
+
+__END_DECLS
+
+#endif /* _AARCH64_FENV_H_ */
|