Description
There are currently no target features for bit manipulation instruction sets, in particular:
- AMD's Advanced Bit Manipulation (ABM) and Trailing Bit Manipulation (TBM) instructions, and
- Intel's Bit Manipulation Instructions (BMI1 and BMI2).
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
, and tmb
.