OSDN Git Service

target/arm: Do M-profile NOCP checks early and via decodetree
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 3 Aug 2020 11:18:47 +0000 (12:18 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 24 Aug 2020 09:05:12 +0000 (10:05 +0100)
commita3494d4671797c291c88bd414acb0aead15f7239
tree4a61a41e1416a9630d27e29565cfddde0e0dc975
parent8198c071bc55bee55ef4f104a5b125f541b51096
target/arm: Do M-profile NOCP checks early and via decodetree

For M-profile CPUs, the architecture specifies that the NOCP
exception when a coprocessor is not present or disabled should cover
the entire wide range of coprocessor-space encodings, and should take
precedence over UNDEF exceptions.  (This is the opposite of
A-profile, where checking for a disabled FPU has to happen last.)

Implement this with decodetree patterns that cover the specified
ranges of the encoding space.  There are a few instructions (VLLDM,
VLSTM, and in v8.1 also VSCCLRM) which are in copro-space but must
not be NOCP'd: these must be handled also in the new m-nocp.decode so
they take precedence.

This is a minor behaviour change: for unallocated insn patterns in
the VFP area (cp=10,11) we will now NOCP rather than UNDEF when the
FPU is disabled.

As well as giving us the correct architectural behaviour for v8.1M
and the recommended behaviour for v8.0M, this refactoring also
removes the old NOCP handling from the remains of the 'legacy
decoder' in disas_thumb2_insn(), paving the way for cleaning that up.

Since we don't currently have a v8.1M feature bit or any v8.1M CPUs,
the minor changes to this logic that we'll need for v8.1M are marked
up with TODO comments.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200803111849.13368-6-peter.maydell@linaro.org
target/arm/m-nocp.decode [new file with mode: 0644]
target/arm/meson.build
target/arm/translate-vfp.c.inc
target/arm/translate.c
target/arm/vfp.decode