Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1099)

Side by Side Diff: source/cpu_id.cc

Issue 2285683002: Add MIPS SIMD Arch (MSA) optimized MirrorRow function (Closed)
Patch Set: Changes as per review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 #endif 252 #endif
253 #if defined(__mips__) && defined(__linux__) 253 #if defined(__mips__) && defined(__linux__)
254 #if defined(__mips_dspr2) 254 #if defined(__mips_dspr2)
255 cpu_info |= kCpuHasDSPR2; 255 cpu_info |= kCpuHasDSPR2;
256 #endif 256 #endif
257 cpu_info |= kCpuHasMIPS; 257 cpu_info |= kCpuHasMIPS;
258 if (getenv("LIBYUV_DISABLE_DSPR2")) { 258 if (getenv("LIBYUV_DISABLE_DSPR2")) {
259 cpu_info &= ~kCpuHasDSPR2; 259 cpu_info &= ~kCpuHasDSPR2;
260 } 260 }
261 #endif 261 #endif
262 #if defined(__mips__) && defined(__linux__)
fbarchard1 2016/09/14 01:48:04 this code block can be moved inside the previous #
manojkumar.bhosale 2016/09/14 12:45:30 Done.
263 #if defined(__mips_msa)
264 cpu_info |= kCpuHasMSA;
fbarchard1 2016/09/14 01:48:04 this is a compile time test. If built with MSA, b
manojkumar.bhosale 2016/09/14 12:45:30 Done.
265 #endif
266 cpu_info |= kCpuHasMIPS;
267 if (getenv("LIBYUV_DISABLE_MSA")) {
268 cpu_info &= ~kCpuHasMSA;
269 }
270 #endif
262 #if defined(__arm__) || defined(__aarch64__) 271 #if defined(__arm__) || defined(__aarch64__)
263 // gcc -mfpu=neon defines __ARM_NEON__ 272 // gcc -mfpu=neon defines __ARM_NEON__
264 // __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. 273 // __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon.
265 // For Linux, /proc/cpuinfo can be tested but without that assume Neon. 274 // For Linux, /proc/cpuinfo can be tested but without that assume Neon.
266 #if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__) 275 #if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__)
267 cpu_info = kCpuHasNEON; 276 cpu_info = kCpuHasNEON;
268 // For aarch64(arm64), /proc/cpuinfo's feature is not complete, e.g. no neon 277 // For aarch64(arm64), /proc/cpuinfo's feature is not complete, e.g. no neon
269 // flag in it. 278 // flag in it.
270 // So for aarch64, neon enabling is hard coded here. 279 // So for aarch64, neon enabling is hard coded here.
271 #endif 280 #endif
(...skipping 19 matching lines...) Expand all
291 // Note that use of this function is not thread safe. 300 // Note that use of this function is not thread safe.
292 LIBYUV_API 301 LIBYUV_API
293 void MaskCpuFlags(int enable_flags) { 302 void MaskCpuFlags(int enable_flags) {
294 cpu_info_ = InitCpuFlags() & enable_flags; 303 cpu_info_ = InitCpuFlags() & enable_flags;
295 } 304 }
296 305
297 #ifdef __cplusplus 306 #ifdef __cplusplus
298 } // extern "C" 307 } // extern "C"
299 } // namespace libyuv 308 } // namespace libyuv
300 #endif 309 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698