fn last_digit_byte_dispatcher(s: &str) -> u32 {
    #[cfg(target_arch = "x86_64")]
    {
        if is_x86_feature_detected!("avx2") {
            // repelace the global variable with the pointer to the sse42 function
            unsafe {
                LAST_DIGIT_BYTE = avx::last_digit_byte;
                return avx::last_digit_byte(s);
            }
        }
        if is_x86_feature_detected!("sse4.2") {
            // repelace the global variable with the pointer to the sse42 function
            unsafe {
                LAST_DIGIT_BYTE = sse42::last_digit_byte;
                return sse42::last_digit_byte(s);
            }
        }
        if is_x86_feature_detected!("sse4.1") {
            // repelace the global variable with the pointer to the sse41
            // function
            unsafe {
                LAST_DIGIT_BYTE = sse41::last_digit_byte;
                return sse41::last_digit_byte(s);
            }
        }
    }
    // fallback implementation
    unsafe {
        LAST_DIGIT_BYTE = fallback::last_digit_byte;
    }
    fallback::last_digit_byte(s)
}
/// Implements a single dispatch method to assign the appropiate function to the
/// global variable LAST_DIGIT_BYTE
Implements a single dispatch method to assign the appropiate function to the
global variable LAST_DIGIT_BYTE
Implements a single dispatch method to assign the appropiate function to the global variable LAST_DIGIT_BYTE
fn last_digit_byte_dispatcher(s: &str) -> u32 {
    #[cfg(target_arch = "x86_64")]
    {
        if is_x86_feature_detected!("avx2") {
            // repelace the global variable with the pointer to the sse42 function
            unsafe {
                LAST_DIGIT_BYTE = avx::last_digit_byte;
                return avx::last_digit_byte(s);
            }
        }
        if is_x86_feature_detected!("sse4.2") {
            // repelace the global variable with the pointer to the sse42 function
            unsafe {
                LAST_DIGIT_BYTE = sse42::last_digit_byte;
                return sse42::last_digit_byte(s);
            }
        }
        if is_x86_feature_detected!("sse4.1") {
            // repelace the global variable with the pointer to the sse41
            // function
            unsafe {
                LAST_DIGIT_BYTE = sse41::last_digit_byte;
                return sse41::last_digit_byte(s);
            }
        }
    }
    // fallback implementation
    unsafe {
        LAST_DIGIT_BYTE = fallback::last_digit_byte;
    }
    fallback::last_digit_byte(s)
}
fn last_digit_byte_dispatcher ( s : & str ) -> u32 { # [ cfg ( target_arch " " ) ] { if is_x86_feature_detected ! ( " " ) { // repelace the global variable with the pointer to the sse42 function unsafe { LAST_DIGIT_BYTE = avx :: last_digit_byte ; return avx :: last_digit_byte ( s ) ; } } if is_x86_feature_detected ! ( " " ) { // repelace the global variable with the pointer to the sse42 function unsafe { LAST_DIGIT_BYTE = sse42 :: last_digit_byte ; return sse42 :: last_digit_byte ( s ) ; } } if is_x86_feature_detected ! ( " " ) { // repelace the global variable with the pointer to the sse41 // function unsafe { LAST_DIGIT_BYTE = sse41 :: last_digit_byte ; return sse41 :: last_digit_byte ( s ) ; } } } // fallback implementation unsafe { LAST_DIGIT_BYTE = fallback :: last_digit_byte ; } fallback :: last_digit_byte ( s ) }
Implements a single dispatch method to assign the appropiate function to the
global variable LAST_DIGIT_BYTE
Implements a single dispatch method to assign the appropiate function to the global variable LAST_DIGIT_BYTE
s
&str