mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
tcg: Introduce temp_arg, export temp_idx
At the same time, drop the TCGContext argument and use tcg_ctx instead. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
c6c7d84df8
commit
1807f4c400
2 changed files with 18 additions and 13 deletions
12
tcg/tcg.h
12
tcg/tcg.h
|
@ -729,6 +729,18 @@ struct TCGContext {
|
|||
extern TCGContext tcg_ctx;
|
||||
extern bool parallel_cpus;
|
||||
|
||||
static inline size_t temp_idx(TCGTemp *ts)
|
||||
{
|
||||
ptrdiff_t n = ts - tcg_ctx.temps;
|
||||
tcg_debug_assert(n >= 0 && n < tcg_ctx.nb_temps);
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline TCGArg temp_arg(TCGTemp *ts)
|
||||
{
|
||||
return temp_idx(ts);
|
||||
}
|
||||
|
||||
static inline TCGTemp *arg_temp(TCGArg a)
|
||||
{
|
||||
return a == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[a];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue