8000 mimxrt/Makefile: Rework floating point config. · micropython/micropython@c957c76 · GitHub
[go: up one dir, main page]

Skip to content

Commit c957c76

Browse files
alphaFreddpgeorge
authored andcommitted
mimxrt/Makefile: Rework floating point config.
Reworks source file and compile flags selection for floating point support.
1 parent bec0524 commit c957c76

File tree

1 file changed

+36
-96
lines changed

1 file changed

+36
-96
lines changed

ports/mimxrt/Makefile

Lines changed: 36 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -222,89 +222,27 @@ endif
222222

223223
# Math library source files
224224
ifeq ($(MICROPY_FLOAT_IMPL),double)
225-
LIBM_SRC_C += $(addprefix lib/libm_dbl/,\
226-
__cos.c \
227-
__expo2.c \
228-
__fpclassify.c \
229-
__rem_pio2.c \
230-
__rem_pio2_large.c \
231-
__signbit.c \
232-
__sin.c \
233-
__tan.c \
234-
acos.c \
235-
acosh.c \
236-
asin.c \
237-
asinh.c \
238-
atan.c \
239-
atan2.c \
240-
atanh.c \
241-
ceil.c \
242-
copysign.c \
243-
cos.c \
244-
cosh.c \
245-
erf.c \
246-
exp.c \
247-
expm1.c \
248-
floor.c \
249-
fmod.c \
250-
frexp.c \
251-
ldexp.c \
252-
lgamma.c \
253-
log.c \
254-
log10.c \
255-
log1p.c \
256-
modf.c \
257-
nearbyint.c \
258-
pow.c \
259-
rint.c \
260-
round.c \
261-
scalbn.c \
262-
sin.c \
263-
sinh.c \
264-
tan.c \
265-
tanh.c \
266-
tgamma.c \
267-
trunc.c \
268-
)
269-
ifeq ($(SUPPORTS_HARDWARE_FP_DOUBLE),1)
270-
LIBM_SRC_C += lib/libm_dbl/thumb_vfp_sqrt.c
271-
else
272-
LIBM_SRC_C += lib/libm_dbl/sqrt.c
273-
endif
274-
else
275-
LIBM_SRC_C += $(addprefix lib/libm/,\
276-
acoshf.c \
277-
asinfacosf.c \
278-
asinhf.c \
279-
atan2f.c \
280-
atanf.c \
281-
atanhf.c \
282-
ef_rem_pio2.c \
283-
erf_lgamma.c \
284-
fmodf.c \
285-
kf_cos.c \
286-
kf_rem_pio2.c \
287-
kf_sin.c \
288-
kf_tan.c \
289-
log1pf.c \
290-
math.c \
291-
nearbyintf.c \
292-
roundf.c \
293-
sf_cos.c \
294-
sf_erf.c \
295-
sf_frexp.c \
296-
sf_ldexp.c \
297-
sf_modf.c \
298-
sf_sin.c \
299-
sf_tan.c \
300-
wf_lgamma.c \
301-
wf_tgamma.c \
302-
)
303-
ifeq ($(SUPPORTS_HARDWARE_FP_SINGLE),1)
304-
LIBM_SRC_C += lib/libm/thumb_vfp_sqrtf.c
225+
LIBM_SRC_C += $(addprefix lib/libm_dbl/,\
226+
__cos.c __expo2.c __fpclassify.c __rem_pio2.c __rem_pio2_large.c __signbit.c __sin.c __tan.c acos.c acosh.c \
227+
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 \
228+
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 \
229+
sinh.c tan.c tanh.c tgamma.c trunc.c)
230+
#
231+
ifeq ($(SUPPORTS_HARDWARE_FP_DOUBLE),1)
232+
LIBM_SRC_C += lib/libm_dbl/thumb_vfp_sqrt.c
233+
else
234+
LIBM_SRC_C += lib/libm_dbl/sqrt.c
235+
endif
305236
else
306-
LIBM_SRC_C += lib/libm/ef_sqrt.c
307-
endif
237+
LIBM_SRC_C += $(addprefix lib/libm/,\
238+
acoshf.c asinfacosf.c asinhf.c atan2f.c atanf.c atanhf.c ef_rem_pio2.c erf_lgamma.c fmodf.c kf_cos.c \
239+
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 \
240+
sf_modf.c sf_sin.c sf_tan.c wf_lgamma.c wf_tgamma.c)
241+
ifeq ($(SUPPORTS_HARDWARE_FP_SINGLE),1)
242+
LIBM_SRC_C += lib/libm/thumb_vfp_sqrtf.c
243+
else
244+
LIBM_SRC_C += lib/libm/ef_sqrt.c
245+
endif
308246
endif
309247

310248
# Reset variables
@@ -423,23 +361,25 @@ else
423361
endif
424362

425363
# Configure floating point support
426-
ifeq ($(MICROPY_FLOAT_IMPL),double)
427-
CFLAGS += \
428-
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_DOUBLE \
429-
-mfloat-abi=hard \
430-
-mfpu=fpv5-d16
431-
else
432-
ifeq ($(MICROPY_FLOAT_IMPL),none)
433-
CFLAGS += -DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_NONE
364+
ifeq ($(MICROPY_FLOAT_IMPL),single)
365+
CFLAGS += \
366+
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT \
367+
-fsingle-precision-constant \
368+
-mfloat-abi=softfp \
369+
-mfpu=fpv5-sp-d16
370+
else ifeq ($(MICROPY_FLOAT_IMPL),double)
371+
CFLAGS += \
372+
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_DOUBLE \
373+
-mfloat-abi=hard \
374+
-mfpu=fpv5-d16
375+
else ifeq ($(MICROPY_FLOAT_IMPL),none)
376+
CFLAGS += \
377+
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_NONE
434378
else
435-
CFLAGS += \
436-
-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT \
437-
-fsingle-precision-constant \
438-
-mfloat-abi=softfp \
439-
-mfpu=fpv5-sp-d16
440-
endif
379+
$(error Error: Unknown floating point implementation $(MICROPY_FLOAT_IMPL))
441380
endif
442381

382+
443383
# All settings for Ethernet support are controller by the value of MICROPY_PY_LWIP
444384
ifeq ($(MICROPY_PY_LWIP), 1)
445385
CFLAGS += \

0 commit comments

Comments
 (0)
0