mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
target/arm: Add stubs for AArch32 Neon decodetree
Add the infrastructure for building and invoking a decodetree decoder
for the AArch32 Neon encodings. At the moment the new decoder covers
nothing, so we always fall back to the existing hand-written decode.
We follow the same pattern we did for the VFP decodetree conversion
(commit 78e138bc1f
and following): code that deals
with Neon will be moving gradually out to translate-neon.vfp.inc,
which we #include into translate.c.
In order to share the decode files between A32 and T32, we
split Neon into 3 parts:
* data-processing
* load-store
* 'shared' encodings
The first two groups of instructions have similar but not identical
A32 and T32 encodings, so we need to manually transform the T32
encoding into the A32 one before calling the decoder; the third group
covers the Neon instructions which are identical in A32 and T32.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200430181003.21682-4-peter.maydell@linaro.org
This commit is contained in:
parent
d1a6d3b594
commit
625e3dd44a
6 changed files with 169 additions and 2 deletions
|
@ -1313,8 +1313,9 @@ static TCGv_ptr vfp_reg_ptr(bool dp, int reg)
|
|||
|
||||
#define ARM_CP_RW_BIT (1 << 20)
|
||||
|
||||
/* Include the VFP decoder */
|
||||
/* Include the VFP and Neon decoders */
|
||||
#include "translate-vfp.inc.c"
|
||||
#include "translate-neon.inc.c"
|
||||
|
||||
static inline void iwmmxt_load_reg(TCGv_i64 var, int reg)
|
||||
{
|
||||
|
@ -10949,7 +10950,10 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
|
|||
/* Unconditional instructions. */
|
||||
/* TODO: Perhaps merge these into one decodetree output file. */
|
||||
if (disas_a32_uncond(s, insn) ||
|
||||
disas_vfp_uncond(s, insn)) {
|
||||
disas_vfp_uncond(s, insn) ||
|
||||
disas_neon_dp(s, insn) ||
|
||||
disas_neon_ls(s, insn) ||
|
||||
disas_neon_shared(s, insn)) {
|
||||
return;
|
||||
}
|
||||
/* fall back to legacy decoder */
|
||||
|
@ -11102,6 +11106,33 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn)
|
|||
ARCH(6T2);
|
||||
}
|
||||
|
||||
if ((insn & 0xef000000) == 0xef000000) {
|
||||
/*
|
||||
* T32 encodings 0b111p_1111_qqqq_qqqq_qqqq_qqqq_qqqq_qqqq
|
||||
* transform into
|
||||
* A32 encodings 0b1111_001p_qqqq_qqqq_qqqq_qqqq_qqqq_qqqq
|
||||
*/
|
||||
uint32_t a32_insn = (insn & 0xe2ffffff) |
|
||||
((insn & (1 << 28)) >> 4) | (1 << 28);
|
||||
|
||||
if (disas_neon_dp(s, a32_insn)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ((insn & 0xff100000) == 0xf9000000) {
|
||||
/*
|
||||
* T32 encodings 0b1111_1001_ppp0_qqqq_qqqq_qqqq_qqqq_qqqq
|
||||
* transform into
|
||||
* A32 encodings 0b1111_0100_ppp0_qqqq_qqqq_qqqq_qqqq_qqqq
|
||||
*/
|
||||
uint32_t a32_insn = (insn & 0x00ffffff) | 0xf4000000;
|
||||
|
||||
if (disas_neon_ls(s, a32_insn)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: Perhaps merge these into one decodetree output file.
|
||||
* Note disas_vfp is written for a32 with cond field in the
|
||||
|
@ -11109,6 +11140,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn)
|
|||
*/
|
||||
if (disas_t32(s, insn) ||
|
||||
disas_vfp_uncond(s, insn) ||
|
||||
disas_neon_shared(s, insn) ||
|
||||
((insn >> 28) == 0xe && disas_vfp(s, insn))) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue