|
impl From<Bitmap<128>> for __m128i { |
|
fn from(data: Bitmap<128>) -> Self { |
|
unsafe { data.load_m128i() } |
|
} |
|
} |
|
|
|
impl From<Bitmap<256>> for __m256i { |
|
fn from(data: Bitmap<256>) -> Self { |
|
unsafe { data.load_m256i() } |
|
} |
|
} |
This is UB: the two load functions are #[target_feature(enable = "avx")], which means they are not unconditionally available on all x86 platforms. This should probably check if cfg_feature_enabled!("avx") or use cfg!(target_feature = "avx2"). In the latter case, the avx calls will only be reached if compiling with AVX enabled (whereas in the former, you can have one binary for all x86 chips and there's a runtime check)
bitmaps/src/bitmap.rs
Lines 691 to 701 in b449cec
This is UB: the two
loadfunctions are#[target_feature(enable = "avx")], which means they are not unconditionally available on all x86 platforms. This should probably checkif cfg_feature_enabled!("avx")or usecfg!(target_feature = "avx2"). In the latter case, the avx calls will only be reached if compiling with AVX enabled (whereas in the former, you can have one binary for all x86 chips and there's a runtime check)