target/arm: Convert T16, Reverse bytes

Backports commit ae3002b0218a90f2088817c70b35d3832ec91c18 from qemu
This commit is contained in:
Richard Henderson 2019-11-20 12:30:05 -05:00 committed by Lioncash
parent 692ad18e62
commit 676f1c8783
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 12 additions and 15 deletions

View file

@ -24,6 +24,7 @@
&s_rri_rot !extern s rn rd imm rot &s_rri_rot !extern s rn rd imm rot
&s_rrrr !extern s rd rn rm ra &s_rrrr !extern s rd rn rm ra
&rrr_rot !extern rd rn rm rot &rrr_rot !extern rd rn rm rot
&rr !extern rd rm
&ri !extern rd imm &ri !extern rd imm
&r !extern rm &r !extern rm
&ldst_rr !extern p w u rn rt rm shimm shtype &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 1011 0110 011 . 0 A:1 I:1 F:1 &cps mode=0 M=0 %imod CPS 1011 0110 011 . 0 A:1 I:1 F:1 &cps mode=0 M=0 %imod
CPS_v7m 1011 0110 011 im:1 00 I:1 F:1 CPS_v7m 1011 0110 011 im:1 00 I:1 F:1
} }
# Reverse bytes
@rdm .... .... .. rm:3 rd:3 &rr
REV 1011 1010 00 ... ... @rdm
REV16 1011 1010 01 ... ... @rdm
REVSH 1011 1010 11 ... ... @rdm

View file

@ -11083,7 +11083,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn)
static void disas_thumb_insn(DisasContext *s, uint32_t insn) static void disas_thumb_insn(DisasContext *s, uint32_t insn)
{ {
TCGContext *tcg_ctx = s->uc->tcg_ctx; TCGContext *tcg_ctx = s->uc->tcg_ctx;
uint32_t val, op, rm, rn, rd, shift, cond; uint32_t val, op, rm, rd, shift, cond;
int32_t offset; int32_t offset;
int i; int i;
TCGv_i32 tmp; TCGv_i32 tmp;
@ -11281,20 +11281,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn)
break; break;
} }
/* Otherwise this is rev */ /* Otherwise this is rev, in decodetree */
ARCH(6); goto illegal_op;
rn = (insn >> 3) & 0x7;
rd = insn & 0x7;
tmp = load_reg(s, rn);
switch (op1) {
case 0: tcg_gen_bswap32_i32(tcg_ctx, tmp, tmp); break;
case 1: gen_rev16(s, tmp, tmp); break;
case 3: gen_revsh(s, tmp, tmp); break;
default:
g_assert_not_reached();
}
store_reg(s, rd, tmp);
break;
} }
case 6: /* setend, cps; in decodetree */ case 6: /* setend, cps; in decodetree */