qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] updated fpu/softfloat-native.h patch


From: Ben Taylor
Subject: [Qemu-devel] updated fpu/softfloat-native.h patch
Date: Thu, 27 Apr 2006 8:13:33 -0400

Here is an updated patch that collapses the hackery need to get Solaris
compiling with changes to fpu/softfloat-native.h

apologies if the patch ends up mangled.  The new webmail interface has been 
mangling attachments.

Ben


diff -ruN qemu/configure qemu-2/configure
--- qemu/configure      2006-04-26 12:07:35.000000000 -0400
+++ qemu-2/configure    2006-04-27 02:46:01.988208000 -0400
@@ -148,9 +148,6 @@
     make="gmake"
     install="ginstall"
     solarisrev=`uname -r | cut -f2 -d.`
-    if test $solarisrev -lt 10 ; then
-      presolaris10="yes"
-    fi
 fi

 # find source path
@@ -640,9 +637,7 @@
 fi
 if test "$solaris" = "yes" ; then
   echo "CONFIG_SOLARIS=yes" >> $config_mak
-  if test "$presolaris10" = "yes" ; then
-    echo "#define _PRESOLARIS10 1" >> $config_h
-  fi
+    echo "#define SOLARISREV $solarisrev" >> $config_h
 fi
 if test "$gdbstub" = "yes" ; then
   echo "CONFIG_GDBSTUB=yes" >> $config_mak
diff -ruN qemu/fpu/softfloat-native.h qemu-2/fpu/softfloat-native.h
--- qemu/fpu/softfloat-native.h 2006-04-26 11:55:55.000000000 -0400
+++ qemu-2/fpu/softfloat-native.h       2006-04-27 03:11:50.811813000 -0400
@@ -1,13 +1,61 @@
 /* Native implementation of soft float functions */
 #include <math.h>
-#if defined(_BSD) && !defined(__APPLE__)
+
+/*
+ * include <ieeefp.h> if __sun__ or ( *BSD and not APPLE)
+ */
+#if defined(__sun__) || ( defined(_BSD) && !defined(__APPLE__))
 #include <ieeefp.h>
-#else
-#if !defined(_PRESOLARIS10)
+#endif
+
+/*
+ * include <fenv.h> if ( APPLE and not *BSD ), including
+ * Solaris systems OS greater than 9
+ */
+#if !defined(_BSD) || defined(__APPLE__)
+/*
+ * define some things needed to compile qemu on Solaris 8/9
+ * since <fenv.h> is not available those versions of Solaris.
+ */
+#if ( SOLARISREV <= 9 )
+#define FE_TONEAREST   0
+#define FE_DOWNWARD    1
+#define FE_UPWARD      2
+#define FE_TOWARDZERO  3
+#define fabsf(f)((float)fabs(f))
+else
 #include <fenv.h>
 #endif
 #endif

+
+#if defined(__sun__)
+/*
+ * 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 ( SOLARISREV <= 9 ) || ( ( SOLARISREV >= 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
+#endif
+
 typedef float float32;
 typedef double float64;
 #ifdef FLOATX80






reply via email to

[Prev in Thread] Current Thread [Next in Thread]