]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/mips: Use tcg_constant_tl() instead of tcg_gen_movi_tl()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 4 Oct 2024 18:53:26 +0000 (15:53 -0300)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 15 Oct 2024 15:21:04 +0000 (12:21 -0300)
commit35845cf8fe8b484dcd5cead7a2b68d7c3099948b
tree8f066e20be043460690c21f33cdf1ed4e12068c3
parentd0b24b7f50e17ad288dd7647dbaf09c81c30f691
target/mips: Use tcg_constant_tl() instead of tcg_gen_movi_tl()

Directly use tcg_constant_tl() for constant integer, this
save a call to tcg_gen_movi_tl(), often saving a temp register.

Most of the places found using the following Coccinelle spatch script:

  @@
  identifier tmp;
  constant val;
  @@
  *    TCGv tmp = tcg_temp_new();
       ...
  *    tcg_gen_movi_tl(tmp, val);

  @@
  identifier tmp;
  int val;
  @@
  *    TCGv tmp = tcg_temp_new();
       ...
  *    tcg_gen_movi_i64(tmp, val);

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20241004202621.4321-2-philmd@linaro.org>
target/mips/tcg/nanomips_translate.c.inc
target/mips/tcg/translate.c