qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] target/nios2: Use DisasContext::zero constant instead of tem


From: Philippe Mathieu-Daudé
Subject: [PATCH 2/3] target/nios2: Use DisasContext::zero constant instead of temporary
Date: Sun, 3 Oct 2021 01:30:53 +0200

We already have a register holding the zero value in the constant
pool, use it instead of a temporary.

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

diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index c398c5320fb..8524a2f6dd8 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -613,17 +613,15 @@ static void divu(DisasContext *dc, uint32_t code, 
uint32_t flags)
 
     TCGv t0 = tcg_temp_new();
     TCGv t1 = tcg_temp_new();
-    TCGv t2 = tcg_const_tl(0);
     TCGv t3 = tcg_const_tl(1);
 
     tcg_gen_ext32u_tl(t0, load_gpr(dc, instr.a));
     tcg_gen_ext32u_tl(t1, load_gpr(dc, instr.b));
-    tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1);
+    tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, dc->zero, t3, t1);
     tcg_gen_divu_tl(cpu_R[instr.c], t0, t1);
     tcg_gen_ext32s_tl(cpu_R[instr.c], cpu_R[instr.c]);
 
     tcg_temp_free(t3);
-    tcg_temp_free(t2);
     tcg_temp_free(t1);
     tcg_temp_free(t0);
 }
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]