mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
tcg: Improve TCGv_ptr support
Drop TCGV_PTR_TO_NAT and TCGV_NAT_TO_PTR internal macros. Add tcg_temp_local_new_ptr, tcg_gen_brcondi_ptr, tcg_gen_ext_i32_ptr, tcg_gen_trunc_i64_ptr, tcg_gen_extu_ptr_i64, tcg_gen_trunc_ptr_i32. Use inlines instead of macros where possible. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
9a938d86b0
commit
5bfa803448
4 changed files with 130 additions and 94 deletions
31
tcg/tcg.c
31
tcg/tcg.c
|
@ -980,7 +980,7 @@ TCGTemp *tcg_global_mem_new_internal(TCGType type, TCGv_ptr base,
|
|||
return ts;
|
||||
}
|
||||
|
||||
static TCGTemp *tcg_temp_new_internal(TCGType type, int temp_local)
|
||||
TCGTemp *tcg_temp_new_internal(TCGType type, bool temp_local)
|
||||
{
|
||||
TCGContext *s = tcg_ctx;
|
||||
TCGTemp *ts;
|
||||
|
@ -1025,18 +1025,6 @@ static TCGTemp *tcg_temp_new_internal(TCGType type, int temp_local)
|
|||
return ts;
|
||||
}
|
||||
|
||||
TCGv_i32 tcg_temp_new_internal_i32(int temp_local)
|
||||
{
|
||||
TCGTemp *t = tcg_temp_new_internal(TCG_TYPE_I32, temp_local);
|
||||
return temp_tcgv_i32(t);
|
||||
}
|
||||
|
||||
TCGv_i64 tcg_temp_new_internal_i64(int temp_local)
|
||||
{
|
||||
TCGTemp *t = tcg_temp_new_internal(TCG_TYPE_I64, temp_local);
|
||||
return temp_tcgv_i64(t);
|
||||
}
|
||||
|
||||
TCGv_vec tcg_temp_new_vec(TCGType type)
|
||||
{
|
||||
TCGTemp *t;
|
||||
|
@ -1072,7 +1060,7 @@ TCGv_vec tcg_temp_new_vec_matching(TCGv_vec match)
|
|||
return temp_tcgv_vec(t);
|
||||
}
|
||||
|
||||
static void tcg_temp_free_internal(TCGTemp *ts)
|
||||
void tcg_temp_free_internal(TCGTemp *ts)
|
||||
{
|
||||
TCGContext *s = tcg_ctx;
|
||||
int k, idx;
|
||||
|
@ -1093,21 +1081,6 @@ static void tcg_temp_free_internal(TCGTemp *ts)
|
|||
set_bit(idx, s->free_temps[k].l);
|
||||
}
|
||||
|
||||
void tcg_temp_free_i32(TCGv_i32 arg)
|
||||
{
|
||||
tcg_temp_free_internal(tcgv_i32_temp(arg));
|
||||
}
|
||||
|
||||
void tcg_temp_free_i64(TCGv_i64 arg)
|
||||
{
|
||||
tcg_temp_free_internal(tcgv_i64_temp(arg));
|
||||
}
|
||||
|
||||
void tcg_temp_free_vec(TCGv_vec arg)
|
||||
{
|
||||
tcg_temp_free_internal(tcgv_vec_temp(arg));
|
||||
}
|
||||
|
||||
TCGv_i32 tcg_const_i32(int32_t val)
|
||||
{
|
||||
TCGv_i32 t0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue