-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix double promotion warnings #56
Merged
microbuilder
merged 8 commits into
zephyrproject-rtos:master
from
XenuIsWatching:fix-single
Dec 13, 2023
Merged
fix double promotion warnings #56
microbuilder
merged 8 commits into
zephyrproject-rtos:master
from
XenuIsWatching:fix-single
Dec 13, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 tasks
XenuIsWatching
force-pushed
the
fix-single
branch
from
December 10, 2023 19:53
45c3969
to
a8f4711
Compare
When CONFIG_ZSL_SINGLE_PRECISION is not set. All floats get promoted to doubles. This causes warnings with -Wdouble-promotion. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Float and Double were swapped for their tests. `I` is a single percision constant so cast to double. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Set the compilier flag for gcc or armclang to force constants to be single percision. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
XenuIsWatching
force-pushed
the
fix-single
branch
from
December 10, 2023 19:58
a8f4711
to
e73c912
Compare
With CONFIG_ZSL_SINGLE_PRECISION, have all constants be single percision. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
With Wdouble-promotions, cast float params in printf to double. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
The double math library functions where being used in the case for single percision. Use the macros defined in zsl.h for either single or double math library functions. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
XenuIsWatching
force-pushed
the
fix-single
branch
2 times, most recently
from
December 12, 2023 09:42
177dc1b
to
0d44b9b
Compare
some tests were failing due to being just slighty outside the eps for single percision. Increase it a bit to pass the test case. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
XenuIsWatching
force-pushed
the
fix-single
branch
from
December 12, 2023 22:42
0d44b9b
to
77d4a3d
Compare
zsl_phy_atom_bohr_orb_radius does not work with single percision as numbers to small get multipled and just become 0.0f. Multiple a large constant in to the numerator and denomerator to prevent numbers from getting to small. Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
XenuIsWatching
force-pushed
the
fix-single
branch
from
December 12, 2023 22:42
77d4a3d
to
045dbb0
Compare
3 tasks
microbuilder
approved these changes
Dec 13, 2023
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.
Thanks for the changes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the double promotion warnings when compiling with -Wdouble-promotion
see: zephyrproject-rtos/zephyr#57154