ARM处理器Linux下浮点运算单元运用
---------------
./ Toradex Colibri/Apalis i.MX6/T30编译器选项
取决于在mfloat-abi选项所配置的调用约定为"softfp" 还是"hard"
----------------------------------------------------------------------------------------
-march=armv7-a -mfloat-abi=xxx -mfpu=neon -mtune=cortex-a9 -O3
----------------------------------------------------------------------------------------
./ Toradex Colibri VFxx编译器选项
取决于在mfloat-abi选项所配置的调用约定为"softfp" 还是"hard",未来可以通过更多的mfpu 选项来优化NEON的实现。
----------------------------------------------------------------------------------------
-march=armv7-a -mfloat-abi=xxx -mfpu=neon -mtune=cortex-a5 -O3
----------------------------------------------------------------------------------------
5). 检测一个二进制文件的浮点调用约定
同样以Toradex产品为例,其所发布的Linux Images 所有的object 目标文件都使用ELF,详细介绍请参考:
en.wikipedia.org/wiki/Executable_and_Linkable_Format
首先架构信息(如i686 或者ARM)可以通过" file afile "程序来获取,架构相关属性信息可以通过" readelf –A afile "程序来获取 (原生或者交叉编译ToolChain都可以使用readelf)
如果readelf命令输出信息里面包含"Tag_ABI_VFP_args: VFP registers",则调用约定为硬浮点;如没有,则为软浮点。
./ 以Colibri T20 编译的共享目标文件为例
•使用 VFPv3-D16 指令和寄存器
•不使用 SIMD extensions
•硬调用约定
---------------------------------------------------------------------------------------------------------------------------------------------------
$ file colibri-t20/usr/lib/libcurl.so.5.3.0
colibri-t20/usr/lib/libcurl.so.5.3.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
$ readelf -A colibri-t20/usr/lib/libcurl.so.5.3.0
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3-D16
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_CPU_unaligned_access: v6
---------------------------------------------------------------------------------------------------------------------------------------------------
./ 以NXP/Freescale Vybrid 编译的共享目标文件为例
•使用 VFPv3 指令和寄存器
•使用用 NEON SIMD extensions
•软调用约定
---------------------------------------------------------------------------------------------------------------------------------------------------
$ file twr-vf65gs10/usr/lib/libcurl.so.5.3.0
twr-vf65gs10/usr/lib/libcurl.so.5.3.0: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
$ readelf -A twr-vf65gs10/usr/lib/libcurl.so.5.3.0
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "7-A"
Tag_CPU_arch: v7
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_FP_arch: VFPv3
Tag_Advanced_SIMD_arch: NEONv1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_CPU_unaligned_access: v6
---------------------------------------------------------------------------------------------------------------------------------------------------
./ 以Colibri PXA 编译的共享目标文件为例
•不使用浮点运算单元
•不使用SIMD extensions
•软调用约定
----------------------------------------------------------------------------------------------------
ARM处理器Linux浮点运算单 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)