OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Test_flag parameter should be one of kCpuHas constants above. | 55 // Test_flag parameter should be one of kCpuHas constants above. |
56 // returns non-zero if instruction set is detected | 56 // returns non-zero if instruction set is detected |
57 static __inline int TestCpuFlag(int test_flag) { | 57 static __inline int TestCpuFlag(int test_flag) { |
58 LIBYUV_API extern int cpu_info_; | 58 LIBYUV_API extern int cpu_info_; |
59 return (!cpu_info_ ? InitCpuFlags() : cpu_info_) & test_flag; | 59 return (!cpu_info_ ? InitCpuFlags() : cpu_info_) & test_flag; |
60 } | 60 } |
61 | 61 |
62 // For testing, allow CPU flags to be disabled. | 62 // For testing, allow CPU flags to be disabled. |
63 // ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. | 63 // ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. |
64 // MaskCpuFlags(-1) to enable all cpu specific optimizations. | 64 // MaskCpuFlags(-1) to enable all cpu specific optimizations. |
65 // MaskCpuFlags(0) to disable all cpu specific optimizations. | 65 // MaskCpuFlags(1) to disable all cpu specific optimizations. |
66 LIBYUV_API | 66 LIBYUV_API |
67 void MaskCpuFlags(int enable_flags); | 67 void MaskCpuFlags(int enable_flags); |
68 | 68 |
69 // Low level cpuid for X86. Returns zeros on other CPUs. | 69 // Low level cpuid for X86. Returns zeros on other CPUs. |
70 // eax is the info type that you want. | 70 // eax is the info type that you want. |
71 // ecx is typically the cpu number, and should normally be zero. | 71 // ecx is typically the cpu number, and should normally be zero. |
72 LIBYUV_API | 72 LIBYUV_API |
73 void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info); | 73 void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info); |
74 | 74 |
75 #ifdef __cplusplus | 75 #ifdef __cplusplus |
76 } // extern "C" | 76 } // extern "C" |
77 } // namespace libyuv | 77 } // namespace libyuv |
78 #endif | 78 #endif |
79 | 79 |
80 #endif // INCLUDE_LIBYUV_CPU_ID_H_ NOLINT | 80 #endif // INCLUDE_LIBYUV_CPU_ID_H_ NOLINT |
OLD | NEW |