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

Use -0.0 as the neutral additive float #438

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Sep 12, 2024

-0.0 + 0.0 is 0.0
-0.0 + -0.0 is -0.0

Thus, the float additive-zero is -0.0, not its positive cousin. This aligns with a recent change to the impl of Sum for floats, in rust-lang/rust@4908188

Fixes #432

@calebzulawski
Copy link
Member

I assume this resolves #432

@workingjubilee
Copy link
Member Author

yep, tests might require a bit of punching first.

@calebzulawski
Copy link
Member

I think you just need to bump rust-toolchain.toml

-0.0 +  0.0 is  0.0
-0.0 + -0.0 is -0.0

Thus, the float additive-zero is actually -0.0, not its positive cousin.
This change aligns with a recent change to the impl of Sum for floats,
in rust-lang/rust@4908188 and
accordingly we also have to use the latest toolchain for our tests now.
@workingjubilee
Copy link
Member Author

Oh, yep. That does it, thanks!

@calebzulawski
Copy link
Member

Pretty sure the arm failure is unrelated to your changes, looks like std might have added an extra step to is_normal that causes it to flush subnormals?

@workingjubilee
Copy link
Member Author

Oh yeah those tests are gonna be absolutely busted for thumbv7neon.

@workingjubilee
Copy link
Member Author

I've simply cfg'd those out for now.

@workingjubilee
Copy link
Member Author

oh, that doesn't work at all, heh.

@workingjubilee
Copy link
Member Author

There.

@calebzulawski
Copy link
Member

It's actually scalars that changed, it seems...

@workingjubilee
Copy link
Member Author

Yes, probably.

@workingjubilee workingjubilee merged commit 5523a31 into rust-lang:master Oct 22, 2024
57 checks passed
@workingjubilee workingjubilee deleted the plus-minus-zero branch October 22, 2024 22:45
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.

f64::reduce_sum::lanes_1 test fails on latest nightly due to negative zero
2 participants