mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
accel/tcg: Precompute curr_cflags into cpu->tcg_cflags
The primary motivation is to remove a dozen insns along the fast-path in tb_lookup. As a byproduct, this allows us to completely remove parallel_cpus. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -513,8 +513,6 @@ struct TranslationBlock {
|
||||
uintptr_t jmp_dest[2];
|
||||
};
|
||||
|
||||
extern bool parallel_cpus;
|
||||
|
||||
/* Hide the qatomic_read to make code a little easier on the eyes */
|
||||
static inline uint32_t tb_cflags(const TranslationBlock *tb)
|
||||
{
|
||||
@@ -524,10 +522,7 @@ static inline uint32_t tb_cflags(const TranslationBlock *tb)
|
||||
/* current cflags for hashing/comparison */
|
||||
static inline uint32_t curr_cflags(CPUState *cpu)
|
||||
{
|
||||
uint32_t cflags = deposit32(0, CF_CLUSTER_SHIFT, 8, cpu->cluster_index);
|
||||
cflags |= parallel_cpus ? CF_PARALLEL : 0;
|
||||
cflags |= icount_enabled() ? CF_USE_ICOUNT : 0;
|
||||
return cflags;
|
||||
return cpu->tcg_cflags;
|
||||
}
|
||||
|
||||
/* TranslationBlock invalidate API */
|
||||
|
||||
Reference in New Issue
Block a user