[PATCH 1/3] target/arm: Use tcg_constant_i32() in op_smlad()

Philippe Mathieu-Daudé posted 3 patches 4 years, 4 months ago
There is a newer version of this series
[PATCH 1/3] target/arm: Use tcg_constant_i32() in op_smlad()
Posted by Philippe Mathieu-Daudé 4 years, 4 months ago
Avoid using a TCG temporary for a read-only constant.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/arm/translate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/arm/translate.c b/target/arm/translate.c
index f7086c66a59..b41e0f50dfe 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -7873,10 +7873,9 @@ static bool op_smlad(DisasContext *s, arg_rrrr *a, bool m_swap, bool sub)
         t3 = tcg_temp_new_i32();
         tcg_gen_sari_i32(t3, t1, 31);
         qf = load_cpu_field(QF);
-        one = tcg_const_i32(1);
+        one = tcg_constant_i32(1);
         tcg_gen_movcond_i32(TCG_COND_NE, qf, t2, t3, one, qf);
         store_cpu_field(qf, QF);
-        tcg_temp_free_i32(one);
         tcg_temp_free_i32(t3);
         tcg_temp_free_i32(t2);
     }
-- 
2.31.1

Re: [PATCH 1/3] target/arm: Use tcg_constant_i32() in op_smlad()
Posted by Richard Henderson 4 years, 4 months ago
On 10/3/21 10:38 AM, Philippe Mathieu-Daudé wrote:
> Avoid using a TCG temporary for a read-only constant.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   target/arm/translate.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)

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

r~