Commit 38cfa06cbd27375226acf06083aa4301b085cbf2

Authored by bellard
1 parent e035649e

Solaris port (Ben Taylor)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1888 c046a42c-6fe2-441c-8c8c-71466251a162
configure
... ... @@ -148,9 +148,6 @@ if [ "$solaris" = "yes" ] ; then
148 148 make="gmake"
149 149 install="ginstall"
150 150 solarisrev=`uname -r | cut -f2 -d.`
151   - if test $solarisrev -lt 10 ; then
152   - presolaris10="yes"
153   - fi
154 151 fi
155 152  
156 153 # find source path
... ... @@ -640,9 +637,7 @@ if test "$darwin" = "yes" ; then
640 637 fi
641 638 if test "$solaris" = "yes" ; then
642 639 echo "CONFIG_SOLARIS=yes" >> $config_mak
643   - if test "$presolaris10" = "yes" ; then
644   - echo "#define _PRESOLARIS10 1" >> $config_h
645   - fi
  640 + echo "#define HOST_SOLARIS $solarisrev" >> $config_h
646 641 fi
647 642 if test "$gdbstub" = "yes" ; then
648 643 echo "CONFIG_GDBSTUB=yes" >> $config_mak
... ...
fpu/softfloat-native.h
1 1 /* Native implementation of soft float functions */
2 2 #include <math.h>
3   -#if defined(_BSD) && !defined(__APPLE__)
  3 +
  4 +#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
4 5 #include <ieeefp.h>
  6 +#define fabsf(f) ((float)fabs(f))
5 7 #else
6   -#if !defined(_PRESOLARIS10)
7 8 #include <fenv.h>
8 9 #endif
  10 +
  11 +/*
  12 + * Define some C99-7.12.3 classification macros and
  13 + * some C99-.12.4 for Solaris systems OS less than 10,
  14 + * or Solaris 10 systems running GCC 3.x or less.
  15 + * Solaris 10 with GCC4 does not need these macros as they
  16 + * are defined in <iso/math_c99.h> with a compiler directive
  17 + */
  18 +#if defined(HOST_SOLARIS) && (( HOST_SOLARIS <= 9 ) || ( ( HOST_SOLARIS >= 10 ) && ( __GNUC__ <= 4) ))
  19 +/*
  20 + * C99 7.12.3 classification macros
  21 + * and
  22 + * C99 7.12.14 comparison macros
  23 + *
  24 + * ... do not work on Solaris 10 using GNU CC 3.4.x.
  25 + * Try to workaround the missing / broken C99 math macros.
  26 + */
  27 +
  28 +#define isnormal(x) (fpclass(x) >= FP_NZERO)
  29 +#define isgreater(x, y) ((!unordered(x, y)) && ((x) > (y)))
  30 +#define isgreaterequal(x, y) ((!unordered(x, y)) && ((x) >= (y)))
  31 +#define isless(x, y) ((!unordered(x, y)) && ((x) < (y)))
  32 +#define islessequal(x, y) ((!unordered(x, y)) && ((x) <= (y)))
  33 +#define isunordered(x,y) unordered(x, y)
9 34 #endif
10 35  
11 36 typedef float float32;
... ... @@ -35,7 +60,7 @@ typedef union {
35 60 /*----------------------------------------------------------------------------
36 61 | Software IEC/IEEE floating-point rounding mode.
37 62 *----------------------------------------------------------------------------*/
38   -#if defined(_BSD) && !defined(__APPLE__)
  63 +#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
39 64 enum {
40 65 float_round_nearest_even = FP_RN,
41 66 float_round_down = FP_RM,
... ...