[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/5] tcg-hppa: Load GUEST_BASE as an immediate.
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 2/5] tcg-hppa: Load GUEST_BASE as an immediate. |
Date: |
Thu, 6 May 2010 08:50:42 -0700 |
Now that the prologue is generated after GUEST_BASE is fixed,
we can load it as an immediate, and also avoid reserving the
register if it isn't necessary.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/hppa/tcg-target.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c
index 012e486..a5f2162 100644
--- a/tcg/hppa/tcg-target.c
+++ b/tcg/hppa/tcg-target.c
@@ -1629,11 +1629,10 @@ void tcg_target_qemu_prologue(TCGContext *s)
}
#ifdef CONFIG_USE_GUEST_BASE
- /* Note that GUEST_BASE can change after the prologue is generated.
- To combat that, load the value from the variable instead of
- embedding a constant here. */
- tcg_out_ld(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG,
- TCG_REG_R0, (tcg_target_long)&guest_base);
+ if (GUEST_BASE != 0) {
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_GUEST_BASE_REG, GUEST_BASE);
+ tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG);
+ }
#endif
/* Jump to TB, and adjust R18 to be the return address. */
@@ -1679,9 +1678,6 @@ void tcg_target_init(TCGContext *s)
tcg_regset_set_reg(s->reserved_regs, TCG_REG_DP); /* data pointer */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP); /* stack pointer */
tcg_regset_set_reg(s->reserved_regs, TCG_REG_R31); /* ble link reg */
-#ifdef CONFIG_USE_GUEST_BASE
- tcg_regset_set_reg(s->reserved_regs, TCG_GUEST_BASE_REG);
-#endif
tcg_add_target_add_op_defs(hppa_op_defs);
}
--
1.7.0.1
- [Qemu-devel] [PATCH 0/5] tcg: Initialize prologue after guest_base fixed, Richard Henderson, 2010/05/06
- [Qemu-devel] [PATCH 2/5] tcg-hppa: Load GUEST_BASE as an immediate.,
Richard Henderson <=
- [Qemu-devel] [PATCH 5/5] tcg-ppc: Conditionally reserve TCG_GUEST_BASE_REG., Richard Henderson, 2010/05/06
- [Qemu-devel] [PATCH 3/5] tcg-ia64: Fix some register usage issues., Richard Henderson, 2010/05/06
- [Qemu-devel] [PATCH 1/5] tcg: Initialize the prologue after GUEST_BASE is fixed., Richard Henderson, 2010/05/06
- [Qemu-devel] [PATCH 4/5] tcg-ia64: Load GUEST_BASE into a register., Richard Henderson, 2010/05/06
- Re: [Qemu-devel] [PATCH 0/5] tcg: Initialize prologue after guest_base fixed, Aurelien Jarno, 2010/05/21