]> Git Repo - qemu.git/commitdiff
target/arm: Add v8M stack checks for VLDM/VSTM
authorPeter Maydell <[email protected]>
Mon, 8 Oct 2018 13:55:05 +0000 (14:55 +0100)
committerPeter Maydell <[email protected]>
Mon, 8 Oct 2018 13:55:05 +0000 (14:55 +0100)
Add the v8M stack checks for the VLDM/VSTM
(aka VPUSH/VPOP) instructions. This code is currently
unreachable because we haven't yet implemented M profile
floating point support, but since the change is simple,
we add it now because otherwise we're likely to forget to
do it later.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: 20181002163556[email protected]

target/arm/translate.c

index ef64d2559deeec8fb903c9dec45bebd3506b3419..1b4bacb522bb4bdd375131edcb98f6c1df84d786 100644 (file)
@@ -4229,6 +4229,18 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn)
                 if (insn & (1 << 24)) /* pre-decrement */
                     tcg_gen_addi_i32(addr, addr, -((insn & 0xff) << 2));
 
+                if (s->v8m_stackcheck && rn == 13 && w) {
+                    /*
+                     * Here 'addr' is the lowest address we will store to,
+                     * and is either the old SP (if post-increment) or
+                     * the new SP (if pre-decrement). For post-increment
+                     * where the old value is below the limit and the new
+                     * value is above, it is UNKNOWN whether the limit check
+                     * triggers; we choose to trigger.
+                     */
+                    gen_helper_v8m_stackcheck(cpu_env, addr);
+                }
+
                 if (dp)
                     offset = 8;
                 else
This page took 0.046931 seconds and 4 git commands to generate.