target_features for bit manipulation instruction sets #30462
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
There are currently no target features for bit manipulation instruction sets, in particular:
Since clang has macros to detect these I guess llvm offers the ability to obtain this functionality from the CPUID as well.
Wikipedia offers a pretty good and brief review of the situation. Basically all modern processors support ABM and BMI1. Modern Intel CPUs support BMI2, and next generation AMD CPUs will as well.
AMD also has TBM but these won't be supported anymore in future CPUs.
Huon's llvmin offers intrinsics for all these instruction sets but without a target config macro there is no way of wrapping these into a higher level safer abstraction portably.
So basically I would like to have target features to use in
#[cfg(_)]
for:amb
,bmi1
,bmi2
, andtmb
.The text was updated successfully, but these errors were encountered: