Skip to content

Commit 1edc3d4

Browse files
committed
target/arm: arm_reset_sve_state() should set FPSR, not FPCR
The pseudocode ResetSVEState() does: FPSR = ZeroExtend(0x0800009f<31:0>, 64); but QEMU's arm_reset_sve_state() called vfp_set_fpcr() by accident. Before the advent of FEAT_AFP, this was only setting a collection of RES0 bits, which vfp_set_fpsr() would then ignore, so the only effect was that we didn't actually set the FPSR the way we are supposed to do. Once FEAT_AFP is implemented, setting the bottom bits of FPSR will change the floating point behaviour. Call vfp_set_fpsr(), as we ought to. (Note for stable backports: commit 7f2a01e moved this function from sme_helper.c to helper.c, but it had the same bug before the move too.) Cc: [email protected] Fixes: f84734b ("target/arm: Implement SMSTART, SMSTOP") Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-id: [email protected]
1 parent cb5f6ca commit 1edc3d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

target/arm/helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6413,7 +6413,7 @@ static void arm_reset_sve_state(CPUARMState *env)
64136413
memset(env->vfp.zregs, 0, sizeof(env->vfp.zregs));
64146414
/* Recall that FFR is stored as pregs[16]. */
64156415
memset(env->vfp.pregs, 0, sizeof(env->vfp.pregs));
6416-
vfp_set_fpcr(env, 0x0800009f);
6416+
vfp_set_fpsr(env, 0x0800009f);
64176417
}
64186418

64196419
void aarch64_set_svcr(CPUARMState *env, uint64_t new, uint64_t mask)

0 commit comments

Comments
 (0)