mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-08-04 04:21:03 +00:00
tcg: Introduce temp_arg, export temp_idx
At the same time, drop the TCGContext argument and use tcg_ctx instead. Backports commit 1807f4c40098070008eb84b2032e25b7ac42569e from qemu
This commit is contained in:
parent
a659a03ff5
commit
87f2067aac
|
@ -987,6 +987,18 @@ struct TCGContext {
|
||||||
TCGLabel *exitreq_label; // gen_tb_start()
|
TCGLabel *exitreq_label; // gen_tb_start()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline size_t temp_idx(TCGContext *tcg_ctx, 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(TCGContext *tcg_ctx, TCGTemp *ts)
|
||||||
|
{
|
||||||
|
return temp_idx(tcg_ctx, ts);
|
||||||
|
}
|
||||||
|
|
||||||
static inline TCGTemp *arg_temp(TCGContext *tcg_ctx, TCGArg a)
|
static inline TCGTemp *arg_temp(TCGContext *tcg_ctx, TCGArg a)
|
||||||
{
|
{
|
||||||
return a == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx->temps[a];
|
return a == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx->temps[a];
|
||||||
|
|
Loading…
Reference in a new issue