@@ -6,13 +6,13 @@ pub fn slide_hash(state: &mut crate::deflate::State) {
6
6
}
7
7
8
8
fn slide_hash_chain ( table : & mut [ u16 ] , wsize : u16 ) {
9
- #[ cfg( all ( target_arch = "x86_64" , feature = "std" ) ) ]
10
- if std :: is_x86_feature_detected! ( "avx2" ) {
9
+ #[ cfg( target_arch = "x86_64" ) ]
10
+ if crate :: cpu_features :: is_enabled_avx2 ( ) {
11
11
return avx2:: slide_hash_chain ( table, wsize) ;
12
12
}
13
13
14
- #[ cfg( all ( target_arch = "aarch64" , feature = "std" ) ) ]
15
- if std :: arch :: is_aarch64_feature_detected! ( "neon" ) {
14
+ #[ cfg( target_arch = "aarch64" ) ]
15
+ if crate :: cpu_features :: is_enabled_neon ( ) {
16
16
return neon:: slide_hash_chain ( table, wsize) ;
17
17
}
18
18
@@ -34,7 +34,7 @@ mod neon {
34
34
} ;
35
35
36
36
pub fn slide_hash_chain ( table : & mut [ u16 ] , wsize : u16 ) {
37
- assert ! ( std :: arch :: is_aarch64_feature_detected! ( "neon" ) ) ;
37
+ assert ! ( crate :: cpu_features :: is_enabled_neon ( ) ) ;
38
38
unsafe { slide_hash_chain_internal ( table, wsize) }
39
39
}
40
40
@@ -71,7 +71,7 @@ mod avx2 {
71
71
} ;
72
72
73
73
pub fn slide_hash_chain ( table : & mut [ u16 ] , wsize : u16 ) {
74
- assert ! ( std :: is_x86_feature_detected! ( "avx2" ) ) ;
74
+ assert ! ( crate :: cpu_features :: is_enabled_avx2 ( ) ) ;
75
75
unsafe { slide_hash_chain_internal ( table, wsize) }
76
76
}
77
77
@@ -123,7 +123,7 @@ mod tests {
123
123
#[ test]
124
124
#[ cfg( target_arch = "x86_64" ) ]
125
125
fn test_slide_hash_avx2 ( ) {
126
- if std :: arch :: is_x86_feature_detected! ( "avx2" ) {
126
+ if crate :: cpu_features :: is_enabled_avx2 ( ) {
127
127
let mut input = INPUT ;
128
128
129
129
avx2:: slide_hash_chain ( & mut input, WSIZE ) ;
@@ -135,7 +135,7 @@ mod tests {
135
135
#[ test]
136
136
#[ cfg( target_arch = "aarch64" ) ]
137
137
fn test_slide_hash_neon ( ) {
138
- if std :: arch :: is_aarch64_feature_detected! ( "neon" ) {
138
+ if crate :: cpu_features :: is_enabled_neon ( ) {
139
139
let mut input = INPUT ;
140
140
141
141
neon:: slide_hash_chain ( & mut input, WSIZE ) ;
0 commit comments