diff options
author | Peter Maydell | 2020-11-19 22:55:56 +0100 |
---|---|---|
committer | Peter Maydell | 2020-12-10 12:44:55 +0100 |
commit | 32a290b8c3c2dc85cd88bd8983baf900d575cabc (patch) | |
tree | a30bca46c0541adc2b3f6864b29ed4c690080240 /target/arm/cpu.h | |
parent | target/arm: Enforce M-profile VMRS/VMSR register restrictions (diff) | |
download | qemu-32a290b8c3c2dc85cd88bd8983baf900d575cabc.tar.gz qemu-32a290b8c3c2dc85cd88bd8983baf900d575cabc.tar.xz qemu-32a290b8c3c2dc85cd88bd8983baf900d575cabc.zip |
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
Diffstat (limited to 'target/arm/cpu.h')
-rw-r--r-- | target/arm/cpu.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 11400a9d24..ad8b80c667 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1569,6 +1569,9 @@ enum arm_cpu_mode { #define ARM_VFP_FPINST 9 #define ARM_VFP_FPINST2 10 +/* QEMU-internal value meaning "FPSCR, but we care only about NZCV" */ +#define QEMU_VFP_FPSCR_NZCV 0xffff + /* iwMMXt coprocessor control registers. */ #define ARM_IWMMXT_wCID 0 #define ARM_IWMMXT_wCon 1 |