qemu-devel
[Top][All Lists]
Advanced

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

[PATCH] target/mips: Simplify gen_msa_BxZ() 'if' condition


From: Philippe Mathieu-Daudé
Subject: [PATCH] target/mips: Simplify gen_msa_BxZ() 'if' condition
Date: Fri, 4 Dec 2020 23:59:53 +0100

As gen_check_zero_element() already produces a boolean,
replace 'if (x) tcg_gen_setcondi_tl()' by tcg_gen_xori_tl(x)
which already contains the if (x).

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Based-on: <20201202184415.1434484-1-f4bug@amsat.org>
---
 target/mips/translate.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/target/mips/translate.c b/target/mips/translate.c
index 8a35d4d0d03..112a5becfbb 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -28778,9 +28778,7 @@ static bool gen_msa_BxZ(DisasContext *ctx, int df, int 
wt, int s16, bool if_not)
     }
 
     gen_check_zero_element(bcond, df, wt);
-    if (if_not) {
-        tcg_gen_setcondi_tl(TCG_COND_EQ, bcond, bcond, 0);
-    }
+    tcg_gen_xori_tl(bcond, bcond, if_not);
 
     ctx->btarget = ctx->base.pc_next + (s16 << 2) + 4;
     ctx->hflags |= MIPS_HFLAG_BC;
-- 
2.26.2




reply via email to

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