-
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
Calling the llvmint::cttz_iX
is broken
#34382
Comments
Did you find |
Is the handling of zero by that intrinsic defined or undefined? The documentation does not say, and one might want to do both (hence why |
I think the best correct solution you can hope for here is new intrinsics in re zero: answered on the other issue: #34381. |
So this turned into an XY Problem. What I actually wanted was to use the BMI 1.0 tzcnt intrinsic without writting any assembly. Ideally, So to work around the lack of a feature flag I ended up adding my own feature flags to my crate and trying to call llvm intrinsics for the particular architectures directly and running into this. |
|
@eefriedman Thanks! Are those documented somewhere (i've tried googling for the supported target-features without any luck)? Is that for BMI 1.0 or BMI 2.0? EDIT: found it! The command |
Is there a way to detect the target-feature's enabled from within a rust program? Something like |
This commit adds support for detecting all of llc's target features for the x86/x86_64 architectures. Closes rust-lang#30462. Helps with rust-lang#29717 and rust-lang#34382.
I suspect that this is no longer an issue judging by the comments, with the proper solution being |
I am trying to call the
llvmint::cttz_i8(1i8, false)
intrinsic from the llvmint crate and am getting the following error:The problem seems to be that rustc is not propagating
false
to LLVM properly.This was also reported to the llvmint crate: huonw/llvmint#5
The text was updated successfully, but these errors were encountered: