| OLD | NEW |
| 1 // Copyright 2011 Google Inc. All Rights Reserved. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
| 4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
| 5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
| 8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 9 // | 9 // |
| 10 // CPU detection | 10 // CPU detection |
| 11 // | 11 // |
| 12 // Author: Christian Duvivier (cduvivier@google.com) | 12 // Author: Christian Duvivier (cduvivier@google.com) |
| 13 | 13 |
| 14 #include "./dsp.h" | 14 #include "./dsp.h" |
| 15 | 15 |
| 16 #if defined(__ANDROID__) | 16 #if defined(__ANDROID__) |
| 17 #include <cpu-features.h> | 17 #include <cpu-features.h> |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 #if defined(__cplusplus) || defined(c_plusplus) | |
| 21 extern "C" { | |
| 22 #endif | |
| 23 | |
| 24 //------------------------------------------------------------------------------ | 20 //------------------------------------------------------------------------------ |
| 25 // SSE2 detection. | 21 // SSE2 detection. |
| 26 // | 22 // |
| 27 | 23 |
| 28 // apple/darwin gcc-4.0.1 defines __PIC__, but not __pic__ with -fPIC. | 24 // apple/darwin gcc-4.0.1 defines __PIC__, but not __pic__ with -fPIC. |
| 29 #if (defined(__pic__) || defined(__PIC__)) && defined(__i386__) | 25 #if (defined(__pic__) || defined(__PIC__)) && defined(__i386__) |
| 30 static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) { | 26 static WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) { |
| 31 __asm__ volatile ( | 27 __asm__ volatile ( |
| 32 "mov %%ebx, %%edi\n" | 28 "mov %%ebx, %%edi\n" |
| 33 "cpuid\n" | 29 "cpuid\n" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // VP8DecGetCPUInfo = NULL | 71 // VP8DecGetCPUInfo = NULL |
| 76 static int armCPUInfo(CPUFeature feature) { | 72 static int armCPUInfo(CPUFeature feature) { |
| 77 (void)feature; | 73 (void)feature; |
| 78 return 1; | 74 return 1; |
| 79 } | 75 } |
| 80 VP8CPUInfo VP8GetCPUInfo = armCPUInfo; | 76 VP8CPUInfo VP8GetCPUInfo = armCPUInfo; |
| 81 #else | 77 #else |
| 82 VP8CPUInfo VP8GetCPUInfo = NULL; | 78 VP8CPUInfo VP8GetCPUInfo = NULL; |
| 83 #endif | 79 #endif |
| 84 | 80 |
| 85 #if defined(__cplusplus) || defined(c_plusplus) | |
| 86 } // extern "C" | |
| 87 #endif | |
| OLD | NEW |