aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2015-03-03 00:10:50 -0800
committerbnewbold <bnewbold@robocracy.org>2015-03-03 00:15:30 -0800
commit3246f26bfa100e3d2e1d9a0c761774b9c6fed35a (patch)
tree81d5608fea33fbbec786f3e41ca3e1cfbd000022
parenta7fd405405f7ba015c1f9b1bdd4e73fd1bede27c (diff)
downloadlibrambutan-3246f26bfa100e3d2e1d9a0c761774b9c6fed35a.tar.gz
librambutan-3246f26bfa100e3d2e1d9a0c761774b9c6fed35a.zip
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.
-rw-r--r--support/make/target-config.mk3
1 files changed, 2 insertions, 1 deletions
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) \