28 #ifndef CPU_FEATURES_H
29 #define CPU_FEATURES_H
31 #include <sys/cdefs.h>
41 ANDROID_CPU_FAMILY_UNKNOWN = 0,
42 ANDROID_CPU_FAMILY_ARM,
43 ANDROID_CPU_FAMILY_X86,
44 ANDROID_CPU_FAMILY_MIPS,
45 ANDROID_CPU_FAMILY_ARM64,
46 ANDROID_CPU_FAMILY_X86_64,
47 ANDROID_CPU_FAMILY_MIPS64,
49 ANDROID_CPU_FAMILY_MAX
59 extern AndroidCpuFamily android_getCpuFamily(
void);
66 extern uint64_t android_getCpuFeatures(
void);
204 ANDROID_CPU_ARM_FEATURE_ARMv7 = (1 << 0),
205 ANDROID_CPU_ARM_FEATURE_VFPv3 = (1 << 1),
206 ANDROID_CPU_ARM_FEATURE_NEON = (1 << 2),
207 ANDROID_CPU_ARM_FEATURE_LDREX_STREX = (1 << 3),
208 ANDROID_CPU_ARM_FEATURE_VFPv2 = (1 << 4),
209 ANDROID_CPU_ARM_FEATURE_VFP_D32 = (1 << 5),
210 ANDROID_CPU_ARM_FEATURE_VFP_FP16 = (1 << 6),
211 ANDROID_CPU_ARM_FEATURE_VFP_FMA = (1 << 7),
212 ANDROID_CPU_ARM_FEATURE_NEON_FMA = (1 << 8),
213 ANDROID_CPU_ARM_FEATURE_IDIV_ARM = (1 << 9),
214 ANDROID_CPU_ARM_FEATURE_IDIV_THUMB2 = (1 << 10),
215 ANDROID_CPU_ARM_FEATURE_iWMMXt = (1 << 11),
216 ANDROID_CPU_ARM_FEATURE_AES = (1 << 12),
217 ANDROID_CPU_ARM_FEATURE_PMULL = (1 << 13),
218 ANDROID_CPU_ARM_FEATURE_SHA1 = (1 << 14),
219 ANDROID_CPU_ARM_FEATURE_SHA2 = (1 << 15),
220 ANDROID_CPU_ARM_FEATURE_CRC32 = (1 << 16),
250 ANDROID_CPU_ARM64_FEATURE_FP = (1 << 0),
251 ANDROID_CPU_ARM64_FEATURE_ASIMD = (1 << 1),
252 ANDROID_CPU_ARM64_FEATURE_AES = (1 << 2),
253 ANDROID_CPU_ARM64_FEATURE_PMULL = (1 << 3),
254 ANDROID_CPU_ARM64_FEATURE_SHA1 = (1 << 4),
255 ANDROID_CPU_ARM64_FEATURE_SHA2 = (1 << 5),
256 ANDROID_CPU_ARM64_FEATURE_CRC32 = (1 << 6),
265 ANDROID_CPU_X86_FEATURE_SSSE3 = (1 << 0),
266 ANDROID_CPU_X86_FEATURE_POPCNT = (1 << 1),
267 ANDROID_CPU_X86_FEATURE_MOVBE = (1 << 2),
268 ANDROID_CPU_X86_FEATURE_SSE4_1 = (1 << 3),
269 ANDROID_CPU_X86_FEATURE_SSE4_2 = (1 << 4),
270 ANDROID_CPU_X86_FEATURE_AES_NI = (1 << 5),
271 ANDROID_CPU_X86_FEATURE_AVX = (1 << 6),
272 ANDROID_CPU_X86_FEATURE_RDRAND = (1 << 7),
273 ANDROID_CPU_X86_FEATURE_AVX2 = (1 << 8),
274 ANDROID_CPU_X86_FEATURE_SHA_NI = (1 << 9),
290 ANDROID_CPU_MIPS_FEATURE_R6 = (1 << 0),
291 ANDROID_CPU_MIPS_FEATURE_MSA = (1 << 1),
295 extern int android_getCpuCount(
void);
307 extern int android_setCpu(
int cpu_count, uint64_t cpu_features);
314 extern uint32_t android_getCpuIdArm(
void);
319 extern int android_setCpuArm(
int cpu_count, uint64_t cpu_features, uint32_t cpu_id);