@@ -15,7 +15,7 @@ use stdsimd_test::assert_instr;
15
15
/// Extracts bits in range [`start`, `start` + `length`) from `a` into
16
16
/// the least significant bits of the result.
17
17
#[ inline]
18
- #[ target_feature( enable = "bmi " ) ]
18
+ #[ target_feature( enable = "bmi1 " ) ]
19
19
#[ cfg_attr( test, assert_instr( bextr) ) ]
20
20
#[ cfg( not( target_arch = "x86" ) ) ]
21
21
pub unsafe fn _bextr_u64 ( a : u64 , start : u32 , len : u32 ) -> u64 {
@@ -28,7 +28,7 @@ pub unsafe fn _bextr_u64(a: u64, start: u32, len: u32) -> u64 {
28
28
/// Bits [7,0] of `control` specify the index to the first bit in the range to
29
29
/// be extracted, and bits [15,8] specify the length of the range.
30
30
#[ inline]
31
- #[ target_feature( enable = "bmi " ) ]
31
+ #[ target_feature( enable = "bmi1 " ) ]
32
32
#[ cfg_attr( test, assert_instr( bextr) ) ]
33
33
#[ cfg( not( target_arch = "x86" ) ) ]
34
34
pub unsafe fn _bextr2_u64 ( a : u64 , control : u64 ) -> u64 {
@@ -37,15 +37,15 @@ pub unsafe fn _bextr2_u64(a: u64, control: u64) -> u64 {
37
37
38
38
/// Bitwise logical `AND` of inverted `a` with `b`.
39
39
#[ inline]
40
- #[ target_feature( enable = "bmi " ) ]
40
+ #[ target_feature( enable = "bmi1 " ) ]
41
41
#[ cfg_attr( test, assert_instr( andn) ) ]
42
42
pub unsafe fn _andn_u64 ( a : u64 , b : u64 ) -> u64 {
43
43
!a & b
44
44
}
45
45
46
46
/// Extract lowest set isolated bit.
47
47
#[ inline]
48
- #[ target_feature( enable = "bmi " ) ]
48
+ #[ target_feature( enable = "bmi1 " ) ]
49
49
#[ cfg_attr( test, assert_instr( blsi) ) ]
50
50
#[ cfg( not( target_arch = "x86" ) ) ] // generates lots of instructions
51
51
pub unsafe fn _blsi_u64 ( x : u64 ) -> u64 {
@@ -54,7 +54,7 @@ pub unsafe fn _blsi_u64(x: u64) -> u64 {
54
54
55
55
/// Get mask up to lowest set bit.
56
56
#[ inline]
57
- #[ target_feature( enable = "bmi " ) ]
57
+ #[ target_feature( enable = "bmi1 " ) ]
58
58
#[ cfg_attr( test, assert_instr( blsmsk) ) ]
59
59
#[ cfg( not( target_arch = "x86" ) ) ] // generates lots of instructions
60
60
pub unsafe fn _blsmsk_u64 ( x : u64 ) -> u64 {
@@ -65,7 +65,7 @@ pub unsafe fn _blsmsk_u64(x: u64) -> u64 {
65
65
///
66
66
/// If `x` is sets CF.
67
67
#[ inline]
68
- #[ target_feature( enable = "bmi " ) ]
68
+ #[ target_feature( enable = "bmi1 " ) ]
69
69
#[ cfg_attr( test, assert_instr( blsr) ) ]
70
70
#[ cfg( not( target_arch = "x86" ) ) ] // generates lots of instructions
71
71
pub unsafe fn _blsr_u64 ( x : u64 ) -> u64 {
@@ -76,7 +76,7 @@ pub unsafe fn _blsr_u64(x: u64) -> u64 {
76
76
///
77
77
/// When the source operand is 0, it returns its size in bits.
78
78
#[ inline]
79
- #[ target_feature( enable = "bmi " ) ]
79
+ #[ target_feature( enable = "bmi1 " ) ]
80
80
#[ cfg_attr( test, assert_instr( tzcnt) ) ]
81
81
pub unsafe fn _tzcnt_u64 ( x : u64 ) -> u64 {
82
82
x. trailing_zeros ( ) as u64
@@ -86,7 +86,7 @@ pub unsafe fn _tzcnt_u64(x: u64) -> u64 {
86
86
///
87
87
/// When the source operand is 0, it returns its size in bits.
88
88
#[ inline]
89
- #[ target_feature( enable = "bmi " ) ]
89
+ #[ target_feature( enable = "bmi1 " ) ]
90
90
#[ cfg_attr( test, assert_instr( tzcnt) ) ]
91
91
pub unsafe fn _mm_tzcnt_64 ( x : u64 ) -> i64 {
92
92
x. trailing_zeros ( ) as i64
@@ -104,13 +104,13 @@ mod tests {
104
104
use coresimd:: x86:: * ;
105
105
use coresimd:: x86_64:: * ;
106
106
107
- #[ simd_test = "bmi " ]
107
+ #[ simd_test = "bmi1 " ]
108
108
unsafe fn test_bextr_u64 ( ) {
109
109
let r = _bextr_u64 ( 0b0101_0000u64 , 4 , 4 ) ;
110
110
assert_eq ! ( r, 0b0000_0101u64 ) ;
111
111
}
112
112
113
- #[ simd_test = "bmi " ]
113
+ #[ simd_test = "bmi1 " ]
114
114
unsafe fn test_andn_u64 ( ) {
115
115
assert_eq ! ( _andn_u64( 0 , 0 ) , 0 ) ;
116
116
assert_eq ! ( _andn_u64( 0 , 1 ) , 1 ) ;
@@ -133,25 +133,25 @@ mod tests {
133
133
assert_eq ! ( r, 0b0001_1101u64 ) ;
134
134
}
135
135
136
- #[ simd_test = "bmi " ]
136
+ #[ simd_test = "bmi1 " ]
137
137
unsafe fn test_blsi_u64 ( ) {
138
138
assert_eq ! ( _blsi_u64( 0b1101_0000u64 ) , 0b0001_0000u64 ) ;
139
139
}
140
140
141
- #[ simd_test = "bmi " ]
141
+ #[ simd_test = "bmi1 " ]
142
142
unsafe fn test_blsmsk_u64 ( ) {
143
143
let r = _blsmsk_u64 ( 0b0011_0000u64 ) ;
144
144
assert_eq ! ( r, 0b0001_1111u64 ) ;
145
145
}
146
146
147
- #[ simd_test = "bmi " ]
147
+ #[ simd_test = "bmi1 " ]
148
148
unsafe fn test_blsr_u64 ( ) {
149
149
// TODO: test the behavior when the input is 0
150
150
let r = _blsr_u64 ( 0b0011_0000u64 ) ;
151
151
assert_eq ! ( r, 0b0010_0000u64 ) ;
152
152
}
153
153
154
- #[ simd_test = "bmi " ]
154
+ #[ simd_test = "bmi1 " ]
155
155
unsafe fn test_tzcnt_u64 ( ) {
156
156
assert_eq ! ( _tzcnt_u64( 0b0000_0001u64 ) , 0u64 ) ;
157
157
assert_eq ! ( _tzcnt_u64( 0b0000_0000u64 ) , 64u64 ) ;
0 commit comments