qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ben Taylor <sol10x86@cox.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] PATCH: updated Solaris isinf  support
Date: Fri, 13 Apr 2007 19:15:01 -0400	[thread overview]
Message-ID: <6799126.1176506101382.JavaMail.root@eastrmwml03.mgt.cox.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]


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

[-- Attachment #2: qemu-sol-isinf.diff --]
[-- Type: text/x-patch, Size: 1103 bytes --]

--- 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

                 reply	other threads:[~2007-04-13 23:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6799126.1176506101382.JavaMail.root@eastrmwml03.mgt.cox.net \
    --to=sol10x86@cox.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).