mark LZCNT intrinsics as safe

Mark all LZCNT intrinsics as safe.
This commit is contained in:
usamoi 2025-01-26 20:56:25 +08:00 committed by Amanieu d'Antras
parent 1271b7e281
commit 9913eb5436
2 changed files with 2 additions and 2 deletions

View file

@ -29,7 +29,7 @@ use stdarch_test::assert_instr;
#[target_feature(enable = "lzcnt")]
#[cfg_attr(test, assert_instr(lzcnt))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _lzcnt_u32(x: u32) -> u32 {
pub fn _lzcnt_u32(x: u32) -> u32 {
x.leading_zeros()
}

View file

@ -29,7 +29,7 @@ use stdarch_test::assert_instr;
#[target_feature(enable = "lzcnt")]
#[cfg_attr(test, assert_instr(lzcnt))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _lzcnt_u64(x: u64) -> u64 {
pub fn _lzcnt_u64(x: u64) -> u64 {
x.leading_zeros() as u64
}