TYPE3
[iec.git] / src / type3_AndroidCloud / anbox-master / external / cpu_features / include / cpuinfo_aarch64.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_AARCH64_H_
16 #define CPU_FEATURES_INCLUDE_CPUINFO_AARCH64_H_
17
18 #include "cpu_features_macros.h"
19
20 CPU_FEATURES_START_CPP_NAMESPACE
21
22 typedef struct {
23   int fp : 1;     // Floating-point.
24   int asimd : 1;  // Advanced SIMD.
25   int aes : 1;    // Hardware-accelerated Advanced Encryption Standard.
26   int pmull : 1;  // Polynomial multiply long.
27   int sha1 : 1;   // Hardware-accelerated SHA1.
28   int sha2 : 1;   // Hardware-accelerated SHA2-256.
29   int crc32 : 1;  // Hardware-accelerated CRC-32.
30
31   // Make sure to update Aarch64FeaturesEnum below if you add a field here.
32 } Aarch64Features;
33
34 typedef struct {
35   Aarch64Features features;
36   int implementer;
37   int variant;
38   int part;
39   int revision;
40 } Aarch64Info;
41
42 Aarch64Info GetAarch64Info(void);
43
44 ////////////////////////////////////////////////////////////////////////////////
45 // Introspection functions
46
47 typedef enum {
48   AARCH64_FP,
49   AARCH64_ASIMD,
50   AARCH64_AES,
51   AARCH64_PMULL,
52   AARCH64_SHA1,
53   AARCH64_SHA2,
54   AARCH64_CRC32,
55   AARCH64_LAST_,
56 } Aarch64FeaturesEnum;
57
58 int GetAarch64FeaturesEnumValue(const Aarch64Features* features,
59                                 Aarch64FeaturesEnum value);
60
61 const char* GetAarch64FeaturesEnumName(Aarch64FeaturesEnum);
62
63 CPU_FEATURES_END_CPP_NAMESPACE
64
65 #endif  // CPU_FEATURES_INCLUDE_CPUINFO_AARCH64_H_