-
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
_mm512_shrdv_* intrinsics have incorrect argument order #130365
Comments
Ah, thank you for reporting this! stabilizing #111137 should be blocked on this (on top of other reasons it cannot yet be stabilized). |
Do GCC's |
This bug was probably due to an inconsistency on Intel's part. The |
The fix has been merged in stdarch (rust-lang/stdarch#1644) |
Thank you for taking care of that! |
I tried this code:
I expected to see this happen:
The code produces the same output as the equivalent C program:
The program outputs 32767.
Instead, the Rust program outputs -2147483648.
Intel's documentation (as linked in the rustdoc for the function) for
_mm512_shrdv_epi32
states:meaning argument
b
is the upper bits, anda
is the lower bits. However,llvm.fshr.*
uses the opposite order. It appears Rust is passing arguments a, b, and c in that order tollvm.fshr
:https://github.com/rust-lang/stdarch/blob/b1edbf90955cb9b057a323f761e2c19edb591e6f/crates/core_arch/src/x86/avx512vbmi2.rs#L997-L999
This likely also applies to all similar intrinsics that call
llvm.fshr
.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: