-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Surprising behavior of portable SIMD integer vector max/min #94682
Comments
I think this is the same as rust-lang/portable-simd#247 and rust-lang/portable-simd#253. |
Ah, it is. Not sure which issue tracker is the preferred one for such issues. |
Hello! |
This was referenced Mar 8, 2022
Fixed by rust-lang/portable-simd#260 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code does not print what I would expect:
I expected element-wise max/min, but I got:
The funny thing is that portable-simd does not even define
max
/min
on its integer SIMD types (only on the float ones). What happens is that it falls back toOrd::max
, and it looks like vectors implementOrd
by comparing them as arrays, which probably uses lexicographic comparison.However this means integer and float vectors
max
/min
methods behave very differently, so this is probably not intended?Cc @workingjubilee
The text was updated successfully, but these errors were encountered: