aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-11-23 18:05:17 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-12-20 17:44:57 +0100
commita9ca97ea9e582a77629db9af61603b5fddc9ba2c (patch)
tree9ef6ae64640b649dbc4598f8b728f1c536bb8da3 /accel/tcg
parent68df8c8dba57f539d24f1a92a8699a179d9bb6fb (diff)
downloadqemu-a9ca97ea9e582a77629db9af61603b5fddc9ba2c.zip
qemu-a9ca97ea9e582a77629db9af61603b5fddc9ba2c.tar.gz
qemu-a9ca97ea9e582a77629db9af61603b5fddc9ba2c.tar.bz2
accel/tcg: Un-inline translator_is_same_page()
Remove the single target-specific definition used in "exec/translator.h" (TARGET_PAGE_MASK) by un-inlining is_same_page(). Rename the method as translator_is_same_page() and improve its documentation. Use it in translator_use_goto_tb(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20241218154145.71353-1-philmd@linaro.org>
Diffstat (limited to 'accel/tcg')
-rw-r--r--accel/tcg/translator.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index ce5eae4..ef1538b 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -104,6 +104,11 @@ static void gen_tb_end(const TranslationBlock *tb, uint32_t cflags,
}
}
+bool translator_is_same_page(const DisasContextBase *db, vaddr addr)
+{
+ return ((addr ^ db->pc_first) & TARGET_PAGE_MASK) == 0;
+}
+
bool translator_use_goto_tb(DisasContextBase *db, vaddr dest)
{
/* Suppress goto_tb if requested. */
@@ -112,7 +117,7 @@ bool translator_use_goto_tb(DisasContextBase *db, vaddr dest)
}
/* Check for the dest on the same page as the start of the TB. */
- return ((db->pc_first ^ dest) & TARGET_PAGE_MASK) == 0;
+ return translator_is_same_page(db, dest);
}
void translator_loop(CPUState *cpu, TranslationBlock *tb, int *max_insns,