详细来自: http://blog.sina.com.cn/s/blog_4c451e0e0100sy90.html

Android NDK CPU Features detection library: Android NDK CPU 功能侦测库: -------------------------------------------
This NDK provides a small library named "cpufeatures" that canbe used at runtime to detect the target device's CPU family and theoptional features it supports. NDK 提供一个小的名为 cpufeatures 的库,可以用来在运行时侦测目标设备的 CPU语系和它支持的可选功能。
Usage: 用法: ------
The library is available as an importmodule. 该库是可作为导入模块使用的。
To use it, you must: 要使用它,你必须:
* List 'cpufeatures' in your list of staticlibrary dependencies, as in: * 在你的静态库依赖列表中列出 cpufeatures ,如此:
LOCAL_STATIC_LIBRARIES := cpufeatures
* At the end of your Android.mk, import the'android/cpufeatures' module, as in: * 在你的 Android.mk 文件的末尾,导入android/cpufeatures 模块,如此:
$(call import-module,android/cpufeatures)
* In your source code, include the headernamed <cpu-features.h> , as in: * 在你的源代码中,包含名为 cpu-features.h的头文件,如此:
#include<cpu-features.h>

Here is a simple example: 这里是一个简单示例:
<project-path>/jni/Android.mk: LOCAL_PATH := $(callmy-dir)
include$(CLEAR_VARS) LOCAL_MODULE :=<your-module-name> LOCAL_SRC_FILES :=<your-source-files> LOCAL_STATIC_LIBRARIES:= cpufeatures include$(BUILD_SHARED_LIBRARY)
$(callimport-module,android/cpufeatures)

Features: 功能: ---------
Two functions are provided for now: 现在提供了两个函数:
AndroidCpuFamily android_getCpuFamily();
Returns the target device's CPU Family as anenum. 以枚举型式返回目标设备的 CPU 语系。
For now, the only supported family isANDROID_CPU_FAMILY_ARM. 现在,仅支持的语系是 ANDROID_CPU_FAMILY_ARM 。
uint64_t android_getCpuFeatures();
Returns the set of optional features supported by the device'sCPU. 返回设备 CPU 支持的可选功能集。
The result is a set of bit-flags, each corresponding to one CPU Family-specific optionalfeature. 结果是一组位标志,每一个对应一个 CPU 指定语系的可选功能。
Currently, only the following flags are defined, for the ARMCPU Family: 目前,只为 ARM CPU 语系定义了如下标志:
ANDROID_CPU_ARM_FEATURE_ARMv7
Indicates that the device's CPU supports the ARMv7-Ainstruction set as supported by the "armeabi-v7a" ABI (seeCPU-ARCH-ABIS.html). 指出设备的 CPU 支持 ARMv7-A 指令集与由 armeabi-v7a ABI 支持的等同(参见CPU-ARCH-ABIS.html)。
This corresponds to Thumb-2 and VFPv3-D16 instructions. 这相当于 Thumb-2 和 VFPv3-D16 指令。
ANDROID_CPU_ARM_FEATURE_VFPv3
Indicates that the device's CPU supports the VFPv3 hardwareFPU instruction set extension. 指出设备的 CPU 支持 VFPv3 硬件浮点单元指令集扩展。
Due to the definition of 'armeabi-v7a', this will always be the case if ANDROID_CPU_ARM_FEATURE_ARMv7is returned. 由于 armeabi-v7a 的定义,如果已返回 ANDROID_CPU_ARM_FEATURE_ARMv7这个将无例外地一起返回。
Note that this corresponds to the minimum profile VFPv3-D16that _only_ provides 16 hardware FP registers. 注意相应的最小型 VFPv3-D16 仅支持 16 个硬件浮点寄存器。
详细来自: http://blog.sina.com.cn/s/blog_4c451e0e0100sy90.html
ANDROID_CPU_ARM_FEATURE_NEON
Indicates that the device's CPU supports the ARM AdvancedSIMD (a.k.a. NEON) vector instruction setextension. 指出设备的 CPU 支持 ARM 高级的 SIMD (又叫做,NEON)矢量指令集扩展。 注:NEON 技术是用于多媒体处理的硬件加速。
Note that ARM mandates that such CPUs also implementVFPv3-D32, which provides 32 hardware FP registers (shared with the NEONunit). 注意 ARM 要求这样的 CPU 同样实现 VFPv3-D32 提供 32 个硬件浮点寄存器(与 NEON单元共享)。
Important Note: 重要提示: ---------------
The cpufeatures library will be updatedto support more CPU families and optional features in thefuture. 在将来 cpufeatures 库将更新支持更多 CPU 语系和可选功能。
It is designed to work as-is on all official Android platformversions. 按现状它是被设计工作在全部官方 Android 平台版本上。
Change History: 修订记录: ---------------
Please see the comments in$NDK/sources/android/cpufeatures/cpu-features.c for the complete change history for this library. 请参见 $NDK/sources/android/cpufeatures/cpu-features.c中的注释,了解这个库的完整修订记录。

更多相关文章

  1. Android的Location功能代码
  2. Android 设备管理
  3. android studio 使用adb 命令传递文件到android 设备的方法
  4. android设备你所应该知道的Android设计
  5. android与html5的交互——数据库操作,UI操作,以及html5的localStor
  6. 下一代Android深度前瞻 第18级API功能揭秘

随机推荐

  1. android内核,busybox编译
  2. Android: 用Instrumentation类发送鼠标或
  3. Android(安卓)launcher 源码 app 的启动
  4. Android(安卓)获取设备IP,已连接WiFi信息
  5. android中框架设计的小总结
  6. android 自动亮度控制
  7. Android(安卓)的消息机制(3)
  8. Android(安卓)Base64字符串转换成图片
  9. phonegap创建项目错误
  10. android sdcard使用量