From: Alexander Graf <alex@csgraf.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 4/5] (PPC) Fix Alpha target floating point
Date: Thu, 17 Jan 2008 07:42:57 +0100 [thread overview]
Message-ID: <478EF8F1.5060201@csgraf.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 118 bytes --]
This fixes the Alpha target for PowerPC hosts. It is merely a part of
the original gcc4 patch posted by Michael Matz.
[-- Attachment #2: qemu-gcc4-ppc-alpha.patch --]
[-- Type: text/x-patch, Size: 1309 bytes --]
--- qemu-0.9.0.cvs/target-alpha/op_template.h.mm 2007-08-22 03:17:57.000000000 +0000
+++ qemu-0.9.0.cvs/target-alpha/op_template.h 2007-08-22 03:15:49.000000000 +0000
@@ -28,7 +28,26 @@ void OPPROTO glue(op_reset_T, REG) (void
void OPPROTO glue(op_reset_FT, REG) (void)
{
+#ifdef HOST_PPC
+ /* We have a problem with HOST_PPC here:
+ We want this code:
+ glue(FT, REG) = 0;
+ unfortunately GCC4 notices that this stores (double)0.0 into
+ env->ft0 and emits that constant into the .rodata, and instructions
+ to load that zero from there. But that construct can't be parsed by dyngen.
+ We could add -ffast-math for compiling op.c, that would just make it generate
+ two stores of zeros into both words of ft0. But -ffast-math may have other
+ side-effects regarding the emulation. We could use __builtin_memset,
+ which perhaps would be the sanest. That relies on -O2 and our other options
+ to inline that memset, which currently it does, but who knows for how long.
+ So, we simply do that by hand, and a barely typesafe way :-/ */
+ union baeh { double d; unsigned int i[2];};
+ union baeh *p = (union baeh*)&(glue(FT, REG));
+ p->i[0] = 0;
+ p->i[1] = 0;
+#else
glue(FT, REG) = 0;
+#endif
RETURN();
}
next reply other threads:[~2008-01-17 10:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-17 6:42 Alexander Graf [this message]
2008-01-17 17:51 ` [Qemu-devel] [PATCH 4/5] (PPC) Fix Alpha target floating point Blue Swirl
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=478EF8F1.5060201@csgraf.de \
--to=alex@csgraf.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.