[arch][fpu] add ability to specify per file or module if code needs fpu

Have the arch define additional compiler flags to explicit support or
not support a floating point unit.

Add ability for modules to per file or for the whole module mark code
as needing floating point support.

Add default flags for arm64, riscv, and x86 toolchains.

Needed because gcc 12 is getting much more aggressive about using vector
instructions for non float code, so getting away with avoiding it was
no longer working.

Still not perfect: printf code is being compiled with float, so it's
possible to use floating point instructions inside core kernel or
interrupt handling code if a printf is used.

Possibly will have problems on architectures where mixing float and non
float code at the linker generates issues, but so far seems to be okay.
This commit is contained in:
Travis Geiselbrecht
2022-07-17 16:03:20 -07:00
parent b7af2cdf26
commit 6462cbf51c
10 changed files with 87 additions and 18 deletions

View File

@@ -2,22 +2,22 @@ LOCAL_DIR := $(GET_LOCAL_DIR)
MODULE := $(LOCAL_DIR)
MODULE_SRCS += \
$(LOCAL_DIR)/benchmarks.c \
MODULE_SRCS := \
$(LOCAL_DIR)/cache_tests.c \
$(LOCAL_DIR)/cbuf_tests.c \
$(LOCAL_DIR)/clock_tests.c \
$(LOCAL_DIR)/fibo.c \
$(LOCAL_DIR)/float.c \
$(LOCAL_DIR)/float_instructions.S \
$(LOCAL_DIR)/float_test_vec.c \
$(LOCAL_DIR)/mem_tests.c \
$(LOCAL_DIR)/printf_tests.c \
$(LOCAL_DIR)/tests.c \
$(LOCAL_DIR)/thread_tests.c \
$(LOCAL_DIR)/port_tests.c \
MODULE_ARM_OVERRIDE_SRCS := \
MODULE_FLOAT_SRCS := \
$(LOCAL_DIR)/benchmarks.c \
$(LOCAL_DIR)/float.c \
$(LOCAL_DIR)/float_instructions.S \
$(LOCAL_DIR)/float_test_vec.c \
$(LOCAL_DIR)/printf_tests.c \
MODULE_DEPS += \
lib/cbuf