• Frank Barchard's avatar
    document cpuid command line behavior · e2611a73
    Frank Barchard authored
    cpu_info_ is zero for uninitialized state and all bits are off, disabling all cpu optimizations.
    the 1 bit indicates cpu_info_ is initialized avoiding calling the detection code again for performance.
    
    MaskCpuFlags initializes the cpu ignoring existing flags, then masks with the supplied flags and stores to cpu_info_.
    As a mask, -1 has no effect, enabling all cpu features that were detected, but nothing that wasnt detected.
    Setting to 0 will cause the next call to re-initialize the cpu, which is same as enabling all features.
    Setting mask to 1 will turn off all cpu features but keep the initialized bit on, so the next detection call wont reinitialize and the cpu features are all disabled.
    
    So normal behavior for command line and programatic masking is:
    1 = C
    -1 = SIMD
    
    TBR=harryjin@google.com
    BUG=libyuv:600
    TESTED=out64/Release/bin/run_libyuv_unittest -s libyuv_unittest --verbose --release --gtest_filter=*ARGBExtractAlpha* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=9999 --libyuv_flags=1 --libyuv_cpu_info=1"
    
    Review URL: https://codereview.chromium.org/2042933002 .
    e2611a73
unit_test.cc 11.7 KB