On 5/12/23 15:41, Peter Maydell wrote:
Convert the test-and-branch-immediate insns TBZ and TBNZ
to decodetree.
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
---
target/arm/tcg/a64.decode | 7 +++++++
target/arm/tcg/translate-a64.c | 25 +++++--------------------
2 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode
index 86220569e13..68dc820ece0 100644
--- a/target/arm/tcg/a64.decode
+++ b/target/arm/tcg/a64.decode
@@ -121,3 +121,10 @@ BL 1 00101 .......................... @branch
@cbz sf:1 ...... nz:1 ................... rt:5 &cbz imm=%imm19
CBZ . 011010 . ................... ..... @cbz
+
+%imm14 5:s14 !function=times_4
+%imm31_19 31:1 19:5
+&tbz rt imm nz bitpos
+@tbz . ...... nz:1 ..... .............. rt:5 &tbz imm=%imm14
bitpos=%imm31_19
+
+TBZ . 011011 . ..... .............. ..... @tbz
Similarly with the single-use @format.
- tcg_gen_andi_i64(tcg_cmp, cpu_reg(s, rt), (1ULL << bit_pos));
+ tcg_gen_andi_i64(tcg_cmp, cpu_reg(s, a->rt), (1ULL << a->bitpos));
Can we drop the () around the bit, or use BIT()?.
Otherwise,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
r~