| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 return LIBYUV_FALSE; | 190 return LIBYUV_FALSE; |
| 191 } | 191 } |
| 192 #else // nacl does not support getenv(). | 192 #else // nacl does not support getenv(). |
| 193 static LIBYUV_BOOL TestEnv(const char*) { | 193 static LIBYUV_BOOL TestEnv(const char*) { |
| 194 return LIBYUV_FALSE; | 194 return LIBYUV_FALSE; |
| 195 } | 195 } |
| 196 #endif | 196 #endif |
| 197 | 197 |
| 198 LIBYUV_API SAFEBUFFERS | 198 LIBYUV_API SAFEBUFFERS |
| 199 int InitCpuFlags(void) { | 199 int InitCpuFlags(void) { |
| 200 int cpu_info; |
| 200 #if !defined(__pnacl__) && !defined(__CLR_VER) && defined(CPU_X86) | 201 #if !defined(__pnacl__) && !defined(__CLR_VER) && defined(CPU_X86) |
| 201 int cpu_info; | |
| 202 uint32 cpu_info0[4] = { 0, 0, 0, 0 }; | 202 uint32 cpu_info0[4] = { 0, 0, 0, 0 }; |
| 203 uint32 cpu_info1[4] = { 0, 0, 0, 0 }; | 203 uint32 cpu_info1[4] = { 0, 0, 0, 0 }; |
| 204 uint32 cpu_info7[4] = { 0, 0, 0, 0 }; | 204 uint32 cpu_info7[4] = { 0, 0, 0, 0 }; |
| 205 CpuId(0, 0, cpu_info0); | 205 CpuId(0, 0, cpu_info0); |
| 206 CpuId(1, 0, cpu_info1); | 206 CpuId(1, 0, cpu_info1); |
| 207 if (cpu_info0[0] >= 7) { | 207 if (cpu_info0[0] >= 7) { |
| 208 CpuId(7, 0, cpu_info7); | 208 CpuId(7, 0, cpu_info7); |
| 209 } | 209 } |
| 210 cpu_info = ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) | | 210 cpu_info = ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) | |
| 211 ((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) | | 211 ((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) | |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 // Note that use of this function is not thread safe. | 297 // Note that use of this function is not thread safe. |
| 298 LIBYUV_API | 298 LIBYUV_API |
| 299 void MaskCpuFlags(int enable_flags) { | 299 void MaskCpuFlags(int enable_flags) { |
| 300 cpu_info_ = InitCpuFlags() & enable_flags; | 300 cpu_info_ = InitCpuFlags() & enable_flags; |
| 301 } | 301 } |
| 302 | 302 |
| 303 #ifdef __cplusplus | 303 #ifdef __cplusplus |
| 304 } // extern "C" | 304 } // extern "C" |
| 305 } // namespace libyuv | 305 } // namespace libyuv |
| 306 #endif | 306 #endif |
| OLD | NEW |