Date: Tue, Aug 4, 2020 12:06 PM
To: "qemu-discuss"<qemu-discuss@nongnu.org>;
Subject: Question on implementation detail of `temp_sync`
Hello to the list,
Recently I have been studying the code of TCG, and get confused by the following detail in function `temp_sync` in tcg/tcg.c:
case TEMP_VAL_CONST:
/* If we're going to free the temp immediately, then we won't
require it later in a register, so attempt to store the
constant to memory directly. */
if (free_or_dead
&& tcg_out_sti(s, ts->type, ts->val,
ts->mem_base->reg, ts->mem_offset)) {
break;
}
temp_load(s, ts, tcg_target_available_regs[ts->type],
allocated_regs, preferred_regs);
/* fallthrough */
movi_i32
Would it be better to remove the `free_or_dead` in the if statement, i.e. turn the function to be:
case TEMP_VAL_CONST:
if (tcg_out_sti(s, ts->type, ts->val,
ts->mem_base->reg, ts->mem_offset)) {
break;
}
temp_load(s, ts, tcg_target_available_regs[ts->type],
allocated_regs, preferred_regs);
/* fallthrough */