summaryrefslogtreecommitdiff
path: root/system_wrappers/source/cpu_features.cc
diff options
context:
space:
mode:
authorphoglund@webrtc.org <phoglund@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-11-21 08:02:57 +0000
committerphoglund@webrtc.org <phoglund@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2012-11-21 08:02:57 +0000
commit4c5465095c9d2322c63685cd2760c57913a58ec1 (patch)
treee4dbe89c1804b33bfe67e4a17eef1507ed4a27aa /system_wrappers/source/cpu_features.cc
parentab9aa4544959aed9ff8f94569d8a6b2b15570651 (diff)
downloadwebrtc-4c5465095c9d2322c63685cd2760c57913a58ec1.tar.gz
Reformatted most of the CPU stuff in system_wrappers.
BUG= Review URL: https://webrtc-codereview.appspot.com/930025 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@3142 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'system_wrappers/source/cpu_features.cc')
-rw-r--r--system_wrappers/source/cpu_features.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/system_wrappers/source/cpu_features.cc b/system_wrappers/source/cpu_features.cc
index 41a86e36..61c13604 100644
--- a/system_wrappers/source/cpu_features.cc
+++ b/system_wrappers/source/cpu_features.cc
@@ -10,15 +10,13 @@
// Parts of this file derived from Chromium's base/cpu.cc.
-#include "cpu_features_wrapper.h"
+#include "system_wrappers/interface/cpu_features_wrapper.h"
-#include "typedefs.h"
-
-#if defined(WEBRTC_ARCH_X86_FAMILY)
-#if defined(_MSC_VER)
+#if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER)
#include <intrin.h>
#endif
-#endif
+
+#include "typedefs.h"
// No CPU feature is available => straight C path.
int GetCPUInfoNoASM(CPUFeature feature) {
@@ -31,7 +29,7 @@ int GetCPUInfoNoASM(CPUFeature feature) {
// Intrinsic for "cpuid".
#if defined(__pic__) && defined(__i386__)
static inline void __cpuid(int cpu_info[4], int info_type) {
- __asm__ volatile (
+ __asm__ volatile(
"mov %%ebx, %%edi\n"
"cpuid\n"
"xchg %%edi, %%ebx\n"
@@ -40,7 +38,7 @@ static inline void __cpuid(int cpu_info[4], int info_type) {
}
#else
static inline void __cpuid(int cpu_info[4], int info_type) {
- __asm__ volatile (
+ __asm__ volatile(
"cpuid\n"
: "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
: "a"(info_type));