diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-05-20 16:28:37 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-06-03 16:43:25 +0100 |
commit | 7c3d47dab908ac1770726e68cf72e47bb5a9cbcb (patch) | |
tree | 8cd6a5fe995b03e040935d292c9826ba8a18fd91 /target/arm/machine.c | |
parent | 300137965dbacec02eb2e26b3c6763b491d1f1b2 (diff) |
target/arm: Implement M-profile VPR register
If MVE is implemented for an M-profile CPU then it has a VPR
register, which tracks predication information.
Implement the read and write handling of this register, and
the migration of its state.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210520152840.24453-7-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/machine.c')
-rw-r--r-- | target/arm/machine.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/target/arm/machine.c b/target/arm/machine.c index 6ad1d306b1..62a71a3b64 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -318,6 +318,24 @@ static const VMStateDescription vmstate_m_fp = { } }; +static bool mve_needed(void *opaque) +{ + ARMCPU *cpu = opaque; + + return cpu_isar_feature(aa32_mve, cpu); +} + +static const VMStateDescription vmstate_m_mve = { + .name = "cpu/m/mve", + .version_id = 1, + .minimum_version_id = 1, + .needed = mve_needed, + .fields = (VMStateField[]) { + VMSTATE_UINT32(env.v7m.vpr, ARMCPU), + VMSTATE_END_OF_LIST() + }, +}; + static const VMStateDescription vmstate_m = { .name = "cpu/m", .version_id = 4, @@ -344,6 +362,7 @@ static const VMStateDescription vmstate_m = { &vmstate_m_other_sp, &vmstate_m_v8m, &vmstate_m_fp, + &vmstate_m_mve, NULL } }; |