[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/21] tcg-ppc: Use conditional branch and link to sl
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 06/21] tcg-ppc: Use conditional branch and link to slow path |
Date: |
Wed, 25 Sep 2013 09:27:23 -0700 |
Saves one insn per slow path. Note that we can no longer use
a tail call into the store helper.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/ppc/tcg-target.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index a5f1f99..516d28f 100644
--- a/tcg/ppc/tcg-target.c
+++ b/tcg/ppc/tcg-target.c
@@ -611,9 +611,14 @@ static void tcg_out_tlb_check (TCGContext *s, int r0, int
r1, int r2,
tcg_out32 (s, CMP | BF (6) | RA (addr_reg2) | RB (r1));
tcg_out32 (s, CRAND | BT (7, CR_EQ) | BA (6, CR_EQ) | BB (7, CR_EQ));
#endif
+
+ /* Use a conditional branch-and-link so that we load a pointer to
+ somewhere within the current opcode, for passing on to the helper.
+ This address cannot be used for a tail call, but it's shorter
+ than forming an address from scratch. */
*label_ptr = s->code_ptr;
retranst = ((uint16_t *) s->code_ptr)[1] & ~3;
- tcg_out32 (s, BC | BI (7, CR_EQ) | retranst | BO_COND_FALSE);
+ tcg_out32(s, BC | BI(7, CR_EQ) | retranst | BO_COND_FALSE | LK);
/* r0 now contains &env->tlb_table[mem_index][index].addr_x */
tcg_out32 (s, (LWZ
@@ -853,7 +858,7 @@ static void tcg_out_qemu_ld_slow_path(TCGContext *s,
TCGLabelQemuLdst *l)
tcg_out_mov(s, TCG_TYPE_I32, ir++, l->addrlo_reg);
}
tcg_out_movi(s, TCG_TYPE_I32, ir++, l->mem_index);
- tcg_out_movi(s, TCG_TYPE_PTR, ir, (uintptr_t)l->raddr);
+ tcg_out32(s, MFSPR | RT(ir++) | LR);
tcg_out_b(s, LK, (uintptr_t)ld_trampolines[l->opc & 3]);
datalo = l->datalo_reg;
@@ -928,9 +933,9 @@ static void tcg_out_qemu_st_slow_path(TCGContext *s,
TCGLabelQemuLdst *l)
ir++;
tcg_out_movi(s, TCG_TYPE_I32, ir++, l->mem_index);
- tcg_out_movi(s, TCG_TYPE_PTR, ir, (uintptr_t)l->raddr);
- tcg_out32(s, MTSPR | RS(ir) | LR);
- tcg_out_b(s, 0, (uintptr_t)st_trampolines[l->opc]);
+ tcg_out32(s, MFSPR | RT(ir++) | LR);
+ tcg_out_b(s, LK, (uintptr_t)st_trampolines[l->opc]);
+ tcg_out_b(s, 0, (uintptr_t)l->raddr);
}
void tcg_out_tb_finalize(TCGContext *s)
--
1.8.1.4
- [Qemu-devel] [PULL 00/21] TCG ppc and ppc64 updates, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 01/21] configure: Allow command-line configure for ppc32, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 03/21] tcg-ppc: use new return-argument ld/st helpers, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 04/21] tcg-ppc: Avoid code for nop move, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 05/21] tcg-ppc: Cleanup tcg_out_qemu_ld/st_slow_path, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 06/21] tcg-ppc: Use conditional branch and link to slow path,
Richard Henderson <=
- [Qemu-devel] [PULL 02/21] tcg-ppc: fix qemu_ld/qemu_st for AIX ABI, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 07/21] tcg-ppc: Fix and cleanup tcg_out_tlb_check, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 08/21] tcg-ppc64: Reformat tcg-target.c, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 09/21] tcg-ppc64: More use of TAI and SAI helper macros, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 11/21] tcg-ppc64: Use tcg_out64, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 10/21] tcg-ppc64: Use TCG_REG_Rn constants, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 12/21] tcg-ppc64: Avoid code for nop move, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 13/21] tcg-ppc64: Don't load the static chain from TCG, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 14/21] tcg-ppc64: Fold constant call address into descriptor load, Richard Henderson, 2013/09/25
- [Qemu-devel] [PULL 15/21] tcg-ppc64: Look through a constant function descriptor, Richard Henderson, 2013/09/25