1 /*
2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef SYSTEM_WRAPPERS_INCLUDE_CPU_FEATURES_WRAPPER_H_
12 #define SYSTEM_WRAPPERS_INCLUDE_CPU_FEATURES_WRAPPER_H_
13 
14 #include <stdint.h>
15 
16 #if defined(__cplusplus) || defined(c_plusplus)
17 extern "C" {
18 #endif
19 
20 // List of features in x86.
21 typedef enum { kSSE2, kSSE3 } CPUFeature;
22 
23 // List of features in ARM.
24 enum {
25   kCPUFeatureARMv7 = (1 << 0),
26   kCPUFeatureVFPv3 = (1 << 1),
27   kCPUFeatureNEON = (1 << 2),
28   kCPUFeatureLDREXSTREX = (1 << 3)
29 };
30 
31 typedef int (*WebRtc_CPUInfo)(CPUFeature feature);
32 
33 // Returns true if the CPU supports the feature.
34 extern WebRtc_CPUInfo WebRtc_GetCPUInfo;
35 
36 // No CPU feature is available => straight C path.
37 extern WebRtc_CPUInfo WebRtc_GetCPUInfoNoASM;
38 
39 // Return the features in an ARM device.
40 // It detects the features in the hardware platform, and returns supported
41 // values in the above enum definition as a bitmask.
42 extern uint64_t WebRtc_GetCPUFeaturesARM(void);
43 
44 #if defined(__cplusplus) || defined(c_plusplus)
45 }  // extern "C"
46 #endif
47 
48 #endif  // SYSTEM_WRAPPERS_INCLUDE_CPU_FEATURES_WRAPPER_H_
49