Skip to content

Fix Float/Double .nextUp/.nextDown on arm(v7). #2879

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

Merged
merged 1 commit into from
Jun 4, 2016
Merged

Fix Float/Double .nextUp/.nextDown on arm(v7). #2879

merged 1 commit into from
Jun 4, 2016

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jun 4, 2016

On armv7, leastNonzeroMagnitude is defined to be leastNormalMagnitude.
This seems wrong to me from a language point of view, because it's
possible to have a nonzero float that compares less than the leastNonzero float.
However, it must have been done to gloss over hardware rounding errors.
This is not a problem on arm64.

As a result, nextUp/Down methods were not self-consistent. I fixed
this by skipping over subnormal representations, following the
precedent set by leastNonZeroMagnitude.

This fixes the FloatingPoint floatNextUpDownTests on armv7.

On armv7, leastNonzeroMagnitude is defined to be leastNormalMagnitude.
This seems wrong to me from a language point of view, because it's
possible to have a nonzero float that compares less than the leastNonzero float.
However, it must have been done to gloss over hardware rounding errors.
This is not a problem on arm64.

As a result, nextUp/Down methods were not self-consistent. I fixed
this by skipping over subnormal representations, following the
precedent set by leastNonZeroMagnitude.

This fixes the FloatingPoint floatNextUpDownTests on armv7.
@atrick
Copy link
Contributor Author

atrick commented Jun 4, 2016

@swift-ci Please smoke test and merge.

@atrick
Copy link
Contributor Author

atrick commented Jun 4, 2016

Not sure what the linux package manager failure is about, but it's not from this change.

@atrick atrick merged commit 775a0ec into swiftlang:master Jun 4, 2016
MaxDesiatov added a commit that referenced this pull request Apr 19, 2021
[pull] swiftwasm from main
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.

1 participant