-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Move floating point from libgcc out of IRAM #7180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, in the Arduino core it is legal to do FP operations inside ISRs so this can't be done generally.
If you invert the logic (i.e. #ifndef FP_IN_PMEM
) so that the core/PIO users don't see code breaking, and your own project can add the #define
since it's a limited scope, then it would be more acceptable.
I totally agree. Actually this is already the case. By default the FP libs are still in IRAM as before, and you need to explicitly The added lines are in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, sorry! I didn't catch which section was being edited.
How can I use it? using: framework-arduinoespressif8266 483bfde |
I just realized the #defines were not automatically used when generating ld scripts. I created a new PR to solve this: #7188 |
In Tasmota I realized the following floating point function are in precious IRAM:
This PR adds a
#define FP_IN_IROM
to move floating point function out of IRAM to IROM.*f2.o
,*f3.o
:float
anddouble
functions*fsi.o
: fp to int*fdi.o
: fp to long*ifs.o
: int to fp*ids.o
: long to fpIn Tasmota, the only functions from
libgcc
remaining in IRAM are:__modsi3
(integer modulus) and__ashrdi3
(bit shifting).The net result is reducing IRAM usage by 1040 bytes.