target/arm: Refactor M-profile VMSR/VMRS handling
commit32a290b8c3c2dc85cd88bd8983baf900d575cabc
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 19 Nov 2020 21:55:56 +0000 (19 21:55 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 Dec 2020 11:44:55 +0000 (10 11:44 +0000)
treea30bca46c0541adc2b3f6864b29ed4c690080240
parentede97c9d71110821738a48f88ff9f10d6bec017f
target/arm: Refactor M-profile VMSR/VMRS handling

Currently M-profile borrows the A-profile code for VMSR and VMRS
(access to the FP system registers), because all it needs to support
is the FPSCR.  In v8.1M things become significantly more complicated
in two ways:

 * there are several new FP system registers; some have side effects
   on read, and one (FPCXT_NS) needs to avoid the usual
   vfp_access_check() and the "only if FPU implemented" check

 * all sysregs are now accessible both by VMRS/VMSR (which
   reads/writes a general purpose register) and also by VLDR/VSTR
   (which reads/writes them directly to memory)

Refactor the structure of how we handle VMSR/VMRS to cope with this:

 * keep the M-profile code entirely separate from the A-profile code

 * abstract out the "read or write the general purpose register" part
   of the code into a loadfn or storefn function pointer, so we can
   reuse it for VLDR/VSTR.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20201119215617.29887-8-peter.maydell@linaro.org
target/arm/cpu.h
target/arm/translate-vfp.c.inc