mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
tcg: Merge memop and mmu_idx parameters to qemu_ld/st
At the tcg opcode level, not at the tcg-op.h generator level. This requires minor changes through all of the tcg backends, but none of the cpu translators. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
1eeace9c23
commit
59227d5d45
15 changed files with 140 additions and 71 deletions
38
tcg/tcg.h
38
tcg/tcg.h
|
@ -826,6 +826,44 @@ static inline size_t tcg_current_code_size(TCGContext *s)
|
|||
return tcg_ptr_byte_diff(s->code_ptr, s->code_buf);
|
||||
}
|
||||
|
||||
/* Combine the TCGMemOp and mmu_idx parameters into a single value. */
|
||||
typedef uint32_t TCGMemOpIdx;
|
||||
|
||||
/**
|
||||
* make_memop_idx
|
||||
* @op: memory operation
|
||||
* @idx: mmu index
|
||||
*
|
||||
* Encode these values into a single parameter.
|
||||
*/
|
||||
static inline TCGMemOpIdx make_memop_idx(TCGMemOp op, unsigned idx)
|
||||
{
|
||||
tcg_debug_assert(idx <= 15);
|
||||
return (op << 4) | idx;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_memop
|
||||
* @oi: combined op/idx parameter
|
||||
*
|
||||
* Extract the memory operation from the combined value.
|
||||
*/
|
||||
static inline TCGMemOp get_memop(TCGMemOpIdx oi)
|
||||
{
|
||||
return oi >> 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_mmuidx
|
||||
* @oi: combined op/idx parameter
|
||||
*
|
||||
* Extract the mmu index from the combined value.
|
||||
*/
|
||||
static inline unsigned get_mmuidx(TCGMemOpIdx oi)
|
||||
{
|
||||
return oi & 15;
|
||||
}
|
||||
|
||||
/**
|
||||
* tcg_qemu_tb_exec:
|
||||
* @env: CPUArchState * for the CPU
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue