@@ -20,7 +20,7 @@ use stdarch_test::assert_instr;
2020#[ target_feature( enable = "bmi1" ) ]
2121#[ cfg_attr( test, assert_instr( bextr) ) ]
2222#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
23- pub unsafe fn _bextr_u32 ( a : u32 , start : u32 , len : u32 ) -> u32 {
23+ pub fn _bextr_u32 ( a : u32 , start : u32 , len : u32 ) -> u32 {
2424 _bextr2_u32 ( a, ( start & 0xff_u32 ) | ( ( len & 0xff_u32 ) << 8_u32 ) )
2525}
2626
@@ -35,8 +35,8 @@ pub unsafe fn _bextr_u32(a: u32, start: u32, len: u32) -> u32 {
3535#[ target_feature( enable = "bmi1" ) ]
3636#[ cfg_attr( test, assert_instr( bextr) ) ]
3737#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
38- pub unsafe fn _bextr2_u32 ( a : u32 , control : u32 ) -> u32 {
39- x86_bmi_bextr_32 ( a, control)
38+ pub fn _bextr2_u32 ( a : u32 , control : u32 ) -> u32 {
39+ unsafe { x86_bmi_bextr_32 ( a, control) }
4040}
4141
4242/// Bitwise logical `AND` of inverted `a` with `b`.
@@ -46,7 +46,7 @@ pub unsafe fn _bextr2_u32(a: u32, control: u32) -> u32 {
4646#[ target_feature( enable = "bmi1" ) ]
4747#[ cfg_attr( test, assert_instr( andn) ) ]
4848#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
49- pub unsafe fn _andn_u32 ( a : u32 , b : u32 ) -> u32 {
49+ pub fn _andn_u32 ( a : u32 , b : u32 ) -> u32 {
5050 !a & b
5151}
5252
@@ -57,7 +57,7 @@ pub unsafe fn _andn_u32(a: u32, b: u32) -> u32 {
5757#[ target_feature( enable = "bmi1" ) ]
5858#[ cfg_attr( test, assert_instr( blsi) ) ]
5959#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
60- pub unsafe fn _blsi_u32 ( x : u32 ) -> u32 {
60+ pub fn _blsi_u32 ( x : u32 ) -> u32 {
6161 x & x. wrapping_neg ( )
6262}
6363
@@ -68,7 +68,7 @@ pub unsafe fn _blsi_u32(x: u32) -> u32 {
6868#[ target_feature( enable = "bmi1" ) ]
6969#[ cfg_attr( test, assert_instr( blsmsk) ) ]
7070#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
71- pub unsafe fn _blsmsk_u32 ( x : u32 ) -> u32 {
71+ pub fn _blsmsk_u32 ( x : u32 ) -> u32 {
7272 x ^ ( x. wrapping_sub ( 1_u32 ) )
7373}
7474
@@ -81,7 +81,7 @@ pub unsafe fn _blsmsk_u32(x: u32) -> u32 {
8181#[ target_feature( enable = "bmi1" ) ]
8282#[ cfg_attr( test, assert_instr( blsr) ) ]
8383#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
84- pub unsafe fn _blsr_u32 ( x : u32 ) -> u32 {
84+ pub fn _blsr_u32 ( x : u32 ) -> u32 {
8585 x & ( x. wrapping_sub ( 1 ) )
8686}
8787
@@ -94,7 +94,7 @@ pub unsafe fn _blsr_u32(x: u32) -> u32 {
9494#[ target_feature( enable = "bmi1" ) ]
9595#[ cfg_attr( test, assert_instr( tzcnt) ) ]
9696#[ stable( feature = "simd_x86_updates" , since = "1.82.0" ) ]
97- pub unsafe fn _tzcnt_u16 ( x : u16 ) -> u16 {
97+ pub fn _tzcnt_u16 ( x : u16 ) -> u16 {
9898 x. trailing_zeros ( ) as u16
9999}
100100
@@ -107,7 +107,7 @@ pub unsafe fn _tzcnt_u16(x: u16) -> u16 {
107107#[ target_feature( enable = "bmi1" ) ]
108108#[ cfg_attr( test, assert_instr( tzcnt) ) ]
109109#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
110- pub unsafe fn _tzcnt_u32 ( x : u32 ) -> u32 {
110+ pub fn _tzcnt_u32 ( x : u32 ) -> u32 {
111111 x. trailing_zeros ( )
112112}
113113
@@ -120,7 +120,7 @@ pub unsafe fn _tzcnt_u32(x: u32) -> u32 {
120120#[ target_feature( enable = "bmi1" ) ]
121121#[ cfg_attr( test, assert_instr( tzcnt) ) ]
122122#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
123- pub unsafe fn _mm_tzcnt_32 ( x : u32 ) -> i32 {
123+ pub fn _mm_tzcnt_32 ( x : u32 ) -> i32 {
124124 x. trailing_zeros ( ) as i32
125125}
126126
0 commit comments