OSDN Git Service

target/mips: Use tcg_constant_i32() in generate_exception_err()
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 15 Aug 2021 13:56:13 +0000 (15:56 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Wed, 25 Aug 2021 11:02:14 +0000 (13:02 +0200)
excp/err are temporaries input, so we can replace tcg_const_i32()
calls by tcg_constant_i32() equivalent.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210816205107.2051495-8-f4bug@amsat.org>

target/mips/tcg/translate.c

index c515a33..93b72c9 100644 (file)
@@ -1363,12 +1363,9 @@ static inline void restore_cpu_state(CPUMIPSState *env, DisasContext *ctx)
 
 void generate_exception_err(DisasContext *ctx, int excp, int err)
 {
-    TCGv_i32 texcp = tcg_const_i32(excp);
-    TCGv_i32 terr = tcg_const_i32(err);
     save_cpu_state(ctx, 1);
-    gen_helper_raise_exception_err(cpu_env, texcp, terr);
-    tcg_temp_free_i32(terr);
-    tcg_temp_free_i32(texcp);
+    gen_helper_raise_exception_err(cpu_env, tcg_constant_i32(excp),
+                                   tcg_constant_i32(err));
     ctx->base.is_jmp = DISAS_NORETURN;
 }