[PATCH 2/3] target/tricore: Use tcg_constant_tl() instead of tcg_gen_movi_tl()

Philippe Mathieu-Daudé posted 3 patches 1 month, 2 weeks ago
[PATCH 2/3] target/tricore: Use tcg_constant_tl() instead of tcg_gen_movi_tl()
Posted by Philippe Mathieu-Daudé 1 month, 2 weeks ago
Directly use tcg_constant_tl() for constant integer,
this save a call to tcg_gen_movi_tl().

Inspired-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/tricore/translate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index a46a03e1fd8..4a12d2ca191 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -2732,8 +2732,7 @@ static inline void gen_insert(TCGv ret, TCGv r1, TCGv r2, TCGv width, TCGv pos)
     TCGv temp = tcg_temp_new();
     TCGv temp2 = tcg_temp_new();
 
-    tcg_gen_movi_tl(mask, 1);
-    tcg_gen_shl_tl(mask, mask, width);
+    tcg_gen_shl_tl(mask, tcg_constant_tl(1), width);
     tcg_gen_subi_tl(mask, mask, 1);
     tcg_gen_shl_tl(mask, mask, pos);
 
-- 
2.45.2


Re: [PATCH 2/3] target/tricore: Use tcg_constant_tl() instead of tcg_gen_movi_tl()
Posted by Richard Henderson 1 month, 2 weeks ago
On 10/4/24 13:26, Philippe Mathieu-Daudé wrote:
> Directly use tcg_constant_tl() for constant integer,
> this save a call to tcg_gen_movi_tl().
> 
> Inspired-by: Richard Henderson<richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   target/tricore/translate.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~