summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell2020-08-03 13:18:46 +0200
committerPeter Maydell2020-08-24 11:02:07 +0200
commit8198c071bc55bee55ef4f104a5b125f541b51096 (patch)
treea06630ced6c358a8d9e69bd47cdd7881d82a95c6
parenttarget/arm: Convert A32 coprocessor insns to decodetree (diff)
downloadqemu-8198c071bc55bee55ef4f104a5b125f541b51096.tar.gz
qemu-8198c071bc55bee55ef4f104a5b125f541b51096.tar.xz
qemu-8198c071bc55bee55ef4f104a5b125f541b51096.zip
target/arm: Tidy up disas_arm_insn()
The only thing left in the "legacy decoder" is the handling of disas_xscale_insn(), and we can simplify the code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200803111849.13368-5-peter.maydell@linaro.org
-rw-r--r--target/arm/translate.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 6ee920eec5..362d1cc50f 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -8342,26 +8342,18 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
return;
}
/* fall back to legacy decoder */
-
- switch ((insn >> 24) & 0xf) {
- case 0xc:
- case 0xd:
- case 0xe:
- {
- /* First check for coprocessor space used for XScale/iwMMXt insns */
- int cpnum = (insn >> 8) & 0xf;
-
- if (arm_dc_feature(s, ARM_FEATURE_XSCALE) && (cpnum < 2)) {
+ /* TODO: convert xscale/iwmmxt decoder to decodetree ?? */
+ if (arm_dc_feature(s, ARM_FEATURE_XSCALE)) {
+ if (((insn & 0x0c000e00) == 0x0c000000)
+ && ((insn & 0x03000000) != 0x03000000)) {
+ /* Coprocessor insn, coprocessor 0 or 1 */
disas_xscale_insn(s, insn);
- break;
+ return;
}
- /* fall through */
- }
- default:
- illegal_op:
- unallocated_encoding(s);
- break;
}
+
+illegal_op:
+ unallocated_encoding(s);
}
static bool thumb_insn_is_16bit(DisasContext *s, uint32_t pc, uint32_t insn)