diff options
author | Richard Henderson <rth@twiddle.net> | 2017-06-20 12:24:57 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2017-10-24 21:44:12 +0200 |
commit | 1807f4c40098070008eb84b2032e25b7ac42569e (patch) | |
tree | 93df648c74a1d050282dcafb0550463d2a5c778e /tcg/tcg.h | |
parent | c6c7d84df8889b9d6298466999b88a8a42e5f976 (diff) | |
download | qemu-1807f4c40098070008eb84b2032e25b7ac42569e.zip qemu-1807f4c40098070008eb84b2032e25b7ac42569e.tar.gz qemu-1807f4c40098070008eb84b2032e25b7ac42569e.tar.bz2 |
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>
Diffstat (limited to 'tcg/tcg.h')
-rw-r--r-- | tcg/tcg.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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]; |