diff mbox series

[v3,10/30] tcg: Use tcg_constant_i32 in tcg_gen_io_start

Message ID 20230225085945.1798188-11-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg: Simplify temporary usage | expand

Commit Message

Richard Henderson Feb. 25, 2023, 8:59 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 include/exec/gen-icount.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Daniel Henrique Barboza Feb. 25, 2023, 9:34 a.m. UTC | #1
On 2/25/23 05:59, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

>   include/exec/gen-icount.h | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h
> index c57204ddad..4d8b1f9ae5 100644
> --- a/include/exec/gen-icount.h
> +++ b/include/exec/gen-icount.h
> @@ -10,11 +10,9 @@ static TCGOp *icount_start_insn;
>   
>   static inline void gen_io_start(void)
>   {
> -    TCGv_i32 tmp = tcg_const_i32(1);
> -    tcg_gen_st_i32(tmp, cpu_env,
> +    tcg_gen_st_i32(tcg_constant_i32(1), cpu_env,
>                      offsetof(ArchCPU, parent_obj.can_do_io) -
>                      offsetof(ArchCPU, env));
> -    tcg_temp_free_i32(tmp);
>   }
>   
>   static inline void gen_tb_start(const TranslationBlock *tb)
Philippe Mathieu-Daudé Feb. 25, 2023, 9:57 a.m. UTC | #2
On 25/2/23 09:59, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   include/exec/gen-icount.h | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h
index c57204ddad..4d8b1f9ae5 100644
--- a/include/exec/gen-icount.h
+++ b/include/exec/gen-icount.h
@@ -10,11 +10,9 @@  static TCGOp *icount_start_insn;
 
 static inline void gen_io_start(void)
 {
-    TCGv_i32 tmp = tcg_const_i32(1);
-    tcg_gen_st_i32(tmp, cpu_env,
+    tcg_gen_st_i32(tcg_constant_i32(1), cpu_env,
                    offsetof(ArchCPU, parent_obj.can_do_io) -
                    offsetof(ArchCPU, env));
-    tcg_temp_free_i32(tmp);
 }
 
 static inline void gen_tb_start(const TranslationBlock *tb)