From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HcV3O-0002SX-Gt for qemu-devel@nongnu.org; Fri, 13 Apr 2007 19:19:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HcV3M-0002O6-2R for qemu-devel@nongnu.org; Fri, 13 Apr 2007 19:19:41 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HcV3L-0002Nj-LF for qemu-devel@nongnu.org; Fri, 13 Apr 2007 19:19:39 -0400 Received: from eastrmmtao105.cox.net ([68.230.240.47]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HcUz1-0004Sg-4R for qemu-devel@nongnu.org; Fri, 13 Apr 2007 19:15:11 -0400 Received: from eastrmimpo01.cox.net ([68.1.16.119]) by eastrmmtao105.cox.net (InterMail vM.7.05.02.00 201-2174-114-20060621) with ESMTP id <20070413231501.OFFE1286.eastrmmtao105.cox.net@eastrmimpo01.cox.net> for ; Fri, 13 Apr 2007 19:15:01 -0400 Message-ID: <6799126.1176506101382.JavaMail.root@eastrmwml03.mgt.cox.net> Date: Fri, 13 Apr 2007 19:15:01 -0400 From: Ben Taylor MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_30693_1944952.1176506101357" Subject: [Qemu-devel] PATCH: updated Solaris isinf support 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_30693_1944952.1176506101357 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit This is an update to a previous patch to fix the missing macro isinf (and isnan) for Solaris that is used in target-i386/helper.c. This patch is against qemu/fpu/softfloat-native.h, which is a better place for the macro, as opposed to putting it in target-i386/helper.c. Attribution to Juergen Keil for extending the original idea, with help from autoconf documentation. Eventually, Solaris 10/11 will correctly support isinf, but until the updates are made, this will work for now. Ben ------=_Part_30693_1944952.1176506101357 Content-Type: text/x-patch; name=qemu-sol-isinf.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=qemu-sol-isinf.diff --- qemu.ORIG/fpu/softfloat-native.h 2007-03-20 18:10:42.000000000 -0400 +++ qemu/fpu/softfloat-native.h 2007-04-13 17:58:22.643179000 -0400 @@ -33,6 +33,29 @@ #define isunordered(x,y) unordered(x, y) #endif +#if defined(__sun__) && !defined(NEED_LIBSUNMATH) + +#ifndef isnan +# define isnan(x) \ + (sizeof (x) == sizeof (long double) ? isnan_ld (x) \ + : sizeof (x) == sizeof (double) ? isnan_d (x) \ + : isnan_f (x)) +static inline int isnan_f (float x) { return x != x; } +static inline int isnan_d (double x) { return x != x; } +static inline int isnan_ld (long double x) { return x != x; } +#endif + +#ifndef isinf +# define isinf(x) \ + (sizeof (x) == sizeof (long double) ? isinf_ld (x) \ + : sizeof (x) == sizeof (double) ? isinf_d (x) \ + : isinf_f (x)) +static inline int isinf_f (float x) { return isnan (x - x); } +static inline int isinf_d (double x) { return isnan (x - x); } +static inline int isinf_ld (long double x) { return isnan (x - x); } +#endif +#endif + typedef float float32; typedef double float64; #ifdef FLOATX80 ------=_Part_30693_1944952.1176506101357--