Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FlF2q-0000rZ-37 for qemu-devel@nongnu.org; Tue, 30 May 2006 20:58:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FlF2o-0000rN-K4 for qemu-devel@nongnu.org; Tue, 30 May 2006 20:58:42 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FlF2o-0000rK-Br for qemu-devel@nongnu.org; Tue, 30 May 2006 20:58:42 -0400 Received: from [192.251.93.1] (helo=feith1.FEITH.COM) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FlF8i-0004C1-Fl for qemu-devel@nongnu.org; Tue, 30 May 2006 21:04:48 -0400 Received: from jwlab.FEITH.COM (jwlab.FEITH.COM [192.251.93.16]) by feith1.FEITH.COM (8.13.6+Sun/8.12.9) with ESMTP id k4V0wfsG001592 for ; Tue, 30 May 2006 20:58:41 -0400 (EDT) Received: from jwlab.FEITH.COM (localhost [127.0.0.1]) by jwlab.FEITH.COM (8.13.6+Sun/8.13.6) with ESMTP id k4V0wfuq000989 for ; Tue, 30 May 2006 20:58:41 -0400 (EDT) Received: (from john@localhost) by jwlab.FEITH.COM (8.13.6+Sun/8.13.6/Submit) id k4V0wfEo000988 for qemu-devel@nongnu.org; Tue, 30 May 2006 20:58:41 -0400 (EDT) From: John Wehle Message-Id: <200605310058.k4V0wfEo000988@jwlab.FEITH.COM> Content-Type: text Subject: [Qemu-devel] Patch for qemu 0.8.1 missing match functions on Solaris 9 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 31 May 2006 00:58:44 -0000 To: qemu-devel@nongnu.org Qemu is attempting to use math functions which don't exist on Solaris 9. Changes: fpu/softfloat-native.c: Provide l and f flavors of rint and friends. target-i386/exec.h: Don't replace sin and friends with the l flavors. Lightly tested using Solaris 9 x86 and gcc 2.95.3. Enjoy! -- John Wehle (john@feith.com) ---------------8<-----------------8<-------------------8<---------------- *** fpu/softfloat-native.c.ORIGINAL Wed May 3 16:32:58 2006 --- fpu/softfloat-native.c Fri May 26 20:16:07 2006 *************** *** 6,12 **** void set_float_rounding_mode(int val STATUS_PARAM) { STATUS(float_rounding_mode) = val; ! #if defined(_BSD) && !defined(__APPLE__) fpsetround(val); #elif defined(__arm__) /* nothing to do */ --- 6,12 ---- void set_float_rounding_mode(int val STATUS_PARAM) { STATUS(float_rounding_mode) = val; ! #if (defined(_BSD) && !defined(__APPLE__)) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) fpsetround(val); #elif defined(__arm__) /* nothing to do */ *************** void set_floatx80_rounding_precision(int *** 22,30 **** } #endif ! #if defined(_BSD) ! #define lrint(d) ((long)rint(d)) ! #define llrint(d) ((long long)rint(d)) #endif #if defined(__powerpc__) --- 22,40 ---- } #endif ! #if defined(_BSD) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) ! #define lrint(d) ((int32_t)rint(d)) ! #define llrint(d) ((int64_t)rint(d)) ! #define lrintf(f) ((int32_t)rint(f)) ! #define llrintf(f) ((int64_t)rint(f)) ! #define sqrtf(f) ((float)sqrt(f)) ! #define remainderf(fa, fb) ((float)remainder(fa, fb)) ! #define rintf(f) ((float)rint(f)) ! #define lrintl(d) ((int32_t)rint(d)) ! #define llrintl(d) ((int64_t)rint(d)) ! #define sqrtl(d) (sqrt(d)) ! #define remainderl(da,db) (remainder(da,db)) ! #define rintl(d) (rint(d)) #endif #if defined(__powerpc__) *** target-i386/exec.h.ORIGINAL Wed May 3 16:32:58 2006 --- target-i386/exec.h Fri May 26 20:07:50 2006 *************** static inline void stfl(target_ulong ptr *** 268,273 **** --- 268,274 ---- #define floatx_round_to_int floatx80_round_to_int #define floatx_compare floatx80_compare #define floatx_compare_quiet floatx80_compare_quiet + #if !(defined(HOST_SOLARIS) && HOST_SOLARIS < 10) #define sin sinl #define cos cosl #define sqrt sqrtl *************** static inline void stfl(target_ulong ptr *** 278,283 **** --- 279,285 ---- #define floor floorl #define ceil ceill #define ldexp ldexpl + #endif #else #define floatx_to_int32 float64_to_int32 #define floatx_to_int64 float64_to_int64 *************** static inline void stfl(target_ulong ptr *** 290,295 **** --- 292,298 ---- #define floatx_compare_quiet float64_compare_quiet #endif + #if !(defined(HOST_SOLARIS) && HOST_SOLARIS < 10) extern CPU86_LDouble sin(CPU86_LDouble x); extern CPU86_LDouble cos(CPU86_LDouble x); extern CPU86_LDouble sqrt(CPU86_LDouble x); *************** extern CPU86_LDouble tan(CPU86_LDouble x *** 299,304 **** --- 302,308 ---- extern CPU86_LDouble atan2(CPU86_LDouble, CPU86_LDouble); extern CPU86_LDouble floor(CPU86_LDouble x); extern CPU86_LDouble ceil(CPU86_LDouble x); + #endif #define RC_MASK 0xc00 #define RC_NEAR 0x000 ------------------------------------------------------------------------- | Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com | | John Wehle | Fax: 1-215-540-5495 | | -------------------------------------------------------------------------