tcg/tci: Reuse tci_args_l for exit_tb
Do not emit a uint64_t, but a tcg_target_ulong, aka uintptr_t. This reduces the size of the constant on 32-bit hosts. The assert for label != NULL has to be removed because that is a valid value for exit_tb. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2ed8a38192
commit
158d38737b
13
tcg/tci.c
13
tcg/tci.c
|
@ -160,9 +160,7 @@ tci_read_ulong(const tcg_target_ulong *regs, const uint8_t **tb_ptr)
|
||||||
|
|
||||||
static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr)
|
static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr)
|
||||||
{
|
{
|
||||||
tcg_target_ulong label = tci_read_i(tb_ptr);
|
return tci_read_i(tb_ptr);
|
||||||
tci_assert(label != 0);
|
|
||||||
return label;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -402,7 +400,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
|
||||||
tcg_target_ulong regs[TCG_TARGET_NB_REGS];
|
tcg_target_ulong regs[TCG_TARGET_NB_REGS];
|
||||||
long tcg_temps[CPU_TEMP_BUF_NLONGS];
|
long tcg_temps[CPU_TEMP_BUF_NLONGS];
|
||||||
uintptr_t sp_value = (uintptr_t)(tcg_temps + CPU_TEMP_BUF_NLONGS);
|
uintptr_t sp_value = (uintptr_t)(tcg_temps + CPU_TEMP_BUF_NLONGS);
|
||||||
uintptr_t ret = 0;
|
|
||||||
|
|
||||||
regs[TCG_AREG0] = (tcg_target_ulong)env;
|
regs[TCG_AREG0] = (tcg_target_ulong)env;
|
||||||
regs[TCG_REG_CALL_STACK] = sp_value;
|
regs[TCG_REG_CALL_STACK] = sp_value;
|
||||||
|
@ -817,9 +814,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
|
||||||
/* QEMU specific operations. */
|
/* QEMU specific operations. */
|
||||||
|
|
||||||
case INDEX_op_exit_tb:
|
case INDEX_op_exit_tb:
|
||||||
ret = *(uint64_t *)tb_ptr;
|
tci_args_l(&tb_ptr, &ptr);
|
||||||
goto exit;
|
return (uintptr_t)ptr;
|
||||||
break;
|
|
||||||
case INDEX_op_goto_tb:
|
case INDEX_op_goto_tb:
|
||||||
/* Jump address is aligned */
|
/* Jump address is aligned */
|
||||||
tb_ptr = QEMU_ALIGN_PTR_UP(tb_ptr, 4);
|
tb_ptr = QEMU_ALIGN_PTR_UP(tb_ptr, 4);
|
||||||
|
@ -977,6 +974,4 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
|
||||||
}
|
}
|
||||||
tci_assert(tb_ptr == old_code_ptr + op_size);
|
tci_assert(tb_ptr == old_code_ptr + op_size);
|
||||||
}
|
}
|
||||||
exit:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -401,7 +401,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
|
||||||
|
|
||||||
switch (opc) {
|
switch (opc) {
|
||||||
case INDEX_op_exit_tb:
|
case INDEX_op_exit_tb:
|
||||||
tcg_out64(s, args[0]);
|
tcg_out_i(s, args[0]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INDEX_op_goto_tb:
|
case INDEX_op_goto_tb:
|
||||||
|
|
Loading…
Reference in a new issue