[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/24] tcg-mips: Split large ldst offsets
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 05/24] tcg-mips: Split large ldst offsets |
Date: |
Wed, 14 May 2014 00:17:22 -0700 |
Use this to reduce goto_tb by one insn.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/mips/tcg-target.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
index 2d2073f..5ccfb1d 100644
--- a/tcg/mips/tcg-target.c
+++ b/tcg/mips/tcg-target.c
@@ -480,16 +480,18 @@ static inline void tcg_out_ext16s(TCGContext *s, TCGReg
ret, TCGReg arg)
}
}
-static inline void tcg_out_ldst(TCGContext *s, int opc, TCGArg arg,
- TCGReg arg1, TCGArg arg2)
+static void tcg_out_ldst(TCGContext *s, int opc, TCGReg data,
+ TCGReg addr, intptr_t ofs)
{
- if (arg2 == (int16_t) arg2) {
- tcg_out_opc_imm(s, opc, arg, arg1, arg2);
- } else {
- tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_AT, arg2);
- tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_AT, TCG_REG_AT, arg1);
- tcg_out_opc_imm(s, opc, arg, TCG_REG_AT, 0);
+ int16_t lo = ofs;
+ if (ofs != lo) {
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_AT, ofs - lo);
+ if (addr != TCG_REG_ZERO) {
+ tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_AT, TCG_REG_AT, addr);
+ }
+ addr = TCG_REG_AT;
}
+ tcg_out_opc_imm(s, opc, data, addr, lo);
}
static inline void tcg_out_ld(TCGContext *s, TCGType type, TCGReg arg,
@@ -1315,9 +1317,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
tcg_abort();
} else {
/* indirect jump method */
- tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_AT,
- (uintptr_t)(s->tb_next + args[0]));
- tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_AT, TCG_REG_AT, 0);
+ tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_AT, TCG_REG_ZERO,
+ (uintptr_t)(s->tb_next + args[0]));
tcg_out_opc_reg(s, OPC_JR, 0, TCG_REG_AT, 0);
}
tcg_out_nop(s);
--
1.9.0
- [Qemu-devel] [PATCH 00/24] tcg mips updates, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 02/24] tcg-mips: Constrain the code_gen_buffer to be within one 256mb segment, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 01/24] tcg-mips: Layout executable and code_gen_buffer, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 03/24] tcg-mips: Use J and JAL opcodes, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 06/24] tcg-mips: Move softmmu slow path out of line, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 04/24] tcg-mips: Fill the exit_tb delay slot, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 07/24] tcg-mips: Convert to new qemu_l/st helpers, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 05/24] tcg-mips: Split large ldst offsets,
Richard Henderson <=
- [Qemu-devel] [PATCH 09/24] tcg-mips: Rearrange register allocation, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 10/24] tcg-mips: Introduce TCG_TMP0, TCG_TMP1, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 11/24] tcg-mips: Use T9 for TCG_TMP1, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 08/24] tcg-mips: Convert to new_ldst, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 13/24] tcg-mips: Name the opcode enumeration, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 12/24] tcg-mips: Use EXT for AND on mips32r2, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 14/24] tcg-mips: Fix subtract immediate range, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 15/24] tcg-mips: Hoist args loads, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 16/24] tcg-mips: Improve add2/sub2, Richard Henderson, 2014/05/14
- [Qemu-devel] [PATCH 17/24] tcg-mips: Commonize opcode implementations, Richard Henderson, 2014/05/14