1 /* 2 * Copyright (c) 2011 The LibYuv project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef INCLUDE_LIBYUV_CPU_ID_H_ 12 #define INCLUDE_LIBYUV_CPU_ID_H_ 13 14 namespace libyuv { 15 16 // These flags are only valid on x86 processors 17 static const int kCpuHasSSE2 = 1; 18 static const int kCpuHasSSSE3 = 2; 19 20 // These flags are only valid on ARM processors 21 static const int kCpuHasNEON = 4; 22 23 // Internal flag to indicate cpuid is initialized. 24 static const int kCpuInitialized = 8; 25 26 // Detect CPU has SSE2 etc. 27 bool TestCpuFlag(int flag); 28 29 // For testing, allow CPU flags to be disabled. 30 // ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. -1 to enable all. 31 void MaskCpuFlags(int enable_flags); 32 33 } // namespace libyuv 34 35 #endif // INCLUDE_LIBYUV_CPU_ID_H_ 36