[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/24] tcg-mips: Fill the exit_tb delay slot
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 04/24] tcg-mips: Fill the exit_tb delay slot |
Date: |
Wed, 14 May 2014 00:17:21 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/mips/tcg-target.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
index d4236c0..2d2073f 100644
--- a/tcg/mips/tcg-target.c
+++ b/tcg/mips/tcg-target.c
@@ -392,8 +392,10 @@ static inline void tcg_out_movi(TCGContext *s, TCGType
type,
} else if (arg == (uint16_t)arg) {
tcg_out_opc_imm(s, OPC_ORI, reg, TCG_REG_ZERO, arg);
} else {
- tcg_out_opc_imm(s, OPC_LUI, reg, 0, arg >> 16);
- tcg_out_opc_imm(s, OPC_ORI, reg, reg, arg & 0xffff);
+ tcg_out_opc_imm(s, OPC_LUI, reg, TCG_REG_ZERO, arg >> 16);
+ if (arg & 0xffff) {
+ tcg_out_opc_imm(s, OPC_ORI, reg, reg, arg & 0xffff);
+ }
}
}
@@ -1291,12 +1293,21 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode
opc,
{
switch(opc) {
case INDEX_op_exit_tb:
- tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_V0, args[0]);
- if (!tcg_out_opc_jmp(s, OPC_J, tb_ret_addr)) {
- tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_AT, (uintptr_t)tb_ret_addr);
- tcg_out_opc_reg(s, OPC_JR, 0, TCG_REG_AT, 0);
+ {
+ uintptr_t a0 = args[0];
+ TCGReg b0 = TCG_REG_ZERO;
+
+ if (a0 & ~0xffff) {
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_V0, a0 & ~0xffff);
+ b0 = TCG_REG_V0;
+ }
+ if (!tcg_out_opc_jmp(s, OPC_J, tb_ret_addr)) {
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_AT,
+ (uintptr_t)tb_ret_addr);
+ tcg_out_opc_reg(s, OPC_JR, 0, TCG_REG_AT, 0);
+ }
+ tcg_out_opc_imm(s, OPC_ORI, TCG_REG_V0, b0, a0 & 0xffff);
}
- tcg_out_nop(s);
break;
case INDEX_op_goto_tb:
if (s->tb_jmp_offset) {
--
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 <=
- [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, 2014/05/14
- [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