mark POPCNT intrinsics as safe

Mark all POPCNT intrinsics as safe.

`_mm_popcnt_u32` and `_mm_popcnt_u64` are missing.
This commit is contained in:
usamoi 2025-01-26 20:56:22 +08:00 committed by Amanieu d'Antras
parent 0db395e703
commit 1271b7e281
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ pub unsafe fn _lzcnt_u32(x: u32) -> u32 {
#[target_feature(enable = "popcnt")]
#[cfg_attr(test, assert_instr(popcnt))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _popcnt32(x: i32) -> i32 {
pub fn _popcnt32(x: i32) -> i32 {
x.count_ones() as i32
}

View file

@ -40,7 +40,7 @@ pub unsafe fn _lzcnt_u64(x: u64) -> u64 {
#[target_feature(enable = "popcnt")]
#[cfg_attr(test, assert_instr(popcnt))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _popcnt64(x: i64) -> i32 {
pub fn _popcnt64(x: i64) -> i32 {
x.count_ones() as i32
}