[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 62/70] target/xtensa: Tidy translate_bb
From: |
Richard Henderson |
Subject: |
[PATCH 62/70] target/xtensa: Tidy translate_bb |
Date: |
Sun, 26 Feb 2023 19:42:25 -1000 |
Replace ifdefs with C, tcg_const_i32 with tcg_constant_i32.
We only need a single temporary for this.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/xtensa/translate.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 3ea50d8bc3..e3fcd50691 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -1406,19 +1406,15 @@ static void translate_b(DisasContext *dc, const
OpcodeArg arg[],
static void translate_bb(DisasContext *dc, const OpcodeArg arg[],
const uint32_t par[])
{
-#if TARGET_BIG_ENDIAN
- TCGv_i32 bit = tcg_const_i32(0x80000000u);
-#else
- TCGv_i32 bit = tcg_const_i32(0x00000001u);
-#endif
TCGv_i32 tmp = tcg_temp_new_i32();
+
tcg_gen_andi_i32(tmp, arg[1].in, 0x1f);
-#if TARGET_BIG_ENDIAN
- tcg_gen_shr_i32(bit, bit, tmp);
-#else
- tcg_gen_shl_i32(bit, bit, tmp);
-#endif
- tcg_gen_and_i32(tmp, arg[0].in, bit);
+ if (TARGET_BIG_ENDIAN) {
+ tcg_gen_shr_i32(tmp, tcg_constant_i32(0x80000000u), tmp);
+ } else {
+ tcg_gen_shl_i32(tmp, tcg_constant_i32(0x00000001u), tmp);
+ }
+ tcg_gen_and_i32(tmp, arg[0].in, tmp);
gen_brcondi(dc, par[0], tmp, 0, arg[2].imm);
}
--
2.34.1
- Re: [PATCH 64/70] target/xtensa: Avoid tcg_const_i32 in translate_l32r, (continued)
- [PATCH 60/70] target/tricore: Drop some temp initialization, Richard Henderson, 2023/02/27
- [PATCH 59/70] target/tricore: Use setcondi instead of explicit allocation, Richard Henderson, 2023/02/27
- [PATCH 63/70] target/xtensa: Tidy translate_clamps, Richard Henderson, 2023/02/27
- [PATCH 65/70] target/xtensa: Use tcg_gen_subfi_i32 in translate_sll, Richard Henderson, 2023/02/27
- [PATCH 67/70] target/xtensa: Avoid tcg_const_i32, Richard Henderson, 2023/02/27
- [PATCH 61/70] target/tricore: Avoid tcg_const_i32, Richard Henderson, 2023/02/27
- [PATCH 62/70] target/xtensa: Tidy translate_bb,
Richard Henderson <=
- [PATCH 69/70] tcg: Drop tcg_const_*_vec, Richard Henderson, 2023/02/27
- [PATCH 66/70] target/xtensa: Split constant in bit shift, Richard Henderson, 2023/02/27
- [PATCH 68/70] tcg: Replace tcg_const_i64 in tcg-op.c, Richard Henderson, 2023/02/27
- [PATCH 70/70] tcg: Drop tcg_const_*, Richard Henderson, 2023/02/27