summaryrefslogtreecommitdiff
path: root/fpu
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-01 13:58:07 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-05-01 13:58:07 +0000
commit38cfa06cbd27375226acf06083aa4301b085cbf2 (patch)
treee61eb368e8824f741b9801fbb479a9303840a983 /fpu
parente035649ea3d6d3f845c4ffd686f00dedb9999292 (diff)
downloadqemu-38cfa06cbd27375226acf06083aa4301b085cbf2.tar.gz
Solaris port (Ben Taylor)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1888 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'fpu')
-rw-r--r--fpu/softfloat-native.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h
index b0264d52e1..e7c08b89f4 100644
--- a/fpu/softfloat-native.h
+++ b/fpu/softfloat-native.h
@@ -1,11 +1,36 @@
/* Native implementation of soft float functions */
#include <math.h>
-#if defined(_BSD) && !defined(__APPLE__)
+
+#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
#include <ieeefp.h>
+#define fabsf(f) ((float)fabs(f))
#else
-#if !defined(_PRESOLARIS10)
#include <fenv.h>
#endif
+
+/*
+ * Define some C99-7.12.3 classification macros and
+ * some C99-.12.4 for Solaris systems OS less than 10,
+ * or Solaris 10 systems running GCC 3.x or less.
+ * Solaris 10 with GCC4 does not need these macros as they
+ * are defined in <iso/math_c99.h> with a compiler directive
+ */
+#if defined(HOST_SOLARIS) && (( HOST_SOLARIS <= 9 ) || ( ( HOST_SOLARIS >= 10 ) && ( __GNUC__ <= 4) ))
+/*
+ * C99 7.12.3 classification macros
+ * and
+ * C99 7.12.14 comparison macros
+ *
+ * ... do not work on Solaris 10 using GNU CC 3.4.x.
+ * Try to workaround the missing / broken C99 math macros.
+ */
+
+#define isnormal(x) (fpclass(x) >= FP_NZERO)
+#define isgreater(x, y) ((!unordered(x, y)) && ((x) > (y)))
+#define isgreaterequal(x, y) ((!unordered(x, y)) && ((x) >= (y)))
+#define isless(x, y) ((!unordered(x, y)) && ((x) < (y)))
+#define islessequal(x, y) ((!unordered(x, y)) && ((x) <= (y)))
+#define isunordered(x,y) unordered(x, y)
#endif
typedef float float32;
@@ -35,7 +60,7 @@ typedef union {
/*----------------------------------------------------------------------------
| Software IEC/IEEE floating-point rounding mode.
*----------------------------------------------------------------------------*/
-#if defined(_BSD) && !defined(__APPLE__)
+#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
enum {
float_round_nearest_even = FP_RN,
float_round_down = FP_RM,