[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/14] tcg-sparc: Do not use a global register for A
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 08/14] tcg-sparc: Do not use a global register for AREG0. |
Date: |
Tue, 27 Mar 2012 17:32:17 -0700 |
Use of "env" as a macro means constraining include file ordering a bit.
Signed-off-by: Richard Henderson <address@hidden>
---
dyngen-exec.h | 17 +++++++----------
target-m68k/op_helper.c | 2 +-
target-unicore32/op_helper.c | 2 +-
target-xtensa/op_helper.c | 2 +-
xtensa-semi.c | 2 +-
5 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/dyngen-exec.h b/dyngen-exec.h
index 65fcb43..97fd32c 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -41,13 +41,8 @@
#elif defined(__mips__)
#define AREG0 "s0"
#elif defined(__sparc__)
-#ifdef CONFIG_SOLARIS
-#define AREG0 "g2"
-#elif HOST_LONG_BITS == 64
-#define AREG0 "g5"
-#else
-#define AREG0 "g6"
-#endif
+/* Don't use a global register. Working around glibc clobbering these
+ global registers is more trouble than just using TLS. */
#elif defined(__s390__)
#define AREG0 "r10"
#elif defined(__alpha__)
@@ -62,11 +57,13 @@
#error unsupported CPU
#endif
-#if defined(AREG0)
+#ifdef AREG0
register CPUArchState *env asm(AREG0);
#else
-/* TODO: Try env = cpu_single_env. */
-extern CPUArchState *env;
+/* Without a hard register, we can use the TLS variable instead. Note that
+ this macro interferes with the use of "env" in DEF_HELPER_N, thus targets
+ should always include "helper.h" before "dyngen-exec.h". */
+#define env cpu_single_env
#endif
#endif /* !CONFIG_TCG_PASS_AREG0 */
diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c
index bc8c1f0..ef12f21 100644
--- a/target-m68k/op_helper.c
+++ b/target-m68k/op_helper.c
@@ -17,8 +17,8 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "cpu.h"
-#include "dyngen-exec.h"
#include "helpers.h"
+#include "dyngen-exec.h"
#if defined(CONFIG_USER_ONLY)
diff --git a/target-unicore32/op_helper.c b/target-unicore32/op_helper.c
index 638a020..a6a68b3 100644
--- a/target-unicore32/op_helper.c
+++ b/target-unicore32/op_helper.c
@@ -8,8 +8,8 @@
* published by the Free Software Foundation.
*/
#include "cpu.h"
-#include "dyngen-exec.h"
#include "helper.h"
+#include "dyngen-exec.h"
#define SIGNBIT (uint32_t)0x80000000
#define SIGNBIT64 ((uint64_t)1 << 63)
diff --git a/target-xtensa/op_helper.c b/target-xtensa/op_helper.c
index cdef0db..d709983 100644
--- a/target-xtensa/op_helper.c
+++ b/target-xtensa/op_helper.c
@@ -26,8 +26,8 @@
*/
#include "cpu.h"
-#include "dyngen-exec.h"
#include "helpers.h"
+#include "dyngen-exec.h"
#include "host-utils.h"
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
diff --git a/xtensa-semi.c b/xtensa-semi.c
index 5754b77..0c0e018 100644
--- a/xtensa-semi.c
+++ b/xtensa-semi.c
@@ -30,8 +30,8 @@
#include <string.h>
#include <stddef.h>
#include "cpu.h"
-#include "dyngen-exec.h"
#include "helpers.h"
+#include "dyngen-exec.h"
#include "qemu-log.h"
enum {
--
1.7.7.6
- [Qemu-devel] [PATCH 03/14] tcg-sparc: Assume v9 cpu always, i.e. force v8plus in 32-bit mode., (continued)
- [Qemu-devel] [PATCH 03/14] tcg-sparc: Assume v9 cpu always, i.e. force v8plus in 32-bit mode., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 06/14] tcg-sparc: Support GUEST_BASE., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 04/14] tcg-sparc: Fix qemu_ld/st to handle 32-bit host., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 07/14] Avoid declaring the env variable at all if CONFIG_TCG_PASS_AREG0., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 09/14] tcg-sparc: Change AREG0 in generated code to %i0., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 05/14] tcg-sparc: Simplify qemu_ld/st direct memory paths., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 08/14] tcg-sparc: Do not use a global register for AREG0.,
Richard Henderson <=
- [Qemu-devel] [PATCH 10/14] tcg-sparc: Clean up cruft stemming from attempts to use global registers., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 11/14] tcg-sparc: Mask shift immediates to avoid illegal insns., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 14/14] tcg-sparc: Fix and enable direct TB chaining., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 12/14] tcg-sparc: Use defines for temporaries., Richard Henderson, 2012/03/27
- [Qemu-devel] [PATCH 13/14] tcg-sparc: Add %g/%o registers to alloc_order, Richard Henderson, 2012/03/27