[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 57/68] target/arm: Convert T16, Reverse bytes
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v2 57/68] target/arm: Convert T16, Reverse bytes |
Date: |
Mon, 19 Aug 2019 14:37:44 -0700 |
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/translate.c | 18 +++---------------
target/arm/t16.decode | 9 +++++++++
2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 368f0ab147..176cba2992 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -10608,7 +10608,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t
insn)
static void disas_thumb_insn(DisasContext *s, uint32_t insn)
{
- uint32_t val, op, rm, rn, rd, shift, cond;
+ uint32_t val, op, rm, rd, shift, cond;
int32_t offset;
int i;
TCGv_i32 tmp;
@@ -10805,20 +10805,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t
insn)
break;
}
- /* Otherwise this is rev */
- ARCH(6);
- rn = (insn >> 3) & 0x7;
- rd = insn & 0x7;
- tmp = load_reg(s, rn);
- switch (op1) {
- case 0: tcg_gen_bswap32_i32(tmp, tmp); break;
- case 1: gen_rev16(tmp, tmp); break;
- case 3: gen_revsh(tmp, tmp); break;
- default:
- g_assert_not_reached();
- }
- store_reg(s, rd, tmp);
- break;
+ /* Otherwise this is rev, in decodetree */
+ goto illegal_op;
}
case 6: /* setend, cps; in decodetree */
diff --git a/target/arm/t16.decode b/target/arm/t16.decode
index 3bf1a31731..ec21be7ef0 100644
--- a/target/arm/t16.decode
+++ b/target/arm/t16.decode
@@ -24,6 +24,7 @@
&s_rri_rot !extern s rn rd imm rot
&s_rrrr !extern s rd rn rm ra
&rrr_rot !extern rd rn rm rot
+&rr !extern rd rm
&ri !extern rd imm
&r !extern rm
&ldst_rr !extern p w u rn rt rm shimm shtype
@@ -195,3 +196,11 @@ SETEND 1011 0110 010 1 E:1 000 &setend
CPS_v6m 1011 0110 011 im:1 00 I:1 F:1
CPS 1011 0110 011 . 0 A:1 I:1 F:1 &cps mode=0 M=0 %imod
}
+
+# Reverse bytes
+
+@rdm .... .... .. rm:3 rd:3 &rr
+
+REV 1011 1010 00 ... ... @rdm
+REV16 1011 1010 01 ... ... @rdm
+REVSH 1011 1010 11 ... ... @rdm
--
2.17.1
- [Qemu-devel] [PATCH v2 54/68] target/arm: Convert T16 adjust sp (immediate), (continued)
- [Qemu-devel] [PATCH v2 54/68] target/arm: Convert T16 adjust sp (immediate), Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 55/68] target/arm: Convert T16, extract, Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 58/68] target/arm: Convert T16, nop hints, Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 50/68] target/arm: Convert T16 add/sub (3 low, 2 low and imm), Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 56/68] target/arm: Convert T16, Change processor state, Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 57/68] target/arm: Convert T16, Reverse bytes,
Richard Henderson <=
- [Qemu-devel] [PATCH v2 61/68] target/arm: Convert T16, Conditional branches, Supervisor call, Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 59/68] target/arm: Split gen_nop_hint, Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 60/68] target/arm: Convert T16, push and pop, Richard Henderson, 2019/08/19
- [Qemu-devel] [PATCH v2 62/68] target/arm: Convert T16, Miscellaneous 16-bit instructions, Richard Henderson, 2019/08/19