summaryrefslogtreecommitdiff
path: root/src/base/fenv.hh
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-04-21 17:50:47 -0400
committerAli Saidi <saidi@eecs.umich.edu>2007-04-21 17:50:47 -0400
commite8ace88e897a4b0f61526ac0fe88740d337f0509 (patch)
treebf3b1eb65aea520338da80271333406d2aecc17c /src/base/fenv.hh
parent5825104982d75daee20cd82da3ea2581c31d5292 (diff)
downloadgem5-e8ace88e897a4b0f61526ac0fe88740d337f0509.tar.xz
create base/fenv.c to standerdize fenv across platforms. It's a c file and not a cpp file because c99
(which defines fenv) doesn't necessarily extend to c++ and it is a problem with solaris. If really desired this could wrap the ieeefp interface found in bsd* as well, but I see no need at the moment. src/arch/alpha/isa/fp.isa: src/arch/sparc/isa/formats/basic.isa: use m5_fesetround()/m5_fegetround() istead of fenv interface directly src/arch/sparc/isa/includes.isa: use base/fenv instead of fenv directly src/base/SConscript: add fenv to sconscript src/base/fenv.hh: src/base/random.cc: m5 implementation to standerdize fenv across platforms. --HG-- extra : convert_revision : 38d2629affd964dcd1a5ab0db4ac3cb21438e72c
Diffstat (limited to 'src/base/fenv.hh')
-rw-r--r--src/base/fenv.hh21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/base/fenv.hh b/src/base/fenv.hh
index 013d2f09b..42b383888 100644
--- a/src/base/fenv.hh
+++ b/src/base/fenv.hh
@@ -33,20 +33,21 @@
#include "config/use_fenv.hh"
-#if USE_FENV
-
-#include <fenv.h>
+#define M5_FE_DOWNWARD 0
+#define M5_FE_TONEAREST 1
+#define M5_FE_TOWARDZERO 2
+#define M5_FE_UPWARD 3
+#if USE_FENV
+extern "C" {
+void m5_fesetround(int rm);
+int m5_fegetround();
+}
#else
// Dummy definitions to allow code to compile w/o a real <fenv.h>.
-
-#define FE_TONEAREST 0
-#define FE_DOWNWARD 0
-#define FE_UPWARD 0
-#define FE_TOWARDZERO 0
-
-inline int fesetround(int rounding_mode) { return 0; }
+inline void m5_fesetround(int rm) { ; }
+inline int m5_fegetround() {return 0; }
#endif // USE_FENV