]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
tcp/mips: Change TCG_AREG0 (fp -> s0)
authorStefan Weil <weil@mail.berlios.de>
Fri, 9 Apr 2010 15:28:40 +0000 (17:28 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 13 Apr 2010 23:02:24 +0000 (01:02 +0200)
Register fp (frame pointer) is a bad choice for compilations
without optimisation, because the compiler makes heavy use
of this register (so the resulting code crashes).

Register s0 had been 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).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
dyngen-exec.h
tcg/mips/tcg-target.c
tcg/mips/tcg-target.h

index 0353f36cdd420cd4b7d32f4177859be59d3fca12..3f1c43196d614db17e5c78366e34241f518891b8 100644 (file)
@@ -69,9 +69,9 @@ extern int printf(const char *, ...);
 #define AREG1 "r14"
 #define AREG2 "r15"
 #elif defined(__mips__)
-#define AREG0 "fp"
-#define AREG1 "s0"
-#define AREG2 "s1"
+#define AREG0 "s0"
+#define AREG1 "s1"
+#define AREG2 "fp"
 #elif defined(__sparc__)
 #ifdef CONFIG_SOLARIS
 #define AREG0 "g2"
index 3ed9217e33cc77b86a551d29fe8e38f08aa37cb3..79ba9a6628198ba39721d01afc53e9854bf6ff7a 100644 (file)
@@ -1273,7 +1273,9 @@ static const TCGTargetOpDef mips_op_defs[] = {
 };
 
 static int tcg_target_callee_save_regs[] = {
+#if 0 /* used for the global env (TCG_AREG0), so no need to save */
     TCG_REG_S0,
+#endif
     TCG_REG_S1,
     TCG_REG_S2,
     TCG_REG_S3,
@@ -1282,8 +1284,7 @@ static int tcg_target_callee_save_regs[] = {
     TCG_REG_S6,
     TCG_REG_S7,
     TCG_REG_GP,
-    /* TCG_REG_FP, */ /* currently used for the global env, so np
-                         need to save */
+    TCG_REG_FP,
     TCG_REG_RA,       /* should be last for ABI compliance */
 };
 
index 46760a50e16d731096f7d2e976713202b1012d69..baae6d85c383745635cf71907ace2f5791c03276 100644 (file)
@@ -92,9 +92,9 @@ 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_AREG1 TCG_REG_S0
-#define TCG_AREG2 TCG_REG_S1
+#define TCG_AREG0 TCG_REG_S0
+#define TCG_AREG1 TCG_REG_S1
+#define TCG_AREG2 TCG_REG_FP
 
 #include <sys/cachectl.h>