qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tcp/mips: Change TCG_AREG0 (fp -> s0)
@ 2010-04-08 13:38 Stefan Weil
  2010-04-08 22:44 ` [Qemu-devel] " Aurelien Jarno
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Weil @ 2010-04-08 13:38 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Aurelien Jarno

Register fp is a bad choice for compilations without
optimisation, because the compiler makes heavy use
of this register (so the resulting code crashes).

Register s0 was used for TCG_AREG1 in earlier releases,
but was no longer used and is now free for TCG_AREG0.

The resulting code works for compilations without
optimisation (tested with qemu mips in qemu mips
on x86 host).

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 dyngen-exec.h         |    2 +-
 tcg/mips/tcg-target.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dyngen-exec.h b/dyngen-exec.h
index b9f6969..85a2616 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -61,7 +61,7 @@ extern int printf(const char *, ...);
 #elif defined(__hppa__)
 #define AREG0 "r17"
 #elif defined(__mips__)
-#define AREG0 "fp"
+#define AREG0 "s0"
 #elif defined(__sparc__)
 #ifdef CONFIG_SOLARIS
 #define AREG0 "g2"
diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
index 0292d33..0028bfa 100644
--- a/tcg/mips/tcg-target.h
+++ b/tcg/mips/tcg-target.h
@@ -97,7 +97,7 @@ enum {
 #undef TCG_TARGET_HAS_ext16u_i32   /* andi rt, rs, 0xffff */
 
 /* Note: must be synced with dyngen-exec.h */
-#define TCG_AREG0 TCG_REG_FP
+#define TCG_AREG0 TCG_REG_S0
 
 /* guest base is supported */
 #define TCG_TARGET_HAS_GUEST_BASE
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-04-09 21:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 13:38 [Qemu-devel] [PATCH] tcp/mips: Change TCG_AREG0 (fp -> s0) Stefan Weil
2010-04-08 22:44 ` [Qemu-devel] " Aurelien Jarno
2010-04-08 23:44   ` Paul Brook
2010-04-09  6:42   ` Stefan Weil
2010-04-09  7:36     ` [Qemu-devel] " Stefan Weil
2010-04-09 14:45       ` Richard Henderson
2010-04-09 15:28         ` Stefan Weil
2010-04-09 15:57           ` [Qemu-devel] " Aurelien Jarno

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