mimxrt/Makefile: Rework floating point config.

Reworks source file and compile flags selection for floating point support.
This commit is contained in:
Philipp Ebensberger 2022-06-22 21:41:42 +02:00 committed by Damien George
parent bec0524dbf
commit c957c76f4d
1 changed files with 36 additions and 96 deletions

View File

@ -222,89 +222,27 @@ endif
# Math library source files # Math library source files
ifeq ($(MICROPY_FLOAT_IMPL),double) ifeq ($(MICROPY_FLOAT_IMPL),double)
LIBM_SRC_C += $(addprefix lib/libm_dbl/,\ LIBM_SRC_C += $(addprefix lib/libm_dbl/,\
__cos.c \ __cos.c __expo2.c __fpclassify.c __rem_pio2.c __rem_pio2_large.c __signbit.c __sin.c __tan.c acos.c acosh.c \
__expo2.c \ asin.c asinh.c atan.c atan2.c atanh.c ceil.c copysign.c cos.c cosh.c erf.c exp.c expm1.c floor.c fmod.c \
__fpclassify.c \ frexp.c ldexp.c lgamma.c log.c log10.c log1p.c modf.c nearbyint.c pow.c rint.c round.c scalbn.c sin.c \
__rem_pio2.c \ sinh.c tan.c tanh.c tgamma.c trunc.c)
__rem_pio2_large.c \ #
__signbit.c \ ifeq ($(SUPPORTS_HARDWARE_FP_DOUBLE),1)
__sin.c \ LIBM_SRC_C += lib/libm_dbl/thumb_vfp_sqrt.c
__tan.c \ else
acos.c \ LIBM_SRC_C += lib/libm_dbl/sqrt.c
acosh.c \ endif
asin.c \
asinh.c \
atan.c \
atan2.c \
atanh.c \
ceil.c \
copysign.c \
cos.c \
cosh.c \
erf.c \
exp.c \
expm1.c \
floor.c \
fmod.c \
frexp.c \
ldexp.c \
lgamma.c \
log.c \
log10.c \
log1p.c \
modf.c \
nearbyint.c \
pow.c \
rint.c \
round.c \
scalbn.c \
sin.c \
sinh.c \
tan.c \
tanh.c \
tgamma.c \
trunc.c \
)
ifeq ($(SUPPORTS_HARDWARE_FP_DOUBLE),1)
LIBM_SRC_C += lib/libm_dbl/thumb_vfp_sqrt.c
else else
LIBM_SRC_C += lib/libm_dbl/sqrt.c LIBM_SRC_C += $(addprefix lib/libm/,\
endif acoshf.c asinfacosf.c asinhf.c atan2f.c atanf.c atanhf.c ef_rem_pio2.c erf_lgamma.c fmodf.c kf_cos.c \
else kf_rem_pio2.c kf_sin.c kf_tan.c log1pf.c math.c nearbyintf.c roundf.c sf_cos.c sf_erf.c sf_frexp.c sf_ldexp.c \
LIBM_SRC_C += $(addprefix lib/libm/,\ sf_modf.c sf_sin.c sf_tan.c wf_lgamma.c wf_tgamma.c)
acoshf.c \ ifeq ($(SUPPORTS_HARDWARE_FP_SINGLE),1)
asinfacosf.c \ LIBM_SRC_C += lib/libm/thumb_vfp_sqrtf.c
asinhf.c \ else
atan2f.c \ LIBM_SRC_C += lib/libm/ef_sqrt.c
atanf.c \ endif
atanhf.c \
ef_rem_pio2.c \
erf_lgamma.c \
fmodf.c \
kf_cos.c \
kf_rem_pio2.c \
kf_sin.c \
kf_tan.c \
log1pf.c \
math.c \
nearbyintf.c \
roundf.c \
sf_cos.c \
sf_erf.c \
sf_frexp.c \
sf_ldexp.c \
sf_modf.c \
sf_sin.c \
sf_tan.c \
wf_lgamma.c \
wf_tgamma.c \
)
ifeq ($(SUPPORTS_HARDWARE_FP_SINGLE),1)
LIBM_SRC_C += lib/libm/thumb_vfp_sqrtf.c
else
LIBM_SRC_C += lib/libm/ef_sqrt.c
endif
endif endif
# Reset variables # Reset variables
@ -423,23 +361,25 @@ else
endif endif
# Configure floating point support # Configure floating point support
ifeq ($(MICROPY_FLOAT_IMPL),double) ifeq ($(MICROPY_FLOAT_IMPL),single)
CFLAGS += \ CFLAGS += \
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_DOUBLE \ -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT \
-mfloat-abi=hard \ -fsingle-precision-constant \
-mfpu=fpv5-d16 -mfloat-abi=softfp \
-mfpu=fpv5-sp-d16
else ifeq ($(MICROPY_FLOAT_IMPL),double)
CFLAGS += \
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_DOUBLE \
-mfloat-abi=hard \
-mfpu=fpv5-d16
else ifeq ($(MICROPY_FLOAT_IMPL),none)
CFLAGS += \
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_NONE
else else
ifeq ($(MICROPY_FLOAT_IMPL),none) $(error Error: Unknown floating point implementation $(MICROPY_FLOAT_IMPL))
CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_NONE
else
CFLAGS += \
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT \
-fsingle-precision-constant \
-mfloat-abi=softfp \
-mfpu=fpv5-sp-d16
endif
endif endif
# All settings for Ethernet support are controller by the value of MICROPY_PY_LWIP # All settings for Ethernet support are controller by the value of MICROPY_PY_LWIP
ifeq ($(MICROPY_PY_LWIP), 1) ifeq ($(MICROPY_PY_LWIP), 1)
CFLAGS += \ CFLAGS += \