@@ -20,7 +20,7 @@ use stdarch_test::assert_instr;
20
20
#[ target_feature( enable = "bmi1" ) ]
21
21
#[ cfg_attr( test, assert_instr( bextr) ) ]
22
22
#[ 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 {
24
24
_bextr2_u32 ( a, ( start & 0xff_u32 ) | ( ( len & 0xff_u32 ) << 8_u32 ) )
25
25
}
26
26
@@ -35,8 +35,8 @@ pub unsafe fn _bextr_u32(a: u32, start: u32, len: u32) -> u32 {
35
35
#[ target_feature( enable = "bmi1" ) ]
36
36
#[ cfg_attr( test, assert_instr( bextr) ) ]
37
37
#[ 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) }
40
40
}
41
41
42
42
/// Bitwise logical `AND` of inverted `a` with `b`.
@@ -46,7 +46,7 @@ pub unsafe fn _bextr2_u32(a: u32, control: u32) -> u32 {
46
46
#[ target_feature( enable = "bmi1" ) ]
47
47
#[ cfg_attr( test, assert_instr( andn) ) ]
48
48
#[ 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 {
50
50
!a & b
51
51
}
52
52
@@ -57,7 +57,7 @@ pub unsafe fn _andn_u32(a: u32, b: u32) -> u32 {
57
57
#[ target_feature( enable = "bmi1" ) ]
58
58
#[ cfg_attr( test, assert_instr( blsi) ) ]
59
59
#[ 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 {
61
61
x & x. wrapping_neg ( )
62
62
}
63
63
@@ -68,7 +68,7 @@ pub unsafe fn _blsi_u32(x: u32) -> u32 {
68
68
#[ target_feature( enable = "bmi1" ) ]
69
69
#[ cfg_attr( test, assert_instr( blsmsk) ) ]
70
70
#[ 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 {
72
72
x ^ ( x. wrapping_sub ( 1_u32 ) )
73
73
}
74
74
@@ -81,7 +81,7 @@ pub unsafe fn _blsmsk_u32(x: u32) -> u32 {
81
81
#[ target_feature( enable = "bmi1" ) ]
82
82
#[ cfg_attr( test, assert_instr( blsr) ) ]
83
83
#[ 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 {
85
85
x & ( x. wrapping_sub ( 1 ) )
86
86
}
87
87
@@ -94,7 +94,7 @@ pub unsafe fn _blsr_u32(x: u32) -> u32 {
94
94
#[ target_feature( enable = "bmi1" ) ]
95
95
#[ cfg_attr( test, assert_instr( tzcnt) ) ]
96
96
#[ 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 {
98
98
x. trailing_zeros ( ) as u16
99
99
}
100
100
@@ -107,7 +107,7 @@ pub unsafe fn _tzcnt_u16(x: u16) -> u16 {
107
107
#[ target_feature( enable = "bmi1" ) ]
108
108
#[ cfg_attr( test, assert_instr( tzcnt) ) ]
109
109
#[ 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 {
111
111
x. trailing_zeros ( )
112
112
}
113
113
@@ -120,7 +120,7 @@ pub unsafe fn _tzcnt_u32(x: u32) -> u32 {
120
120
#[ target_feature( enable = "bmi1" ) ]
121
121
#[ cfg_attr( test, assert_instr( tzcnt) ) ]
122
122
#[ 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 {
124
124
x. trailing_zeros ( ) as i32
125
125
}
126
126
0 commit comments