Skip to content

ports/nrf/Makefile: Use micropython libm instead of toolchain libm #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2017
Merged

ports/nrf/Makefile: Use micropython libm instead of toolchain libm #132

merged 1 commit into from
Nov 18, 2017

Conversation

glennrub
Copy link
Collaborator

Using libm from micropython reduces flash consumption about 5.5kb on nrf52
targets which have floating point support enabled.

Using libm from micropython free up about 5.5kb flash on nrf52
targets which have floating point enabled.
@glennrub
Copy link
Collaborator Author

Thanks @dhalbert, for pointing out this flash optimization in PR #118.

@glennrub glennrub changed the title ports/nrf/Makefile: Use micropython libm instead of stdlib libm ports/nrf/Makefile: Use micropython libm instead of toolchain libm Nov 15, 2017
@glennrub glennrub merged commit 2a1807e into tralamazza:master Nov 18, 2017
@dhalbert
Copy link

dhalbert commented Nov 18, 2017

You're welcome. And you might want to check for any stray leftover double-precision operations. Use this script and grep for __aeabi_d (__aeabi_dadd, etc.), etc. These can be large routines (like 1k-1.5k each). We had one or two that caused implied by doing some time arithmetic in a particular way (adafruit#343).

[above EDITED to make what to grep for clearer]

This is a simple caller-callee lister I swiped and adapted from Stackoverflow:

#!/bin/bash
# https://reverseengineering.stackexchange.com/questions/9113/how-can-i-generate-a-call-graph-from-an-unstripped-x86-l
inux-elf
arm-none-eabi-objdump -d $1 \
| grep '<' \
| sed -e 's/^[^<]*//' \
| sed 's/<\([^+]*\)[^>]*>/\1/' \
| awk 'BEGIN { FS = ":" } \
       NF>1 { w=$1; } \
       NF==1 && w != $1 { print "(\"" w "\", \"" $0 "\")," }' \
| sort -u

@glennrub glennrub deleted the use_mpy_libm branch July 28, 2018 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants