[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 51/69] target/arm: Convert T16 add/sub (3 low, 2
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v3 51/69] target/arm: Convert T16 add/sub (3 low, 2 low and imm) |
Date: |
Wed, 28 Aug 2019 12:04:38 -0700 |
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/translate.c | 26 ++------------------------
target/arm/t16.decode | 16 ++++++++++++++++
2 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index b6ee123bf5..fa6892d6af 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -10668,31 +10668,9 @@ static void disas_thumb_insn(DisasContext *s, uint32_t
insn)
* 0b0001_1xxx_xxxx_xxxx
* - Add, subtract (three low registers)
* - Add, subtract (two low registers and immediate)
+ * In decodetree.
*/
- rn = (insn >> 3) & 7;
- tmp = load_reg(s, rn);
- if (insn & (1 << 10)) {
- /* immediate */
- tmp2 = tcg_temp_new_i32();
- tcg_gen_movi_i32(tmp2, (insn >> 6) & 7);
- } else {
- /* reg */
- rm = (insn >> 6) & 7;
- tmp2 = load_reg(s, rm);
- }
- if (insn & (1 << 9)) {
- if (s->condexec_mask)
- tcg_gen_sub_i32(tmp, tmp, tmp2);
- else
- gen_sub_CC(tmp, tmp, tmp2);
- } else {
- if (s->condexec_mask)
- tcg_gen_add_i32(tmp, tmp, tmp2);
- else
- gen_add_CC(tmp, tmp, tmp2);
- }
- tcg_temp_free_i32(tmp2);
- store_reg(s, rd, tmp);
+ goto illegal_op;
} else {
/* shift immediate */
rm = (insn >> 3) & 7;
diff --git a/target/arm/t16.decode b/target/arm/t16.decode
index a7a437f930..2b5f368d31 100644
--- a/target/arm/t16.decode
+++ b/target/arm/t16.decode
@@ -117,3 +117,19 @@ ADD_rri 10101 rd:3 ........ \
STM 11000 ... ........ @ldstm
LDM_t16 11001 ... ........ @ldstm
+
+# Add/subtract (three low registers)
+
+@addsub_3 ....... rm:3 rn:3 rd:3 \
+ &s_rrr_shi %s shim=0 shty=0
+
+ADD_rrri 0001100 ... ... ... @addsub_3
+SUB_rrri 0001101 ... ... ... @addsub_3
+
+# Add/subtract (two low registers and immediate)
+
+@addsub_2i ....... imm:3 rn:3 rd:3 \
+ &s_rri_rot %s rot=0
+
+ADD_rri 0001 110 ... ... ... @addsub_2i
+SUB_rri 0001 111 ... ... ... @addsub_2i
--
2.17.1
- Re: [Qemu-devel] [PATCH v3 35/69] target/arm: Convert Clear-Exclusive, Barriers, (continued)
- [Qemu-devel] [PATCH v3 48/69] target/arm: Convert T16 load/store (immediate offset), Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 68/69] target/arm: Clean up disas_thumb_insn, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 69/69] target/arm: Inline gen_bx_im into callers, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 46/69] target/arm: Convert T16 data-processing (two low regs), Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 54/69] target/arm: Convert T16 add, compare, move (two high registers), Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 56/69] target/arm: Convert T16, extract, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 66/69] target/arm: Convert T16, Unconditional branch, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 62/69] target/arm: Convert T16, Conditional branches, Supervisor call, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 45/69] target/arm: Add skeleton for T16 decodetree, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 51/69] target/arm: Convert T16 add/sub (3 low, 2 low and imm),
Richard Henderson <=
- [Qemu-devel] [PATCH v3 52/69] target/arm: Convert T16 one low register and immediate, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 57/69] target/arm: Convert T16, Change processor state, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 53/69] target/arm: Convert T16 branch and exchange, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 64/69] target/arm: Convert T16, shift immediate, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 58/69] target/arm: Convert T16, Reverse bytes, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 60/69] target/arm: Split gen_nop_hint, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 61/69] target/arm: Convert T16, push and pop, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 67/69] target/arm: Convert T16, long branches, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v3 65/69] target/arm: Convert T16, load (literal), Richard Henderson, 2019/08/28