[fpu] have the arch layers set WITH_NO_FPU based on the cpu

This will generally turn off more FPU codegen, even if its using
software fallback unless the project/target/platform selects a cpu that
has FPU support. This also turns off a few blocks of test code and the
upcoming floating point printf if it's not present on the arch.

This may break projects that were compiling for say cortex-m0 but
expected FPU code to be present. If so it should be pretty easy to
override it, but not going to add that yet unless it's necessary.
This commit is contained in:
Travis Geiselbrecht
2025-10-08 23:41:13 -07:00
parent 85e35e1426
commit 5016118509
6 changed files with 35 additions and 23 deletions

View File

@@ -5,7 +5,7 @@
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT
*/
#if ARM_WITH_VFP || ARCH_ARM64 || X86_WITH_FPU || (ARCH_RISCV && RISCV_FPU)
#if !WITH_NO_FP
#include <stdio.h>
#include <inttypes.h>
@@ -20,11 +20,6 @@
#include <kernel/event.h>
#include <platform.h>
extern void float_vfp_arm_instruction_test(void);
extern void float_vfp_thumb_instruction_test(void);
extern void float_neon_arm_instruction_test(void);
extern void float_neon_thumb_instruction_test(void);
#if ARM_WITH_VFP_SP_ONLY
#define FLOAT float
#else
@@ -57,6 +52,11 @@ static int float_thread(void *arg) {
}
#if ARCH_ARM && !ARM_ISA_ARMV7M
extern void float_vfp_arm_instruction_test(void);
extern void float_vfp_thumb_instruction_test(void);
extern void float_neon_arm_instruction_test(void);
extern void float_neon_thumb_instruction_test(void);
static void arm_float_instruction_trap_test(void) {
printf("testing fpu trap\n");
@@ -152,4 +152,4 @@ STATIC_COMMAND_START
STATIC_COMMAND("float_tests", "floating point test", &float_tests)
STATIC_COMMAND_END(float_tests);
#endif // ARM_WITH_VFP || ARCH_ARM64
#endif // !WITH_NO_FP