From c74824389e1a56781f947e23da68742e8faeaf77 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 16 Mar 2022 09:34:18 -0700 Subject: tcg: Fix indirect lowering vs TCG_OPF_COND_BRANCH With TCG_OPF_COND_BRANCH, we extended the lifetimes of globals across extended basic blocks. This means that the liveness computed in pass 1 does not kill globals in the same way as normal temps. Introduce TYPE_EBB to match this lifetime, so that we get correct register allocation for the temps that we introduce during the indirect lowering pass. Reviewed-by: Peter Maydell Fixes: b4cb76e6208 ("tcg: Do not kill globals at conditional branches") Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 73869fd9d0..27de13fae0 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -433,6 +433,8 @@ typedef enum TCGTempVal { typedef enum TCGTempKind { /* Temp is dead at the end of all basic blocks. */ TEMP_NORMAL, + /* Temp is live across conditional branch, but dead otherwise. */ + TEMP_EBB, /* Temp is saved across basic blocks but dead at the end of TBs. */ TEMP_LOCAL, /* Temp is saved across both basic blocks and translation blocks. */ -- cgit v1.2.3 From a61532faa5a4d5e021e35b6a4a1e180c72d4a22f Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 13 Apr 2022 09:50:17 -0700 Subject: tcg: Add tcg_constant_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to tcg_const_ptr, defer to tcg_constant_{i32,i64}. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 27de13fae0..61505d20ed 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -1056,9 +1056,11 @@ TCGv_vec tcg_constant_vec_matching(TCGv_vec match, unsigned vece, int64_t val); #if UINTPTR_MAX == UINT32_MAX # define tcg_const_ptr(x) ((TCGv_ptr)tcg_const_i32((intptr_t)(x))) # define tcg_const_local_ptr(x) ((TCGv_ptr)tcg_const_local_i32((intptr_t)(x))) +# define tcg_constant_ptr(x) ((TCGv_ptr)tcg_constant_i32((intptr_t)(x))) #else # define tcg_const_ptr(x) ((TCGv_ptr)tcg_const_i64((intptr_t)(x))) # define tcg_const_local_ptr(x) ((TCGv_ptr)tcg_const_local_i64((intptr_t)(x))) +# define tcg_constant_ptr(x) ((TCGv_ptr)tcg_constant_i64((intptr_t)(x))) #endif TCGLabel *gen_new_label(void); -- cgit v1.2.3