| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 if (TestEnv("LIBYUV_DISABLE_FMA3")) { | 245 if (TestEnv("LIBYUV_DISABLE_FMA3")) { |
| 246 cpu_info &= ~kCpuHasFMA3; | 246 cpu_info &= ~kCpuHasFMA3; |
| 247 } | 247 } |
| 248 if (TestEnv("LIBYUV_DISABLE_AVX3")) { | 248 if (TestEnv("LIBYUV_DISABLE_AVX3")) { |
| 249 cpu_info &= ~kCpuHasAVX3; | 249 cpu_info &= ~kCpuHasAVX3; |
| 250 } | 250 } |
| 251 #endif | 251 #endif |
| 252 #if defined(__mips__) && defined(__linux__) | 252 #if defined(__mips__) && defined(__linux__) |
| 253 #if defined(__mips_dspr2) | 253 #if defined(__mips_dspr2) |
| 254 cpu_info |= kCpuHasMIPS_DSPR2; | 254 cpu_info |= kCpuHasDSPR2; |
| 255 #endif | 255 #endif |
| 256 cpu_info |= kCpuHasMIPS; | 256 cpu_info |= kCpuHasMIPS; |
| 257 | 257 if (getenv("LIBYUV_DISABLE_DSPR2")) { |
| 258 if (getenv("LIBYUV_DISABLE_MIPS")) { | 258 cpu_info &= ~kCpuHasDSPR2; |
| 259 cpu_info &= ~kCpuHasMIPS; | |
| 260 } | |
| 261 if (getenv("LIBYUV_DISABLE_MIPS_DSPR2")) { | |
| 262 cpu_info &= ~kCpuHasMIPS_DSPR2; | |
| 263 } | 259 } |
| 264 #endif | 260 #endif |
| 265 #if defined(__arm__) || defined(__aarch64__) | 261 #if defined(__arm__) || defined(__aarch64__) |
| 266 // gcc -mfpu=neon defines __ARM_NEON__ | 262 // gcc -mfpu=neon defines __ARM_NEON__ |
| 267 // __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. | 263 // __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. |
| 268 // For Linux, /proc/cpuinfo can be tested but without that assume Neon. | 264 // For Linux, /proc/cpuinfo can be tested but without that assume Neon. |
| 269 #if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__) | 265 #if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__) |
| 270 cpu_info = kCpuHasNEON; | 266 cpu_info = kCpuHasNEON; |
| 271 // For aarch64(arm64), /proc/cpuinfo's feature is not complete, e.g. no neon | 267 // For aarch64(arm64), /proc/cpuinfo's feature is not complete, e.g. no neon |
| 272 // flag in it. | 268 // flag in it. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 294 // Note that use of this function is not thread safe. | 290 // Note that use of this function is not thread safe. |
| 295 LIBYUV_API | 291 LIBYUV_API |
| 296 void MaskCpuFlags(int enable_flags) { | 292 void MaskCpuFlags(int enable_flags) { |
| 297 cpu_info_ = InitCpuFlags() & enable_flags; | 293 cpu_info_ = InitCpuFlags() & enable_flags; |
| 298 } | 294 } |
| 299 | 295 |
| 300 #ifdef __cplusplus | 296 #ifdef __cplusplus |
| 301 } // extern "C" | 297 } // extern "C" |
| 302 } // namespace libyuv | 298 } // namespace libyuv |
| 303 #endif | 299 #endif |
| OLD | NEW |