mirror of https://github.com/xqemu/xqemu.git
tcg/mips: pass oi to tcg_out_tlb_load
Instead of computing mem_index and s_bits in both tcg_out_qemu_ld and tcg_out_qemu_st function and passing them to tcg_out_tlb_load, directly pass oi to the tcg_out_tlb_load function and compute mem_index and s_bits there. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
d9f26847f1
commit
81dfaf1a8f
|
@ -983,9 +983,11 @@ static int tcg_out_call_iarg_reg2(TCGContext *s, int i, TCGReg al, TCGReg ah)
|
||||||
/* Perform the tlb comparison operation. The complete host address is
|
/* Perform the tlb comparison operation. The complete host address is
|
||||||
placed in BASE. Clobbers AT, T0, A0. */
|
placed in BASE. Clobbers AT, T0, A0. */
|
||||||
static void tcg_out_tlb_load(TCGContext *s, TCGReg base, TCGReg addrl,
|
static void tcg_out_tlb_load(TCGContext *s, TCGReg base, TCGReg addrl,
|
||||||
TCGReg addrh, int mem_index, TCGMemOp s_bits,
|
TCGReg addrh, TCGMemOpIdx oi,
|
||||||
tcg_insn_unit *label_ptr[2], bool is_load)
|
tcg_insn_unit *label_ptr[2], bool is_load)
|
||||||
{
|
{
|
||||||
|
TCGMemOp s_bits = get_memop(oi) & MO_SIZE;
|
||||||
|
int mem_index = get_mmuidx(oi);
|
||||||
int cmp_off
|
int cmp_off
|
||||||
= (is_load
|
= (is_load
|
||||||
? offsetof(CPUArchState, tlb_table[mem_index][0].addr_read)
|
? offsetof(CPUArchState, tlb_table[mem_index][0].addr_read)
|
||||||
|
@ -1209,8 +1211,6 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64)
|
||||||
TCGMemOp opc;
|
TCGMemOp opc;
|
||||||
#if defined(CONFIG_SOFTMMU)
|
#if defined(CONFIG_SOFTMMU)
|
||||||
tcg_insn_unit *label_ptr[2];
|
tcg_insn_unit *label_ptr[2];
|
||||||
int mem_index;
|
|
||||||
TCGMemOp s_bits;
|
|
||||||
#endif
|
#endif
|
||||||
/* Note that we've eliminated V0 from the output registers,
|
/* Note that we've eliminated V0 from the output registers,
|
||||||
so we won't overwrite the base register during loading. */
|
so we won't overwrite the base register during loading. */
|
||||||
|
@ -1224,11 +1224,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, bool is_64)
|
||||||
opc = get_memop(oi);
|
opc = get_memop(oi);
|
||||||
|
|
||||||
#if defined(CONFIG_SOFTMMU)
|
#if defined(CONFIG_SOFTMMU)
|
||||||
mem_index = get_mmuidx(oi);
|
tcg_out_tlb_load(s, base, addr_regl, addr_regh, oi, label_ptr, 1);
|
||||||
s_bits = opc & MO_SIZE;
|
|
||||||
|
|
||||||
tcg_out_tlb_load(s, base, addr_regl, addr_regh, mem_index,
|
|
||||||
s_bits, label_ptr, 1);
|
|
||||||
tcg_out_qemu_ld_direct(s, data_regl, data_regh, base, opc);
|
tcg_out_qemu_ld_direct(s, data_regl, data_regh, base, opc);
|
||||||
add_qemu_ldst_label(s, 1, oi, data_regl, data_regh, addr_regl, addr_regh,
|
add_qemu_ldst_label(s, 1, oi, data_regl, data_regh, addr_regl, addr_regh,
|
||||||
s->code_ptr, label_ptr);
|
s->code_ptr, label_ptr);
|
||||||
|
@ -1294,8 +1290,6 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
|
||||||
TCGMemOp opc;
|
TCGMemOp opc;
|
||||||
#if defined(CONFIG_SOFTMMU)
|
#if defined(CONFIG_SOFTMMU)
|
||||||
tcg_insn_unit *label_ptr[2];
|
tcg_insn_unit *label_ptr[2];
|
||||||
int mem_index;
|
|
||||||
TCGMemOp s_bits;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
data_regl = *args++;
|
data_regl = *args++;
|
||||||
|
@ -1306,14 +1300,10 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
|
||||||
opc = get_memop(oi);
|
opc = get_memop(oi);
|
||||||
|
|
||||||
#if defined(CONFIG_SOFTMMU)
|
#if defined(CONFIG_SOFTMMU)
|
||||||
mem_index = get_mmuidx(oi);
|
|
||||||
s_bits = opc & 3;
|
|
||||||
|
|
||||||
/* Note that we eliminated the helper's address argument,
|
/* Note that we eliminated the helper's address argument,
|
||||||
so we can reuse that for the base. */
|
so we can reuse that for the base. */
|
||||||
base = (TARGET_LONG_BITS == 32 ? TCG_REG_A1 : TCG_REG_A2);
|
base = (TARGET_LONG_BITS == 32 ? TCG_REG_A1 : TCG_REG_A2);
|
||||||
tcg_out_tlb_load(s, base, addr_regl, addr_regh, mem_index,
|
tcg_out_tlb_load(s, base, addr_regl, addr_regh, oi, label_ptr, 0);
|
||||||
s_bits, label_ptr, 0);
|
|
||||||
tcg_out_qemu_st_direct(s, data_regl, data_regh, base, opc);
|
tcg_out_qemu_st_direct(s, data_regl, data_regh, base, opc);
|
||||||
add_qemu_ldst_label(s, 0, oi, data_regl, data_regh, addr_regl, addr_regh,
|
add_qemu_ldst_label(s, 0, oi, data_regl, data_regh, addr_regl, addr_regh,
|
||||||
s->code_ptr, label_ptr);
|
s->code_ptr, label_ptr);
|
||||||
|
|
Loading…
Reference in New Issue