Closed gnzlbg closed 7 years ago
Use intrinsics from the llvmint package.
parallel_bits_deposit
extract
bmi_pdep_32/64
bmi_pext_32/64
leading_zeros
__lzcnt16/32/u32/64/u64
count_ones
_popcnt_32/u32/64/u64
trailing_zeros
tzcnt
reset_bits_geq(starting bit)
bmi_bzhi_32/64
reset_least_significant_one
BLSR
~x & y
(src >> start) & ((1 << len)-1)
bmi_bextr_32/64
isolate_least_significant_one
x & -x
mask_trailing_zeros_and_least_significant_one
x ^ (x - 1)
Fixed by using bitintr.
Use intrinsics from the llvmint package.
parallel_bits_deposit
/extract
=>bmi_pdep_32/64
andbmi_pext_32/64
(BMI 2.0),leading_zeros
=> LLVM's__lzcnt16/32/u32/64/u64
(blocked on https://github.com/huonw/llvmint/issues/3) (BMI 1.0, ABM),count_ones
=> LLVM's_popcnt_32/u32/64/u64
(blocked on https://github.com/huonw/llvmint/issues/4) (SSE4.2, ABM),trailing_zeros
=>tzcnt
(BMI 1.0), (blocked on https://github.com/huonw/llvmint/issues/5 and https://github.com/rust-lang/rust/issues/34382)reset_bits_geq(starting bit)
=>bmi_bzhi_32/64
(BMI 1.0)reset_least_significant_one
=>BLSR
(BMI 1.0)~x & y
(BMI 1.0) (TODO: implement algorithm)(src >> start) & ((1 << len)-1)
=>bmi_bextr_32/64
(BMI 1.0)isolate_least_significant_one
: Extract lowest set isolated bit:x & -x
(blocked on "not available in llvmint) (BMI 1.0)mask_trailing_zeros_and_least_significant_one
: Get mask up to lowest set bit:x ^ (x - 1)
(blocked on "not available in llvmint") (BMI 1.0)