[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/6] tcg-hppa: Fix branch offset during retranslatio
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 5/6] tcg-hppa: Fix branch offset during retranslation. |
Date: |
Fri, 9 Apr 2010 21:49:00 +0200 |
Branch offsets should only be overwritten during relocation,
to support partial retranslation.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/hppa/tcg-target.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c
index 6941e22..6536a42 100644
--- a/tcg/hppa/tcg-target.c
+++ b/tcg/hppa/tcg-target.c
@@ -723,8 +723,11 @@ static void tcg_out_branch(TCGContext *s, int label_index,
int nul)
tcg_out32(s, op | reassemble_17(val));
} else {
+ /* We need to keep the offset unchanged for retranslation. */
+ uint32_t old_insn = *(uint32_t *)s->code_ptr;
+
tcg_out_reloc(s, s->code_ptr, R_PARISC_PCREL17F, label_index, 0);
- tcg_out32(s, op);
+ tcg_out32(s, op | (old_insn & 0x1f1ffdu));
}
}
@@ -777,11 +780,14 @@ static void tcg_out_brcond(TCGContext *s, int cond,
TCGArg c1,
tcg_out32(s, op | reassemble_12(val));
tcg_out_nop(s);
} else {
+ /* We need to keep the offset unchanged for retranslation. */
+ uint32_t old_insn = *(uint32_t *)s->code_ptr;
+
tcg_out_reloc(s, s->code_ptr, R_PARISC_PCREL12F, label_index, 0);
/* ??? Assume that all branches to undefined labels are forward.
Which means that if the nul bit is set, the delay slot is
not executed if the branch is taken, which is what we want. */
- tcg_out32(s, op | 2);
+ tcg_out32(s, op | 2 | (old_insn & 0x1ffdu));
}
}
--
1.6.2.5
- [Qemu-devel] [PATCH 0/6] tcg-hppa improvements, Richard Henderson, 2010/04/14
- [Qemu-devel] [PATCH 4/6] tcg-hppa: Schedule the address masking after the TLB load., Richard Henderson, 2010/04/14
- [Qemu-devel] [PATCH 2/6] tcg-hppa: Fix GUEST_BASE initialization in prologue., Richard Henderson, 2010/04/14
- [Qemu-devel] [PATCH 5/6] tcg-hppa: Fix branch offset during retranslation.,
Richard Henderson <=
- [Qemu-devel] [PATCH 6/6] tcg-hppa: Remove automatically implemented opcodes., Richard Henderson, 2010/04/14
- [Qemu-devel] [PATCH 3/6] tcg-hppa: Fix softmmu loads and stores., Richard Henderson, 2010/04/14
- [Qemu-devel] [PATCH 1/6] tcg-hppa: Constrain immediate inputs to and_i32, or_i32, andc_i32., Richard Henderson, 2010/04/14
- [Qemu-devel] Re: [PATCH 0/6] tcg-hppa improvements, Paolo Bonzini, 2010/04/14