Skip to content
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

floating point usage in radio.c #261

Open
kritzikratzi opened this issue Dec 4, 2022 · 3 comments
Open

floating point usage in radio.c #261

kritzikratzi opened this issue Dec 4, 2022 · 3 comments

Comments

@kritzikratzi
Copy link

radio.c uses floating point numbers (doubles, to be precise) to calculate the air time (maybe there are other places too), however it would be quite trivial to rewrite this computation to fixed point maths.

the goal would be to get rid of the generated code for float/double support:

8035: 0000f7bd 1464 FUNC GLOBAL HIDDEN 2 __aeabi_ddiv
8141: 0000f0d1 1772 FUNC GLOBAL HIDDEN 2 __aeabi_dadd
8045: 0000ffb1 1252 FUNC GLOBAL HIDDEN 2 __aeabi_dmul
8097: 0000ecc9 840 FUNC GLOBAL HIDDEN 2 __aeabi_fsub
8279: 0000ea99 560 FUNC GLOBAL HIDDEN 2 __aeabi_fdiv

in total this accounts for 5.8kB of flash, which is imho quite a lot.

@gasagna
Copy link
Contributor

gasagna commented Feb 11, 2023

radio.c is taken from LoraMac-node. Can you open an issue there? there's more chance it will be addressed, and perhaps we'll have the fix here too at some point.

@kritzikratzi
Copy link
Author

the issue was fixed upstream in 2020.

@gasagna
Copy link
Contributor

gasagna commented Feb 13, 2023

Oh, I see. So yes, perhaps we could use an update to radio.c.

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

No branches or pull requests

2 participants