From 3246f26bfa100e3d2e1d9a0c761774b9c6fed35a Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 3 Mar 2015 00:10:50 -0800 Subject: stm32f4: 32bit-float-friendly GCC flags This commit makes 'float' (32-bit) the default for floating point constants in the source code, instead of the defaults 'double' (64-bit). Floating point performance is very sensitive to the float vs. double distinction on 32-bit processors, especially Cortex-M4s with a VFP unit for floats but not doubles. In the future it may be wise to make this change for non-hard-fp chips (aka, all the other STM32s) as well, for behavioral consistancy. The warning flag ensures that the frequently used parts of the code base will be less ambiguous, but doesn't cover series-specific code. --- support/make/target-config.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'support/make') diff --git a/support/make/target-config.mk b/support/make/target-config.mk index 9f7ce7b..68cddbf 100644 --- a/support/make/target-config.mk +++ b/support/make/target-config.mk @@ -50,8 +50,9 @@ LD_SERIES_PATH := $(LD_SERIES_PATH)/stm32f2 TARGET_FLAGS += -mcpu=cortex-m3 -march=armv7-m endif ifeq ($(MCU_SERIES), stm32f4) -TARGET_FLAGS += -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 LD_SERIES_PATH := $(LD_SERIES_PATH)/$(MCU_F4_LINE) +TARGET_FLAGS += -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard \ + -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wdouble-promotion endif TARGET_LDFLAGS += -Xlinker -T$(LD_SCRIPT_PATH) \ -- cgit v1.2.3