TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / external / cpu_features / include / cpuinfo_arm.h
1 // Copyright 2017 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef CPU_FEATURES_INCLUDE_CPUINFO_ARM_H_
16 #define CPU_FEATURES_INCLUDE_CPUINFO_ARM_H_
17
18 #include "cpu_features_macros.h"
19
20 CPU_FEATURES_START_CPP_NAMESPACE
21
22 typedef struct {
23   int vfp : 1;       // Vector Floating Point.
24   int iwmmxt : 1;    // Intel Wireless MMX Technology.
25   int neon : 1;      // Advanced SIMD.
26   int vfpv3 : 1;     // VFP version 3
27   int vfpv3d16 : 1;  // VFP version 3 with 16 D-registers
28   int vfpv4 : 1;     // VFP version 4 with fast context switching
29   int idiva : 1;     // SDIV and UDIV hardware division in ARM mode.
30   int idivt : 1;     // SDIV and UDIV hardware division in Thumb mode.
31   int aes : 1;       // Hardware-accelerated Advanced Encryption Standard.
32   int pmull : 1;     // Polynomial multiply long.
33   int sha1 : 1;      // Hardware-accelerated SHA1.
34   int sha2 : 1;      // Hardware-accelerated SHA2-256.
35   int crc32 : 1;     // Hardware-accelerated CRC-32.
36
37   // Make sure to update ArmFeaturesEnum below if you add a field here.
38 } ArmFeatures;
39
40 typedef struct {
41   ArmFeatures features;
42   int implementer;
43   int architecture;
44   int variant;
45   int part;
46   int revision;
47 } ArmInfo;
48
49 // TODO(user): Add macros to know which features are present at compile
50 // time.
51
52 ArmInfo GetArmInfo(void);
53
54 ////////////////////////////////////////////////////////////////////////////////
55 // Introspection functions
56
57 typedef enum {
58   ARM_VFP,
59   ARM_IWMMXT,
60   ARM_NEON,
61   ARM_VFPV3,
62   ARM_VFPV3D16,
63   ARM_VFPV4,
64   ARM_IDIVA,
65   ARM_IDIVT,
66   ARM_AES,
67   ARM_PMULL,
68   ARM_SHA1,
69   ARM_SHA2,
70   ARM_CRC32,
71   ARM_LAST_,
72 } ArmFeaturesEnum;
73
74 int GetArmFeaturesEnumValue(const ArmFeatures* features, ArmFeaturesEnum value);
75
76 const char* GetArmFeaturesEnumName(ArmFeaturesEnum);
77
78 CPU_FEATURES_END_CPP_NAMESPACE
79
80 #endif  // CPU_FEATURES_INCLUDE_CPUINFO_ARM_H_