[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: |
Thu, 19 Apr 2012 08:33:09 -0500 |
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 | 4 ++--
xtensa-semi.c | 4 ++--
5 files changed, 13 insertions(+), 16 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 1971a57..048c131 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 b954c30..08dbc76 100644
--- a/target-unicore32/op_helper.c
+++ b/target-unicore32/op_helper.c
@@ -9,8 +9,8 @@
* later version. See the COPYING file in the top-level directory.
*/
#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 364dc19..d098be3 100644
--- a/target-xtensa/op_helper.c
+++ b/target-xtensa/op_helper.c
@@ -26,9 +26,9 @@
*/
#include "cpu.h"
-#include "dyngen-exec.h"
-#include "helper.h"
#include "host-utils.h"
+#include "helper.h"
+#include "dyngen-exec.h"
static void do_unaligned_access(target_ulong addr, int is_write, int is_user,
uintptr_t retaddr);
diff --git a/xtensa-semi.c b/xtensa-semi.c
index b7c8c34..42df6af 100644
--- a/xtensa-semi.c
+++ b/xtensa-semi.c
@@ -30,9 +30,9 @@
#include <string.h>
#include <stddef.h>
#include "cpu.h"
-#include "dyngen-exec.h"
-#include "helper.h"
#include "qemu-log.h"
+#include "helper.h"
+#include "dyngen-exec.h"
enum {
TARGET_SYS_exit = 1,
--
1.7.7.6
- [Qemu-devel] [PATCH 00/14] tcg-sparc improvments, v3, Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 03/14] tcg-sparc: Assume v9 cpu always, i.e. force v8plus in 32-bit mode., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 01/14] tcg-sparc: Hack in qemu_ld/st64 for 32-bit., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 02/14] tcg-sparc: Fix ADDX opcode., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 06/14] tcg-sparc: Support GUEST_BASE., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 08/14] tcg-sparc: Do not use a global register for AREG0.,
Richard Henderson <=
- [Qemu-devel] [PATCH 07/14] Avoid declaring the env variable at all if CONFIG_TCG_PASS_AREG0., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 10/14] tcg-sparc: Clean up cruft stemming from attempts to use global registers., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 11/14] tcg-sparc: Mask shift immediates to avoid illegal insns., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 05/14] tcg-sparc: Simplify qemu_ld/st direct memory paths., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 13/14] tcg-sparc: Add %g/%o registers to alloc_order, Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 09/14] tcg-sparc: Change AREG0 in generated code to %i0., Richard Henderson, 2012/04/19
- [Qemu-devel] [PATCH 14/14] tcg-sparc: Fix and enable direct TB chaining., Richard Henderson, 2012/04/19