How to make Cargo crate enable instruction set if the compiling hardware supports it?
My library runs substantially faster on x86 when compiled with the avx2
, bmi1
, bmi2
instruction sets, but even today not all hardware supports those. I think ideally the build would check whether the hardware supports these instruction sets and compile with them if so. How can I best make this happen?
error: linking with `cc` failed: exit status: 1 caused by:(signal: 10, SIGBUS: access to undefined memory)
error while compiling