From b5f266d5af9b63d2a6c6e7b13749496f4f0a7e86 Mon Sep 17 00:00:00 2001 From: zhangyuan21 Date: Wed, 2 Aug 2023 10:55:19 +0800 Subject: [PATCH] armv8-m: the FPSCR[18:16] LTPSIZE field in exception_common In armv8m the FPSCR[18:16] LTPSIZE field must be set to 0b100 for "Tail predication not applied" as it's reset value. Signed-off-by: zhangyuan21 --- arch/arm/src/armv8-m/arm_exception.S | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/src/armv8-m/arm_exception.S b/arch/arm/src/armv8-m/arm_exception.S index 38b025d217..01ac94eb65 100644 --- a/arch/arm/src/armv8-m/arm_exception.S +++ b/arch/arm/src/armv8-m/arm_exception.S @@ -46,6 +46,7 @@ #include "chip.h" #include "exc_return.h" +#include "psr.h" /**************************************************************************** * Pre-processor Definitions @@ -177,6 +178,13 @@ exception_common: ite eq vstmdbeq r1!, {s16-s31} /* Save the non-volatile FP context */ subne r1, #(4*SW_FPU_REGS) + + /* the FPSCR[18:16] LTPSIZE field must be set to 0b100 for + * "Tail predication not applied" as it's reset value. + */ + + mov r0, #ARMV8M_FPSCR_LTPSIZE_NONE + vmsr fpscr, r0 #endif stmdb r1!, {r2-r12,r14} /* Save the remaining registers plus the SP/PRIMASK values */