inlinebool SkCpu::Supports(uint32_t mask) {
uint32_t features = gCachedFeatures;
// If we mask in compile-time known lower limits, the compiler can // often compile away this entire function. #if SK_CPU_X86 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE1
features |= SSE1; #endif #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
features |= SSE2; #endif #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE3
features |= SSE3; #endif #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3
features |= SSSE3; #endif #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41
features |= SSE41; #endif #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE42
features |= SSE42; #endif #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_AVX
features |= AVX; #endif // F16C goes here if we add SK_CPU_SSE_LEVEL_F16C #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_AVX2
features |= AVX2; #endif #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SKX
features |= (AVX512F | AVX512DQ | AVX512CD | AVX512BW | AVX512VL); #endif // FMA doesn't fit neatly into this total ordering. // It's available on Haswell+ just like AVX2, but it's technically a different bit. // TODO: circle back on this if we find ourselves limited by lack of compile-time FMA
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.