[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/27] accel/tcg: Hoist tb_cflags to a local in translator_loop
From: |
Richard Henderson |
Subject: |
[PULL 26/27] accel/tcg: Hoist tb_cflags to a local in translator_loop |
Date: |
Wed, 21 Jul 2021 09:59:53 -1000 |
The access internal to tb_cflags() is atomic.
Avoid re-reading it as such for the multiple uses.
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/translator.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index 4f3728c278..b45337f3ba 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -50,6 +50,7 @@ bool translator_use_goto_tb(DisasContextBase *db,
target_ulong dest)
void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
CPUState *cpu, TranslationBlock *tb, int max_insns)
{
+ uint32_t cflags = tb_cflags(tb);
bool plugin_enabled;
/* Initialize DisasContext */
@@ -72,8 +73,7 @@ void translator_loop(const TranslatorOps *ops,
DisasContextBase *db,
ops->tb_start(db, cpu);
tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */
- plugin_enabled = plugin_gen_tb_start(cpu, tb,
- tb_cflags(db->tb) & CF_MEMI_ONLY);
+ plugin_enabled = plugin_gen_tb_start(cpu, tb, cflags & CF_MEMI_ONLY);
while (true) {
db->num_insns++;
@@ -88,14 +88,13 @@ void translator_loop(const TranslatorOps *ops,
DisasContextBase *db,
update db->pc_next and db->is_jmp to indicate what should be
done next -- either exiting this loop or locate the start of
the next instruction. */
- if (db->num_insns == db->max_insns
- && (tb_cflags(db->tb) & CF_LAST_IO)) {
+ if (db->num_insns == db->max_insns && (cflags & CF_LAST_IO)) {
/* Accept I/O on the last instruction. */
gen_io_start();
ops->translate_insn(db, cpu);
} else {
/* we should only see CF_MEMI_ONLY for io_recompile */
- tcg_debug_assert(!(tb_cflags(db->tb) & CF_MEMI_ONLY));
+ tcg_debug_assert(!(cflags & CF_MEMI_ONLY));
ops->translate_insn(db, cpu);
}
--
2.25.1
- [PULL 07/27] accel/tcg: Remove ATOMIC_MMU_DECLS, (continued)
- [PULL 07/27] accel/tcg: Remove ATOMIC_MMU_DECLS, Richard Henderson, 2021/07/21
- [PULL 08/27] accel/tcg: Expand ATOMIC_MMU_LOOKUP_*, Richard Henderson, 2021/07/21
- [PULL 09/27] trace: Fold mem-internal.h into mem.h, Richard Henderson, 2021/07/21
- [PULL 10/27] accel/tcg: Push trace info building into atomic_common.c.inc, Richard Henderson, 2021/07/21
- [PULL 11/27] accel/tcg: Reduce CF_COUNT_MASK to match TCG_MAX_INSNS, Richard Henderson, 2021/07/21
- [PULL 12/27] accel/tcg: Move curr_cflags into cpu-exec.c, Richard Henderson, 2021/07/21
- [PULL 13/27] target/alpha: Drop goto_tb path in gen_call_pal, Richard Henderson, 2021/07/21
- [PULL 14/27] accel/tcg: Add CF_NO_GOTO_TB and CF_NO_GOTO_PTR, Richard Henderson, 2021/07/21
- [PULL 20/27] target/i386: Implement debug_check_breakpoint, Richard Henderson, 2021/07/21
- [PULL 17/27] accel/tcg: Use CF_NO_GOTO_{TB, PTR} in cpu_exec_step_atomic, Richard Henderson, 2021/07/21
- [PULL 26/27] accel/tcg: Hoist tb_cflags to a local in translator_loop,
Richard Henderson <=
- [PULL 22/27] target/avr: Implement gdb_adjust_breakpoint, Richard Henderson, 2021/07/21
- [PULL 19/27] target/arm: Implement debug_check_breakpoint, Richard Henderson, 2021/07/21
- [PULL 21/27] hw/core: Introduce CPUClass.gdb_adjust_breakpoint, Richard Henderson, 2021/07/21
- [PULL 24/27] accel/tcg: Move breakpoint recognition outside translation, Richard Henderson, 2021/07/21
- [PULL 25/27] accel/tcg: Remove TranslatorOps.breakpoint_check, Richard Henderson, 2021/07/21
- [PULL 27/27] accel/tcg: Record singlestep_enabled in tb->cflags, Richard Henderson, 2021/07/21
- [PULL 15/27] accel/tcg: Drop CF_NO_GOTO_PTR from -d nochain, Richard Henderson, 2021/07/21
- [PULL 16/27] accel/tcg: Handle -singlestep in curr_cflags, Richard Henderson, 2021/07/21
- [PULL 23/27] accel/tcg: Merge tb_find into its only caller, Richard Henderson, 2021/07/21
- [PULL 18/27] hw/core: Introduce TCGCPUOps.debug_check_breakpoint, Richard Henderson, 2021/07/21