@@ -151,6 +151,7 @@ use digest::{DynDigest, InvalidBufferSize};
151151use std:: fs:: File ;
152152#[ cfg( feature = "std" ) ]
153153use std:: io:: { Read , Write } ;
154+ use crate :: feature_detection:: get_arch_ops;
154155
155156mod algorithm;
156157mod arch;
@@ -820,8 +821,6 @@ pub fn checksum_combine_with_params(
820821/// // "x86_64-sse-pclmulqdq" - x86_64 baseline with SSE4.1 and PCLMULQDQ
821822/// ```
822823pub fn get_calculator_target ( _algorithm : CrcAlgorithm ) -> String {
823- use crate :: feature_detection:: get_arch_ops;
824-
825824 let arch_ops = get_arch_ops ( ) ;
826825 arch_ops. get_target_string ( )
827826}
@@ -864,12 +863,11 @@ fn get_calculator_params(algorithm: CrcAlgorithm) -> (CalculatorFn, CrcParams) {
864863/// fusion techniques to accelerate the calculation beyond what SIMD can do alone.
865864#[ inline( always) ]
866865fn crc32_iscsi_calculator ( state : u64 , data : & [ u8 ] , _params : CrcParams ) -> u64 {
867- use crate :: feature_detection:: get_arch_ops;
868- let arch_ops = get_arch_ops ( ) ;
869-
870866 #[ cfg( target_arch = "aarch64" ) ]
871867 {
872868 use crate :: feature_detection:: PerformanceTier ;
869+
870+ let arch_ops = get_arch_ops ( ) ;
873871 match arch_ops. get_tier ( ) {
874872 PerformanceTier :: AArch64AesSha3 | PerformanceTier :: AArch64Aes => {
875873 return fusion:: crc32_iscsi ( state as u32 , data) as u64 ;
@@ -881,6 +879,8 @@ fn crc32_iscsi_calculator(state: u64, data: &[u8], _params: CrcParams) -> u64 {
881879 #[ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
882880 {
883881 use crate :: feature_detection:: PerformanceTier ;
882+
883+ let arch_ops = get_arch_ops ( ) ;
884884 match arch_ops. get_tier ( ) {
885885 PerformanceTier :: X86_64Avx512Vpclmulqdq
886886 | PerformanceTier :: X86_64Avx512Pclmulqdq
0 commit comments