* [Qemu-devel] [PATCH 4/5] (PPC) Fix Alpha target floating point
@ 2008-01-17 6:42 Alexander Graf
2008-01-17 17:51 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2008-01-17 6:42 UTC (permalink / raw)
To: qemu-devel
[-- 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();
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-17 17:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-17 6:42 [Qemu-devel] [PATCH 4/5] (PPC) Fix Alpha target floating point Alexander Graf
2008-01-17 17:51 ` Blue Swirl
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).