* [Qemu-devel] corrected fpu/softfloat-native.h patch
@ 2006-04-27 12:40 Ben Taylor
0 siblings, 0 replies; only message in thread
From: Ben Taylor @ 2006-04-27 12:40 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 223 bytes --]
Here is a corrected version of the patch. Fixed an else missing a #,
and changed the logic to do some defines for Solaris 8/9 as it doesn't
seem to like doing an #if defined(X) && (X <=Y)
patch works on Solaris 9 and 10.
[-- Attachment #2: solaris-softfloat-patch.diff --]
[-- Type: text/x-patch, Size: 2809 bytes --]
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 08:29:37.460606000 -0400
@@ -1,12 +1,62 @@
/* 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>
+#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 defined(SOLARISREV)
+#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
-#if !defined(_PRESOLARIS10)
#include <fenv.h>
#endif
#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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-27 12:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-27 12:40 [Qemu-devel] corrected fpu/softfloat-native.h patch Ben Taylor
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.