target/arm: Simplify disas_arm_insn

Fold away all of the cases that now just goto illegal_op,
because all of their internal bits are now in decodetree.

Backports commit 590057d969a54de5d97261701c5702b3bebc9c07 from qemu
This commit is contained in:
Richard Henderson 2019-11-20 12:00:54 -05:00 committed by Lioncash
parent e402eef2f0
commit 19f1da260f
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -10707,7 +10707,7 @@ static bool trans_PLI(DisasContext *s, arg_PLD *a)
static void disas_arm_insn(DisasContext *s, unsigned int insn) static void disas_arm_insn(DisasContext *s, unsigned int insn)
{ {
TCGContext *tcg_ctx = s->uc->tcg_ctx; TCGContext *tcg_ctx = s->uc->tcg_ctx;
unsigned int cond, op1; unsigned int cond = insn >> 28;
/* M variants do not implement ARM mode; this must raise the INVSTATE /* M variants do not implement ARM mode; this must raise the INVSTATE
* UsageFault exception. * UsageFault exception.
@ -10725,8 +10725,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
check_exit_request(tcg_ctx); check_exit_request(tcg_ctx);
} }
cond = insn >> 28;
if (cond == 0xf) { if (cond == 0xf) {
/* In ARMv3 and v4 the NV condition is UNPREDICTABLE; we /* In ARMv3 and v4 the NV condition is UNPREDICTABLE; we
* choose to UNDEF. In ARMv5 and above the space is used * choose to UNDEF. In ARMv5 and above the space is used
@ -10790,11 +10788,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
goto illegal_op; goto illegal_op;
} }
return; return;
} else if ((insn & 0x0fe00000) == 0x0c400000) {
/* Coprocessor double register transfer. */
ARCH(5TE);
} else if ((insn & 0x0f000010) == 0x0e000010) {
/* Additional coprocessor register transfer. */
} }
goto illegal_op; goto illegal_op;
} }
@ -10809,39 +10802,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
} }
/* fall back to legacy decoder */ /* fall back to legacy decoder */
if ((insn & 0x0f900000) == 0x03000000) { switch ((insn >> 24) & 0xf) {
/* All done in decodetree. Illegal ops reach here. */
goto illegal_op;
} else if ((insn & 0x0f900000) == 0x01000000
&& (insn & 0x00000090) != 0x00000090) {
/* miscellaneous instructions */
/* All done in decodetree. Illegal ops reach here. */
goto illegal_op;
} else if (((insn & 0x0e000000) == 0 &&
(insn & 0x00000090) != 0x90) ||
((insn & 0x0e000000) == (1 << 25))) {
/* Data-processing (reg, reg-shift-reg, imm). */
/* All done in decodetree. Reach here for illegal ops. */
goto illegal_op;
} else {
/* other instructions */
op1 = (insn >> 24) & 0xf;
switch(op1) {
case 0x0:
case 0x1:
/* All done in decodetree. Reach here for illegal ops. */
goto illegal_op;
case 0x4:
case 0x5:
case 0x6:
case 0x7:
case 0x08:
case 0x09:
case 0xa:
case 0xb:
case 0xf:
/* All done in decodetree. Reach here for illegal ops. */
goto illegal_op;
case 0xc: case 0xc:
case 0xd: case 0xd:
case 0xe: case 0xe:
@ -10861,7 +10822,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
break; break;
} }
} }
}
static bool thumb_insn_is_16bit(DisasContext *s, uint32_t pc, uint32_t insn) static bool thumb_insn_is_16bit(DisasContext *s, uint32_t pc, uint32_t insn)
{ {