-
Notifications
You must be signed in to change notification settings - Fork 24
optimisation: compare uint16_t
against uint16_t
in FinishHomingAndPlanMoveToParkPos
#335
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
Conversation
All values in bytes. Δ Delta to base
|
To add to the PR description... you will notice that applying this optimisation on only one of the if statements does not save a lot of resources. However, once you apply it to both if statements, For reference (https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html), what does |
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.
nice catch 👍 , please carry on 🙏 ... the compiler is not very intelligent
a832b5e
to
90a3596
Compare
Automated Test Code Coverage ReportView details...
TOTAL: 2727 lines of code, 2030 lines executed, 74% covered. |
AxisDistance returns uint16_t type and is currently compared with long double axis length. The axis lengths fit easily into uint16_t: selectorLimits.lenght = 75 idlerLimits.lenght = 225 Change in memory: Flash: -122 bytes SRAM: 0 bytes
90a3596
to
362e56a
Compare
Rebased to sync with main. Will merge if all CI checks pass again. |
AxisDistance
returnsuint16_t
type and is currently compared withlong double
axis length. The axis lengths fit easily intouint16_t
:Change in memory:
Flash: -122 bytes
SRAM: 0 bytes
Below is the changes to the assembly output for the selector limits. This optimisation removes a call to
__floatunsisf
and__cmpsf2
Before
After: