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

Improvements to non 32-bit exception handler #7816

Merged

Conversation

mhightower83
Copy link
Contributor

Extended ASM got fussy when using different optimizations. ie. HWDT resets. It seems you should not use input registers for scratch registers. Fixed by adding an extra output register for temporary values. No code size increase. Now works with different optimizations.

Light refactoring for readability

Added "C" reference code for Extended ASM

Save two cycles by loading a0 early in exc-c-wrapper-handler.S

Use optimization O2
Net change in size, 0 bytes with optimization. Save 4 bytes w/o Optimization.
With changes and O2 save 3 cycles on write and 6 cycles on read.

resets. It seems you should not use input registers for scratch registers.
Add an extra output register instead. No code size increase.

Light refactoring for readability

Added "C" reference code for Extended ASM

Save two cycles by loading a0 early in exc-c-wrapper-handler.S

Use optimization O2
Net change in size, 0 bytes with optimization. Save 4 bytes w/o Optimization.
With changes and "O2" save 3 cycles on write and 6 cycles on read.
Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think you found and fixed an occasional issue I was having w/the PSRAM virtual mem version of this, too. Good debugging!

@earlephilhower earlephilhower merged commit 67e1dfc into esp8266:master Jan 8, 2021
@mhightower83 mhightower83 deleted the pr-fix-non32-access-reg-usage branch January 8, 2021 06:10
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