You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2022/04/21 05:55:59 UTC
[incubator-nuttx] branch master updated: arm/armv[7|8]m: compare of hardware fp registers should skip REG_FP_RESERVED
This is an automated email from the ASF dual-hosted git repository.
masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 875c5dac75 arm/armv[7|8]m: compare of hardware fp registers should skip REG_FP_RESERVED
875c5dac75 is described below
commit 875c5dac75eb57b20a170c972e81e0cf34546ea3
Author: chao.an <an...@xiaomi.com>
AuthorDate: Thu Apr 21 12:12:46 2022 +0800
arm/armv[7|8]m: compare of hardware fp registers should skip REG_FP_RESERVED
Fix fpu test break
Signed-off-by: chao.an <an...@xiaomi.com>
---
arch/arm/src/armv7-m/arm_fpucmp.c | 5 ++++-
arch/arm/src/armv7-m/arm_initialstate.c | 1 -
arch/arm/src/armv8-m/arm_fpucmp.c | 5 ++++-
arch/arm/src/armv8-m/arm_initialstate.c | 1 -
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm/src/armv7-m/arm_fpucmp.c b/arch/arm/src/armv7-m/arm_fpucmp.c
index 073e63e970..5ddc18e89b 100644
--- a/arch/arm/src/armv7-m/arm_fpucmp.c
+++ b/arch/arm/src/armv7-m/arm_fpucmp.c
@@ -53,7 +53,10 @@ bool up_fpucmp(const void *saveregs1, const void *saveregs2)
const uint32_t *regs1 = saveregs1;
const uint32_t *regs2 = saveregs2;
- return memcmp(®s1[REG_S0], ®s2[REG_S0], 4 * HW_FPU_REGS) == 0 &&
+ /* compare of hardware fp registers should skip REG_FP_RESERVED */
+
+ return memcmp(®s1[REG_S0], ®s2[REG_S0],
+ 4 * (HW_FPU_REGS - 1)) == 0 &&
memcmp(®s1[REG_S16], ®s2[REG_S16], 4 * SW_FPU_REGS) == 0;
}
#endif /* CONFIG_ARCH_FPU */
diff --git a/arch/arm/src/armv7-m/arm_initialstate.c b/arch/arm/src/armv7-m/arm_initialstate.c
index f5af28e9ce..a8f587b5fe 100644
--- a/arch/arm/src/armv7-m/arm_initialstate.c
+++ b/arch/arm/src/armv7-m/arm_initialstate.c
@@ -146,7 +146,6 @@ void up_initial_state(struct tcb_s *tcb)
#ifdef CONFIG_ARCH_FPU
xcp->regs[REG_FPSCR] = 0; /* REVISIT: Initial FPSCR should be configurable */
- xcp->regs[REG_FP_RESERVED] = 0;
#endif /* CONFIG_ARCH_FPU */
/* Enable or disable interrupts, based on user configuration */
diff --git a/arch/arm/src/armv8-m/arm_fpucmp.c b/arch/arm/src/armv8-m/arm_fpucmp.c
index fc5965858d..08b2da7f94 100644
--- a/arch/arm/src/armv8-m/arm_fpucmp.c
+++ b/arch/arm/src/armv8-m/arm_fpucmp.c
@@ -53,7 +53,10 @@ bool up_fpucmp(const void *saveregs1, const void *saveregs2)
const uint32_t *regs1 = saveregs1;
const uint32_t *regs2 = saveregs2;
- return memcmp(®s1[REG_S0], ®s2[REG_S0], 4 * HW_FPU_REGS) == 0 &&
+ /* compare of hardware fp registers should skip REG_FP_RESERVED */
+
+ return memcmp(®s1[REG_S0], ®s2[REG_S0],
+ 4 * (HW_FPU_REGS - 1)) == 0 &&
memcmp(®s1[REG_S16], ®s2[REG_S16], 4 * SW_FPU_REGS) == 0;
}
#endif /* CONFIG_ARCH_FPU */
diff --git a/arch/arm/src/armv8-m/arm_initialstate.c b/arch/arm/src/armv8-m/arm_initialstate.c
index 98f5b794e9..46c53dda1a 100644
--- a/arch/arm/src/armv8-m/arm_initialstate.c
+++ b/arch/arm/src/armv8-m/arm_initialstate.c
@@ -152,7 +152,6 @@ void up_initial_state(struct tcb_s *tcb)
#ifdef CONFIG_ARCH_FPU
xcp->regs[REG_FPSCR] |= ARMV8M_FPSCR_LTPSIZE_NONE;
- xcp->regs[REG_FP_RESERVED] = 0;
#endif /* CONFIG_ARCH_FPU */
/* Enable or disable interrupts, based on user configuration */