Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FaY2y-0003or-09 for qemu-devel@nongnu.org; Mon, 01 May 2006 09:02:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FaY2v-0003kv-O0 for qemu-devel@nongnu.org; Mon, 01 May 2006 09:02:38 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FaY2v-0003kP-6B for qemu-devel@nongnu.org; Mon, 01 May 2006 09:02:37 -0400 Received: from [68.230.240.35] (helo=eastrmmtao04.cox.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FaY6j-000238-Bm for qemu-devel@nongnu.org; Mon, 01 May 2006 09:06:33 -0400 Message-ID: <25099895.1146488553511.JavaMail.root@eastrmwml05.mgt.cox.net> Date: Mon, 1 May 2006 9:02:33 -0400 From: Ben Taylor MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_20235_10761208.1146488553170" Subject: [Qemu-devel] solaris configure and fpu/softfloat-native.h Reply-To: sol10x86@cox.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_20235_10761208.1146488553170 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit This is a minimal patch to configure and fpu/softfloat-native.h to get qemu to compile and run on Solaris 10. Compile support for Solaris 9 and Sparc will be updated in a different patch. Ben ------=_Part_20235_10761208.1146488553170 Content-Type: text/x-patch; name=solaris-fpu-sfnative.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=solaris-fpu-sfnative.diff diff -ruN qemu/configure qemu-solaris/configure --- qemu/configure 2006-04-29 19:05:22.000000000 -0400 +++ qemu-solaris/configure 2006-05-01 08:37:36.435003000 -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 HOST_SOLARIS $solarisrev" >> $config_h fi if test "$gdbstub" = "yes" ; then echo "CONFIG_GDBSTUB=yes" >> $config_mak diff -ruN qemu/fpu/softfloat-native.h qemu-solaris/fpu/softfloat-native.h --- qemu/fpu/softfloat-native.h 2006-05-01 08:41:49.614160000 -0400 +++ qemu-solaris/fpu/softfloat-native.h 2006-05-01 08:42:07.850655000 -0400 @@ -1,11 +1,36 @@ /* Native implementation of soft float functions */ #include -#if defined(_BSD) && !defined(__APPLE__) + +#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) #include +#define fabsf(f) ((float)fabs(f)) #else -#if !defined(_PRESOLARIS10) #include #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 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 @@ /*---------------------------------------------------------------------------- | 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, ------=_Part_20235_10761208.1146488553170--